mirror of
https://github.com/TeachBooks/manual.git
synced 2026-11-12 22:35:51 +00:00
Create sphinx-autobuild.sh
This commit is contained in:
parent
6f44de51c0
commit
c51586746c
1 changed files with 27 additions and 0 deletions
27
sphinx-autobuild.sh
Normal file
27
sphinx-autobuild.sh
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Deactivate any active conda environment
|
||||
conda deactivate 2>/dev/null || true
|
||||
|
||||
# Clear conda environment variables
|
||||
unset CONDA_DEFAULT_ENV CONDA_PROMPT_MODIFIER 2>/dev/null || true
|
||||
|
||||
# Create a Python virtual environment
|
||||
python -m venv venv
|
||||
|
||||
# Activate the virtual environment
|
||||
source venv/Scripts/activate
|
||||
|
||||
# Install required packages from requirements.txt and sphinx-autobuild
|
||||
pip install -r requirements.txt sphinx-autobuild
|
||||
|
||||
# Initialize Jupyter Book configuration for the book directory
|
||||
jupyter-book config sphinx book/
|
||||
|
||||
# Disable display of all git authors in Sphinx documentation
|
||||
# by changing 'git_show_all_authors' from True to False in conf.py
|
||||
sed -i 's/git_show_all_authors = True/git_show_all_authors = False/' book/conf.py
|
||||
|
||||
sed -i "s/external_toc_path = '_toc.yml'/external_toc_path = '_toc_with_local_paths.yml'/" book/conf.py
|
||||
|
||||
# Build and serve the Sphinx documentation with auto-reload
|
||||
# Opens browser automatically and ignores build artifacts and Python files
|
||||
sphinx-autobuild book book/_build/html --open-browser --ignore "book/_build/**" --pre-build "teachbooks build book/ --process-only"
|
||||
Loading…
Add table
Add a link
Reference in a new issue