-
Notifications
You must be signed in to change notification settings - Fork 669
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
Use Pandoc to convert ipynb into markdown #94
Comments
@jgm in case you've got intuition on this one, does the above look roughly true? |
If you want your code blocks to say
instead of
then you can do
in jekyll will apply the class to the next element. But in pandoc Looks like kramdown supports the
instead of
by disabling
But it doesn't quite work, looks like the markdown writer doesn't add the |
OK, with the commit I'm about to push, the following works to produce the divs with markdown="1":
commit 20a0b4433f1fa72f921b5b660a43c221926634ec |
This would be really great to have ! It looks like R has something in the works using pandoc to convert RMarkdown into Distill-style site(s), Radix. Right now their recommended workflow for Jupyter Notebooks is to convert to markdown, but pandoc would likely be a better bridge between these two projects. |
@emdupre as a user, do you think "you need to use pandoc" would be a big bump in complexity? Most of it would still happen under-the-hood so I don't know that users would need to be exposed to it much (and we could then utilize things like citeproc for references, I believe) I think that @jgm mentioned there may be some changes to how pandoc handles the notebook in the pandoc AST, so we should probably wait until that happens before exploring this further. If somebody wants to prototype ripping out the current markdown conversion and adding a dependency on pandoc (no bells and whistles yet, just current functionality w/ pandoc) then that'd be awesome! |
One question from the user-experience side: would this mean we develop a jupyter-book docker image ? It looks like in converting to pandoc we could pull in their docker container as it's finalized. I'm quite comfortable with docker, and I know we've used it with success in fMRIPrep (i.e., many users are able to run the docker / singularity images, though we do end up with a modest amount of container support on NeuroStars). Relying on users to have a functioning pandoc dependency is the obvious alternative, but in my experience distributing containers is actually easier to debug. I can work on a prototype with the pandoc docker image, if you think that's a viable path forward ! |
I'm a fan of making both an option :-) I think that getting a working Docker image that had:
installed would be a really nice first start and wouldn't be too hard to maintain. I think the biggest challenge there would be figuring out how to expose ports etc properly so that you can still demo your site from within the container. Another thing we'd need to make sure of is that we don't make it less easy to not use Docker (that's a more long-term conversation). |
closing as this will be superceded by https://beta.jupyterbook.org/intro.html |
…s_tests updating CLI docs and adding more tests
Currently we're using nbconvert and a custom template to create jekyll-ready markdown files. Now that pandoc supports jupyter notebooks, perhaps we could use it to offload some custom code onto the (much more well-tested and used) pandoc.
Pandoc will convert Jupyter Notebooks to pandoc-flavored markdown, which is pretty close to jekyll-flavored markdown. I think that if we did the pandoc conversion, then ran find/replaces on:
{:.classname
, not{.classname
I think that this would get us the same functionality, including a ton of metadata from the conversion process.
Also, I don't believe that pandoc is difficult to install since it's got binaries available for many languages. Any feedback on that would be great.
The text was updated successfully, but these errors were encountered: