-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e3ac72
commit 05501ca
Showing
3 changed files
with
33 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters