-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_docs.bat
More file actions
60 lines (50 loc) · 1.93 KB
/
Copy pathbuild_docs.bat
File metadata and controls
60 lines (50 loc) · 1.93 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
49
50
51
52
53
54
55
56
57
58
59
60
@echo off
setlocal
REM ==========================================
REM PATH CONFIGURATION
REM ==========================================
set SOURCE_DIR=src\tam
set SPHINX_SOURCE=docs\source
set OUTPUT_DIR=docs\build
echo ==========================================
echo Building Time series Additive Model (TAM) Documentation
echo ==========================================
echo.
echo 1. Cleaning previous builds...
if exist "%OUTPUT_DIR%" rmdir /S /Q "%OUTPUT_DIR%"
if exist "%SPHINX_SOURCE%\api" rmdir /S /Q "%SPHINX_SOURCE%\api"
if not exist "%SPHINX_SOURCE%\_static" mkdir "%SPHINX_SOURCE%\_static"
echo.
echo 2. Scanning source code (sphinx-apidoc)...
sphinx-apidoc -f -q -e -M -o "%SPHINX_SOURCE%\api" "%SOURCE_DIR%" "%SOURCE_DIR%\model" "%SOURCE_DIR%\evaluation"
echo.
echo 3. Building HTML Website...
sphinx-build -q -b html "%SPHINX_SOURCE%" "%OUTPUT_DIR%\html"
if %ERRORLEVEL% NEQ 0 goto :error
echo.
echo 4. Building Comprehensive PDF Manual...
REM No need for custom master_doc flags anymore, Sphinx will use the index
sphinx-build -q -b latex "%SPHINX_SOURCE%" "%OUTPUT_DIR%\latex_manual"
if %ERRORLEVEL% NEQ 0 goto :error
REM Use pushd to safely change directory and popd to return
pushd "%OUTPUT_DIR%\latex_manual"
REM Compile the Master PDF
pdflatex -interaction=nonstopmode TAM_documentation.tex
makeindex -s python.ist TAM_documentation.idx
bibtex TAM_documentation.aux
pdflatex -interaction=nonstopmode TAM_documentation.tex
pdflatex -interaction=nonstopmode TAM_documentation.tex
popd
echo.
echo ==========================================
echo SUCCESS: HTML Site and PDF generated successfully!
echo.
echo 🌐 HTML : %OUTPUT_DIR%\html\index.html
echo 📕 PDF : %OUTPUT_DIR%\latex_manual\TAM_documentation.pdf
echo ==========================================
exit /b 0
:error
echo ==========================================
echo ERROR: Documentation build failed. Check the logs above.
echo ==========================================
exit /b 1