jupyter / nbconvert

Jupyter Notebook Conversion
https://nbconvert.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.7k stars 562 forks source link

nbconvert export omits markdown cells #2017

Open janr85 opened 1 year ago

janr85 commented 1 year ago

I have noticed that newer base and minimal docker images on dockerhub do not export markdown cells to asciidoc format. It seems that this problem has been introduced at some point of version 7.5.0.

For further details, please have a look at this stackoverflow question.

janpfeifer commented 10 months ago

Similar here, when running jupyter nbconvert --execute -to asciidoc some_notebook.ipynb and the notebook outputs even the most trivial text/markdown MIME data (just a simple "hello world" message), nbconvert will output empty instead.

Curiously this is part of a test for GoNB, a Go Kernel, and it used to work just a few weeks ago. But since then I did some updates to Jupyter and related packages so versions have changed (but I wouldn't know which).

Currently I have:

JupyterLab version: 4.0.6 jupyter nbconvert --version: 7.8.0 jupyter server --version: 2.7.3

janpfeifer commented 10 months ago

I should also mention that if using nbconvert --to=html it works just fine, it will convert the output of markdown. It's an issue only with --to=asciidoc.

saf-dmitry commented 5 months ago

By converting to Asciidoc nbconvert outputs following error messages for each Markdown cell:

Unknown option --atx-headers.
Try pandoc --help for more information.

It seems, the problem is that nbconvert uses obsolete pandoc option --atx-headers instead of recent --markdown-headings=atx.

See markdown2asciidoc function definition.

thomasjm commented 1 month ago

Hello, would someone like to try the fix here? https://github.com/jupyter/nbconvert/pull/2152

janpfeifer commented 1 month ago

Hello, would someone like to try the fix here? #2152

Many thanks for the fix!!

I'd be happy to try it for GoNB test. Is it part of a pip package already ?

thomasjm commented 1 month ago

No, I'm not a maintainer here. You'll have to use my branch.

I've tested it myself now and it seems to work.

If you happen to use Nix, you can build a working nbconvert with this patch: https://github.com/codedownio/nixpkgs/commit/7968f56301f6fe8448bd4b2643571faa71fde741

jeffmelville commented 3 weeks ago

I'm having this issue as well. I haven't tried the fix verbatim, but modifying the pandoc arguments to --markdown-headings=atx is working as a temporary workaround. +1 for getting this fix in