Skip to content
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

New pages don't always appear in sidebar unless you make clean-doc and completely rebuild. #322

Open
benjamin051000 opened this issue Jan 14, 2025 · 4 comments

Comments

@benjamin051000
Copy link

When adding a new page in a toctree, sometimes it disappears when navigating around the built doc page.

This is only resolved by running make clean-doc and rebuilding after that (e.g., make run).

I presume this is because all pages need to generate their own sidebar ToC, and when adding a page, only a few pages are rebuilt, so others are not made aware of the new page. That would explain why it doesn't show up all the time.

Is there any easy way to fix this, or at least print a warning that a new page requires a complete rebuild?

@SecondSkoll
Copy link
Collaborator

By default sphinx-autobuild only rebuilds pages affected by changes, as you've noted. This helps to minimise processing time, which can be really important for large documentation sets (the largest Canonical documentation set takes ~20 minutes to build on some systems).

We'd need to hook into sphinx-autobuild to provide that warning in the appropriate place for users to really understand this, but we could also just provide some advice on how to build all pages if there are concerns (which just requires the -a option to be passed to sphinx-autobuild).

@medubelko
Copy link

Noting here that files generated/copied by custom scriptlets in conf.py are particularly susceptible to the overall regen problem. For my projects I'm considering adding a rebuild-docs command that cleans + builds to provide a completely fresh artifact. Not sure how to account for that with autobuild.

@SecondSkoll
Copy link
Collaborator

@medubelko Have you tried the sphinx-autobuild -a option on I referenced above?

@medubelko
Copy link

I haven't tested autobuilds against the odd autogen issue, no. I'll try it next time I run into one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants