Comments (17)
I had to add 'IPython.sphinxext.ipython_console_highlighting'
to extensions
in my conf.py
. Somehow the old IPython docs have this info but the new ones don't.
Adding '**.ipynb_checkpoints'
to exclude_patterns
fixed the other problem.
Thanks!
from nbsphinx.
What do you mean by "a bug in its installation procedure"?
expected behavior:
- install the
ipython
package - the
'ipython3'
lexer is available without additional actions to be taken
your observed behavior:
- install
ipython
- the
'ipython3'
lexer is not available
Therefore, I suspect there is a bug somewhere.
I don't know how the "registration" process of the lexer is supposed to work, but it definitely shows different behavior on different systems.
For me, on Linux/Debian shows the expected behavior.
It works also for the automatic build on readthedocs.
from nbsphinx.
ipywidgets
should only be required if there are widgets in the notebooks, more specifically, if there is some application/vnd.jupyter.widget-state+json
data.
If you have widgets, you somehow have to provide the appropriate JavaScript files, which is done automatically if ipywidgets
is available or manually with nbsphinx_widgets_path
, see https://nbsphinx.readthedocs.io/en/0.8.9/code-cells.html#Interactive-Widgets-(HTML-only).
If none of your notebooks has any widgets but the warning is still shown, please let me know, because that may be a bug.
And yes, if you want to have code highlighting in code cells, you'll have to install IPython, see https://nbsphinx.readthedocs.io/en/0.8.9/installation.html#Pygments-Lexer-for-Syntax-Highlighting.
from nbsphinx.
A new issue appeared very recently, see #687.
from nbsphinx.
Hmm, for me this has always worked; the lexer should be part of the "IPython" package: http://ipython.readthedocs.org/en/stable/development/lexer.html.
Can you try to re-install this package?
This happens even with an empty
index.rst
file (it seems to find my.ipynb_checkpoints
folder).
Yes, Sphinx searches the whole source directory (including subfolders) for notebook files and parses all of them, regardless of what's in your index.rst
. You should probably add something like this to your conf.py
:
exclude_patterns = ['_build', '**.ipynb_checkpoints']
See http://nbsphinx.readthedocs.org/en/latest/usage.html.
from nbsphinx.
Good to know that you found a solution that works for you!
But still, IMHO the ipython3
lexer should work automatically.
I've never used ipython_console_highlighting
(or anything else) explicitly and it just works.
I think this should be somehow be automatically registered when installing the IPython
package.
from nbsphinx.
FWIW: I'm also hitting this same warning when building the documentation of the the nbsphinx
repo. After cloning and installing dependencies, I run sphinx-build -b html doc doc/html
whilc checked out to version 0.2.8
.
The fix proposed by @ostrokach :
I had to add 'IPython.sphinxext.ipython_console_highlighting' to extensions in my conf.py.
also worked for me, warnings are gone.
Thanks!
from nbsphinx.
The advise of
adding 'IPython.sphinxext.ipython_console_highlighting' to extensions in my conf.py
is not in the installation instructions yet, should it be added? I also receive this warning
/Users/klay6683/Dropbox/src/pyciss/docs/examples.ipynb:: WARNING: Pygments lexer name 'ipython3' is not known
multiple times for a single almost empty notebook and adding the above extension removed (masked?) that warning.
from nbsphinx.
@michaelaye If you get the warning even if you have the ipython
package installed, this is IMHO a bug in its installation procedure. I'm re-opening this issue as a reminder.
Adding the IPython.sphinxext.ipython_console_highlighting
extension is only a work-around, but not the real solution of the problem.
We can add a hint regarding the work-around to the docs (feel free to make a PR!), but it would be also very good to find the actual cause for the problem (and solve it).
from nbsphinx.
I'm getting the same warnings. I set up a fresh conda environment, installed all packages as described in http://nbsphinx.readthedocs.io/en/0.2.12/usage.html
What do you mean by "a bug in its installation procedure"?
from nbsphinx.
So the reason might be a buggy Anaconda package: ContinuumIO/anaconda-issues#1430
from nbsphinx.
I'm not sure if the Anaconda package is still broken, but this can definitely be solved by using the conda-forge
channel.
from nbsphinx.
FWIW, I have not had problems with syntax highlighting in nbsphinx when I build locally, but I hit this problem when building with nbsphinx on readthedocs. Not sure if this is helpful or not.
from nbsphinx.
OK, looks like I just needed to add ipython to the requirements.txt; didn't need to add the extension referenced above.
from nbsphinx.
The port version on macOS gives the same error. The one installed from pip works fine.
from nbsphinx.
I know this issue is ancient, but I just encountered the same problem on ReadTheDocs with all the latest versions. A simple pip install sphinx nbsphinx
doesn't install ipython, so I end up with the warning message:
foo.ipynb:: WARNING: Pygments lexer name 'ipython3' is not known
If I also install ipython, the warning message changes:
WARNING: nbsphinx_widgets_path not given and ipywidgets module unavailable
So it seems like either ipywidgets is required, or nbsphinx_widgets_path
must be set. Should ipywidgets be listed as a required dependency, or is this an optional dependency only needed for the ipython lexer?
from nbsphinx.
Hello, I have the same issue as @adamjstewart and my code highlight in the jupyter pages doesn't work and it broke a few days or weeks ago.
Example: https://syscorrfw.readthedocs.io/en/latest/particleid_weight_production.html
Is this issue already being worked on?
Which steps should I take to resolve it for my package?
from nbsphinx.
Related Issues (20)
- Failure on multi-line maths with leading indentation
- Scroll long output HOT 1
- 0.9.2: documentation build fails HOT 1
- `DataFrame` with long column labels is not rendered correctly with the `pydata` theme HOT 1
- What's the best way to add support for sphinx directives in markdown cells? HOT 3
- xelatex support HOT 3
- How to link to a notebook from another file ? HOT 2
- WARNING: toctree glob pattern '*.ipynb' didn't match any documents HOT 1
- Math rending issue after converting the doc HOT 1
- nbsphinx PDF don't render Ploty Plot HOT 2
- Backslashes in markdown cells are sometimes incorrectly interpreted as inline TeX HOT 4
- Error on cells using tqdm
- Error on cells using progress bar (tqdm) HOT 7
- Avoid sphinx searching on output cells HOT 10
- Custom nbsphinx-gallery.css does not take into account - sphinx 7.2.6 HOT 7
- drop dependency to pandoc ? HOT 1
- AssertionError in `depart_codearea_latex()` HOT 4
- Conflict between sphinx.ext.autosectionlabel and nbsphinx HOT 2
- Matplotlib figures are not shown on the compiled documentation. HOT 6
- Default thumbnail asset not found HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nbsphinx.