-
Notifications
You must be signed in to change notification settings - Fork 132
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
Converting from sphinx-nbextensions to nbsphinx #653
Comments
I can move the examples manually into I suppose another hacky way to solve this is to write a |
With If you don't want that, you can try https://github.com/vidartf/nbsphinx-link, but this has its own limitations. You can also try to use symbolic links, but this might also lead to problems, see #49.
Sphinx expects all source files to be in a toctree and normally that's what you want, so you should put them into a toctree. If you have a reason not to put them into a toctree, you can mark them as "orphan" (see https://nbsphinx.readthedocs.io/en/0.8.9/orphan.html), which gets rid of the warning. |
Thanks @mgeier! Reading further on sphinx's page, I can apparently treat conf.py like an extension. I can try defining
Good point. If my |
Yes, but that seems overkill to me. I would only use that as a last resort, if nothing else works. I don't really know how the structure of your project looks like, so I can't really give any recommendations. I think it would be helpful if you could create and share a new minimal dummy project that has the same structure as you would like to have in your real project. Then we can experiment with that. |
Larger, real repo is pysindy, but I built a simpler MWE for this issue. I added the conf.py edits that i mentioned, so this project's docs build "correctly" and without toctree errors. If you want to close this issue as completed, it's fine with me - other people with the same issue will be able to find this as a how-to guide. More broadly, the problem is that there are other tools for dealing with notebooks in a repo. Any tool that doesn't implement globs/regexs for configuring where to find files has to assume something about directory structure - which may conflict with other tools that do the same. |
Thanks for the minimal(-ish) example! This is still quite a lot to digest ... Is the In general, I think generating temporary files in the source directory should be avoided but that might not always be possible, see sphinx-doc/sphinx#10641 I also don't understand why you have both Once those things are clarified (and ideally simplified), I would like to come back to your original question.
I don't understand. Can you please give an example for when those errors happen? |
I'm closing this for lack of response, but if there is still something to discuss, feel free to leave another comment! |
Python: 3.8.10
nbsphinx: 0.8.9
Hi, I'm trying convert from
sphinx-nbextensions
tonbsphinx
since the former is deprecated in favor of this repo. I've left the title general so as to avoid giving you an XY problem, but my specific issue is thatsphinx-nbextensions
finds notebooks & a README.rst in the project directory (usingexample_gallery_config
in conf.py) and createsdocs/examples/
, adding the notebook .rst files and an index.rst. This is somewhat analogous to howapidoc_module_dir
takes files frompackage/
and puts them indocs/api
. My project layout isMy index.rst has the toctrees:
I'm not sure how to configure
nbsphinx
to work. Just swapping out the extension one-for-one gives the:toctree contains reference to nonexisting document 'examples/index'
error becausenbsphinx
is not looking insource_tree/examples/
. I'd like to be able to tell it to do that. I don't see any analogous config option toapidoc_module_dir
orexample_gallery_config
.The text was updated successfully, but these errors were encountered: