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

Only check source files that are in "found_docs" #60

Closed
wants to merge 2 commits into from

Conversation

mgeier
Copy link
Owner

@mgeier mgeier commented Aug 26, 2023

This is an alternative (and an extension) to #57.

@@ -276,6 +276,11 @@ def _builder_inited(app):

def _source_read(app, docname, source):
env = app.env
if docname not in env.found_docs:
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't work in my case when sphinx-build is called from the documentation root. The issue is that the included file is also used as a main document in the toctree. So for in-source builds, _source_read gets called as follows:

_source_read(app, "including-doc", ...)  # The doc with the include
_source_read(app, "included-doc", ...)  # From include
_source_read(app, "included-doc", ...)  # As main document

When running sphinx-build from a different location, we get:

_source_read(app, "including-doc", ...)  # The doc with the include
_source_read(app, "path/to/included-doc", ...)  # From include
_source_read(app, "included-doc", ...)  # As main document

Copy link
Owner Author

Choose a reason for hiding this comment

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

Ah, OK, so there are still duplicates ...

I combined your #57 and my #60 in #61, does that work?

@mgeier
Copy link
Owner Author

mgeier commented Aug 26, 2023

Obsoleted by #61.

@mgeier mgeier closed this Aug 26, 2023
@mgeier mgeier deleted the docname-in-found-docs branch August 26, 2023 14:59
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

Successfully merging this pull request may close these issues.

2 participants