Skip to content

Commit

Permalink
markdown tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarketDataApp committed Feb 9, 2024
1 parent 1e3ac72 commit 05501ca
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 295 deletions.
37 changes: 28 additions & 9 deletions .scripts/gomarkdoc.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,46 @@
#!/bin/bash

# Create a temporary directory using mktemp
TMP_DIR=$(mktemp -d)
# Function to create a new temporary directory
create_tmp_dir() {
echo $(mktemp -d)
}

# Adjust to point to the project root from .scripts
SRC_DIR="$(dirname "$0")/.."
# Define the output directory for the markdown file within the .scripts directory
OUTPUT_DIR="$(dirname "$0")"
MAIN_FILE="indices_candles.go" # Main source file
TEST_FILE="indices_candles_test.go" # Corresponding test file
MODELS_DIR="models" # Models directory relative to the project root
MODEL_MAIN_FILE="$MODELS_DIR/indices_candles.go" # Main model file
MODEL_TEST_FILE="$MODELS_DIR/indices_candles_test.go" # Model test file

echo "Using temporary directory: $TMP_DIR"
# Step 1: Documentation for main files
TMP_DIR=$(create_tmp_dir)
echo "Using temporary directory for main files: $TMP_DIR"

# Copy the main file and its test file to the temporary directory
cp "$SRC_DIR/$MAIN_FILE" "$TMP_DIR"
cp "$SRC_DIR/$TEST_FILE" "$TMP_DIR"

# Optionally, copy any dependencies needed for documentation generation
# Run gomarkdoc on the temporary directory for main files
gomarkdoc --output "$OUTPUT_DIR/indices_candles_request.md" "$TMP_DIR"

# Run gomarkdoc on the temporary directory
gomarkdoc --output "$OUTPUT_DIR/sdk-go.md" "$TMP_DIR"
# Clean up: remove the temporary directory for main files
rm -rf "$TMP_DIR"

# Clean up: remove the temporary directory
# rm -rf "$TMP_DIR"
# Step 2: Documentation for model files
TMP_DIR=$(create_tmp_dir)
echo "Using new temporary directory for model files: $TMP_DIR"

echo "Documentation generated for $MAIN_FILE and $TEST_FILE"
# Copy the model file and its test file to the new temporary directory
cp "$SRC_DIR/$MODEL_MAIN_FILE" "$TMP_DIR"
cp "$SRC_DIR/$MODEL_TEST_FILE" "$TMP_DIR"

# Run gomarkdoc on the new temporary directory for model files
gomarkdoc --output "$OUTPUT_DIR/indices_candles_response.md" "$TMP_DIR"

# Clean up: remove the new temporary directory for model files
rm -rf "$TMP_DIR"

echo "Documentation generated for main files and model files"
281 changes: 0 additions & 281 deletions .scripts/markdowntest.md

This file was deleted.

10 changes: 5 additions & 5 deletions indices_candles.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
// It encapsulates parameters for resolution, symbol, and date to be used in the request.
// This struct provides methods such as Resolution(), Symbol(), Date(), and From() to set these parameters respectively.
//
// Public Methods:
// - Resolution(q string) *IndicesCandlesRequest: Sets the resolution parameter for the request.
// - Symbol(q string) *IndicesCandlesRequest: Sets the symbol parameter for the request.
// - Date(q interface{}) *IndicesCandlesRequest: Sets the date parameter for the request.
// - From(q interface{}) *IndicesCandlesRequest: Sets the 'from' date parameter for the request.
// #### Public Methods:
// - `Resolution(q string) *IndicesCandlesRequest`: Sets the resolution parameter for the request.
// - `Symbol(q string) *IndicesCandlesRequest`: Sets the symbol parameter for the request.
// - `Date(q interface{}) *IndicesCandlesRequest`: Sets the date parameter for the request.
// - `From(q interface{}) *IndicesCandlesRequest`: Sets the 'from' date parameter for the request.
type IndicesCandlesRequest struct {
*baseRequest
resolutionParams *parameters.ResolutionParams // Holds the resolution parameter of the request.
Expand Down

0 comments on commit 05501ca

Please sign in to comment.