-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild_docs.sh
More file actions
executable file
·48 lines (40 loc) · 1.4 KB
/
build_docs.sh
File metadata and controls
executable file
·48 lines (40 loc) · 1.4 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
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Script to build and serve documentation locally for development
set -e
echo "📚 libCacheSim-python Documentation Builder"
echo "=========================================="
# Check if we're in the right directory
if [ ! -f "docs/mkdocs.yml" ]; then
echo "❌ Error: mkdocs.yml not found. Please run this script from the project root."
exit 1
fi
# Change to docs directory
cd docs
# Check if dependencies are installed
if ! python -c "import mkdocs_material, mkdocs_static_i18n" 2>/dev/null; then
echo "🔧 Installing documentation dependencies..."
pip install -r requirements.txt
else
echo "🔧 Dependencies already installed"
fi
# Build documentation
echo "🏗️ Building documentation..."
python -m mkdocs build --clean --strict
# Check if serve flag is passed
if [ "$1" = "--serve" ] || [ "$1" = "-s" ]; then
echo "🚀 Starting development server..."
echo "📖 Documentation will be available at: http://127.0.0.1:8000"
echo "🌐 English docs: http://127.0.0.1:8000/en/"
echo "🌏 Chinese docs: http://127.0.0.1:8000/zh/"
echo ""
echo "Press Ctrl+C to stop the server"
python -m mkdocs serve
else
echo "✅ Documentation built successfully!"
echo "📁 Output directory: docs/site/"
echo ""
echo "To serve locally, run:"
echo " ./scripts/build_docs.sh --serve"
echo " OR"
echo " cd docs && python -m mkdocs serve"
fi