Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ build:
os: "ubuntu-24.04"
tools:
python: "3.13"
jobs:
post_checkout:
# Set up symbolic link based on RTD project name
- |
if [ "$PROJECT_VERSION" = "brainpy-version2" ]; then
ln -sf docs_version2 docs_build
else
ln -sf docs docs_build
fi
Comment on lines +15 to +20
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Check for existence of target before creating symlink.

If docs_build is an existing directory, overwriting it with ln -sf may cause build issues. Please check and remove docs_build if necessary before creating the symlink.

Suggested change
- |
if [ "$PROJECT_VERSION" = "brainpy-version2" ]; then
ln -sf docs_version2 docs_build
else
ln -sf docs docs_build
fi
- |
# Remove docs_build if it exists (directory or symlink)
if [ -e docs_build ]; then
rm -rf docs_build
fi
if [ "$PROJECT_VERSION" = "brainpy-version2" ]; then
ln -s docs_version2 docs_build
else
ln -s docs docs_build
fi


# Build documentation in the docs/ directory with Sphinx
# Build documentation using the symlinked directory
sphinx:
configuration: docs/conf.py
configuration: docs_build/conf.py

# Optionally set the version of Python and requirements required to build your docs
python:
Expand Down
21 changes: 0 additions & 21 deletions docs_version2/.readthedocs.yml

This file was deleted.

Loading