You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wondering if an nbsphinx option can be added to the sphinx conf to allow nbsphinx to show local line numbers for code blocks? This would make it easier to reference code when writing documentation. In my case, the sphinx documentation is hosted on readthedocs.
Here is a jupyter extension for turning on global line numbers (although I am mainly interested in showing local code block line numbers, as maintaining documentation with global line numbers would be very difficult, unless they automatically update when code above a cell is updated.)
Jupyter notebook github issues/pull requests related to showing line numbers
Just wondering if an nbsphinx option can be added to the sphinx conf to allow nbsphinx to show local line numbers for code blocks?
Sure, I'm open for a PR (as long as line numbers are off by default)!
The last last link mentions that line numbers can be turned on with the following code. Although, I am unsure of how to use this with nbsphinx.
This won't help. The line numbers would have to be implemented using Sphinx mechanisms. But since there are already numbered code blocks in Sphinx, it's probably not a big deal?
Hi all, nbsphinx is great!
Just wondering if an nbsphinx option can be added to the sphinx conf to allow nbsphinx to show local line numbers for code blocks? This would make it easier to reference code when writing documentation. In my case, the sphinx documentation is hosted on readthedocs.
Related info:
Setting line numbers in Jupyter notebooks:
Specifying a custom.js file
From the jupyter notebook gui -> Settings -> Advanced Settings Editor -> edit system defaults
Editing ~/.jupyter/nbconfig/notebook.json
Jupyter notebook extension
Jupyter notebook github issues/pull requests related to showing line numbers
The last last link mentions that line numbers can be turned on with the following code. Although, I am unsure of how to use this with nbsphinx.
Thanks
The text was updated successfully, but these errors were encountered: