Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop dependency to pandoc ? #780

Open
12rambau opened this issue Mar 27, 2024 · 3 comments
Open

drop dependency to pandoc ? #780

12rambau opened this issue Mar 27, 2024 · 3 comments

Comments

@12rambau
Copy link

I recently switch from nb-myst to nbspinx and I'm facing an environment issue every time I want to build my documentation in isolated env or new machines: the dependency to pandoc.

For example in pydata-sphinx-theme CI/CD I'm forced to rely on a custom github action to make sure the installation proceed on every available platform.

I don't know how complicated this might be but would it be possible to remove this dependency and rely on python only tools ?
Note that I will be happy to help but before I dive in I would like to discuss feasability.

@mgeier
Copy link
Member

mgeier commented Mar 27, 2024

Yes, this was the plan all along (see #36), it just hasn't happened yet ...

Currently, Markdown cells are converted to reST (and transformed a bit with the Pandoc machinery) and integrated into a reST template which intermingles them with code cells.

I would like to change this to something like this:

We iterate over all cells while "directly" creating the docutils in-memory representation (without going the detour via reST). In case of code cells, this would be done within nbsphinx, and in case of Markdown cells, an external Python library should be used.

For this, we would need a Python library with a very specific API: It would need to take the text of a single Jupyter-flavored Markdown cell and a "partial" docutils document. It would then have to insert the content from the Markdown text, potentially extending already existing sections from previous Markdown cells.

This would also allow selecting between multiple Markdown parsers, see also #762.

Does that sound reasonable?
Would you have any other suggestions?

I will be happy to help

That's great!

The first thing would be to check if such a Python library already exists.
I am aware of multiple parsers for (different flavors of) Markdown that generate a docutils representation, but I don't know about the aforementioned "partial" functionality. And the library should be extensible enough to add some nbsphinx features like thumbnail galleries etc.

@fzimmermann89
Copy link

Any update here?
I assume this is still planned but not going to land soon due to the required work?

@mgeier
Copy link
Member

mgeier commented Nov 1, 2024

Yeah, there is no news from my side, I haven't put any work into it since my last comment above.

But yes, I'm still planning to work on it, but it won't be ready soon (since I didn't even start yet). Unless somebody steps forward and helps out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants