nbsphinx icon indicating copy to clipboard operation
nbsphinx copied to clipboard

Markdown builder output missing code cells

Open douglas-raillard-arm opened this issue 1 month ago • 2 comments

It seems that only markdown cells are included in llms-full.txt generated by sphinx-llm when including a jupyterlab notebook using nbsphinx. sphinx-llm uses sphinx-markdown-builder

The code cells and output are stripped from the generated markdown. Code cells should probably still be included, and ideally the output as well (if it's plain text, richer content like bokeh plots should probably not be included as there is no straightforward conversion to markdown).

douglas-raillard-arm avatar Dec 10 '25 13:12 douglas-raillard-arm

This is unrelated to sphinx-llm, that project just uses sphinx-markdown-builder under the hood.

You should be able to reproduce this with just sphinx, nbsphinx and sphinx-markdown-builder.

sphinx-build -b markdown source dest

jacobtomlinson avatar Dec 10 '25 13:12 jacobtomlinson

I don't know how sphinx-markdown-builder works, but I guess what is missing is the handling of CodeAreaNode (and maybe FancyOutputNode).

PRs welcome!

mgeier avatar Dec 11 '25 17:12 mgeier