forked from ngrayluna/generate-wandb-python-reference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_wandb_sdk_docs.sh
More file actions
35 lines (27 loc) · 1.1 KB
/
create_wandb_sdk_docs.sh
File metadata and controls
35 lines (27 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
TEMP_DIR=wandb_sdk_docs
DESTINATION_DIR=python
# Check if the directory exists, if it does, remove it else create it
if [ -d "$TEMP_DIR" ]; then
echo "Directory '$TEMP_DIR' already exists. Removing it."
rm -rf "$TEMP_DIR"
else
echo "Directory '$TEMP_DIR' does not exist. Creating it."
fi
# Check if the destination directory exists, if it does, remove it else create it
if [ -d "$DESTINATION_DIR" ]; then
echo "Directory '$DESTINATION_DIR' already exists. Removing it."
rm -rf "$DESTINATION_DIR"
else
echo "Directory '$DESTINATION_DIR' does not exist. Creating it."
fi
# Generate SDK docs using lazydocs
python generate_sdk_docs.py --temp_output_directory=$TEMP_DIR
# Process output doc created by lazydocs so it works with Docusaurus
python process_sdk_markdown.py --output_directory=$TEMP_DIR
# Make destination directory
mkdir -p $DESTINATION_DIR
# Sort and create subdirectories based on API or DataType
python sort_markdown_files.py --source_directory=$TEMP_DIR --destination_directory=$DESTINATION_DIR
# Create _index.md files
python create_landing_pages.py --source_directory=$DESTINATION_DIR