-
Notifications
You must be signed in to change notification settings - Fork 101
fix(docs): update Read the Docs configuration for symbolic link handling #784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR enhances the Read the Docs configuration by introducing a conditional post_checkout job that symlinks the appropriate docs directory for versioned builds, updates the Sphinx configuration path to use the new symlink, and removes the obsolete version-specific RTD config file. Flow diagram for symbolic link setup in Read the Docs configflowchart TD
Start([Start build]) --> CheckVersion{"$PROJECT_VERSION = brainpy-version2?"}
CheckVersion -- Yes --> SymlinkV2["Symlink docs_version2 to docs_build"]
CheckVersion -- No --> SymlinkDefault["Symlink docs to docs_build"]
SymlinkV2 --> SphinxBuild["Run Sphinx on docs_build/conf.py"]
SymlinkDefault --> SphinxBuild
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.readthedocs.yml:15-20` </location>
<code_context>
+ # 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
</code_context>
<issue_to_address>
**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.
```suggestion
- |
# 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
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| - | | ||
| if [ "$PROJECT_VERSION" = "brainpy-version2" ]; then | ||
| ln -sf docs_version2 docs_build | ||
| else | ||
| ln -sf docs docs_build | ||
| fi |
There was a problem hiding this comment.
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.
| - | | |
| 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 |
Summary by Sourcery
Standardize Read the Docs builds by using a symlinked docs_build directory to handle multiple documentation versions
Enhancements: