-
Notifications
You must be signed in to change notification settings - Fork 198
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
Sphinx roles and directives not working in generated examples #1195
Comments
We do this all the time in MNE-Python, e.g.: has proper links https://mne.tools/dev/auto_tutorials/intro/10_overview.html#loading-data Maybe it's some incompatibility or conflict with |
Just to make sure: the rest of the text block is indeed being rendered as text, not as code comments? if the line(s) are mistakenly treated as code comments then sphinx roles won't be parsed. |
Looks like there was a conflict with |
I would expect ":class:my_project.my_class" in a text block to be converted to a link to this class in my documentation's API
It should work. I believe that the proper syntax is :class:`my_project.my_class`
|
I have a set of .py example files containing rst text blocks which I am trying to generate into a gallery of examples using sphinx-gallery. However, links for sphinx roles and directives are not being generated.
For example, I would expect ":class:
my_project.my_class
" in a text block to be converted to a link to this class in my documentation's API, however it remains as the raw text ":class:my_project.my_class
" in the generated example files. Similarly, citations to bibiliography entries using ":footcite:" also do not render correctly. I have no issues using these roles and directives elswehere in the documentation, and there are no warnings from sphinx that the objects referenced within the example files cannot be found.I have compared my config settings with other projects where I know these roles to be working in the generated examples, however I do not notice anything which I am obviously doing wrong. For building the documentation, I am using the following settings:
The only thing I have noticed is that the sources of the auto_example html files have the suffix
.ipynb.txt
, whereas in other projects I have seen this as.rst.txt
, e.g.build/html/auto_examples/plot_compute_my_example.html
has sourcebuild/html/_sources/auto_examples/plot_compute_my_example.ipynb.txt
. I have no idea how to specify the source files to be.rst.txt
files, so I cannot test if this is what is causing the problem.I'm really stumped with this one, so any help is greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: