Open jaymegordo opened 3 years ago
I am experiencing the same issue. When I run nbconvert with different styles and then diff the files there is no difference.
I got the solution for this after a lot of time
This solution contains changing Python Library Files (not recommended)
Step 1 : Go to .\Python\Python39\Lib\site-packages\nbconvert\preprocessors
Step 2: Open csshtmlheader.py
with any text-editor
Step 3: In class CSSHTMLHeaderPreprocessor
there will be style
variable, which will have default_value=JupyterStyle
, just change value after =
to any style you want but in quotes( inverted commas )
for example : default_value='vs'
Step 4: Save the file
Now, you can run the command jupyter nbconvert --to html notebook.ipynb
, you do not need to add --CSSHTMLHeaderPreprocessor.style=<name>
, because by default it will be given the style you mention in csshtmlheader.py.
I don't know why the tag is not working as stated in Jupyter Docs
For available styles run this command: pygmentize -L styles
@RagnosVA your methods works, but obviously hardwire you to a specific style defeating the purpose of the command line option
I opened a PR with a generalised fix https://github.com/jupyter/nbconvert/pull/1548
Description
I use
--CSSHTMLHeaderPreprocessor.style=solarized-dark
for example when exporting a notebook to modify the code syntax highlighting. In>6.0.0
this fails (silently) and only uses the default syntax. I've tested by both completely reinstalling everything in a new venv (still fails), then downgrading to5.6.1
(works again).Is there any way to confirm that
nbconvert
can find the correctpygments
styles?Reproduce
ipython
andnbconvert
jupyter nbconvert --to html my_notebook.ipynb --CSSHTMLHeaderPreprocessor.style=solarized-dark
(doesnt use this theme's syntax)Nbconvert version: 6.0.7