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

Allow docname to be None in source-read event #59

Closed
wants to merge 2 commits into from

Conversation

mgeier
Copy link
Owner

@mgeier mgeier commented Aug 26, 2023

I don't know why that happens, but it seems to happen since Sphinx 7.2, most likely since sphinx-doc/sphinx#11510.

This has also been reported in sphinx-doc/sphinx#11620, but it has been closed.

@mgeier
Copy link
Owner Author

mgeier commented Aug 26, 2023

I have created sphinx-doc/sphinx#11648 with some more information.

@mgeier
Copy link
Owner Author

mgeier commented Aug 26, 2023

This is obsolete if #60 is merged.

@lucyleeow
Copy link

lucyleeow commented Aug 26, 2023

The None could be caused by the same reason as in Sphinx Gallery: sphinx-gallery/sphinx-gallery#1175 (comment) (file suffix not contained within app.config.source_suffix).

@mgeier
Copy link
Owner Author

mgeier commented Aug 26, 2023

Thanks @lucyleeow! Yes, it looks like it. But I don't see a reason why a file included with the include directive should be required to have one of the suffixes from source_suffix. Is this documented anywhere?

Anyway, it's not a big deal, I can easily check for None and work around this problem.

@lucyleeow
Copy link

Yes documentation could be improved. AFAICT its due to this part in path2doc which has always been in that function:
https://github.com/sphinx-doc/sphinx/blob/5e88b9f88665dd8782b9feb381b499ae580cfa1a/sphinx/project.py#L91

So just their definition of docname?

@mgeier
Copy link
Owner Author

mgeier commented Aug 26, 2023

As I understand it (which might be wrong), the term "document" means that it is part of the TOC (or as special case an "orphaned" document), but something included by the include directive is not necessarily a "document". Does that make sense?

If that's true, I think the path2doc is fine if it checks source_suffix, because it is about a "document". However, the source-read even is not only called for "documents" (since Sphinx 7.2). I think the documentation of the source-read event should be updated.

@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-is-none 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.

None yet

2 participants