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

Links to sample md files do not work in read the docs #255

Closed
mwouts opened this issue Jun 16, 2019 · 5 comments
Closed

Links to sample md files do not work in read the docs #255

mwouts opened this issue Jun 16, 2019 · 5 comments
Milestone

Comments

@mwouts
Copy link
Owner

mwouts commented Jun 16, 2019

I just subscribed to the Tracking Jupyter newletter by @psychemedia (Super interesting, thanks Tony for your work there, and for all the mentions of Jupytext!)... and I wanted to answer one question by Tony - He was wondering how the pandoc Markdown format compares to Jupytext's one.

The answer is in the demo folder, where the World population notebook is represented in each of the available formats.

But on this occasion, I also see that the link to the pandoc sample in our readthedocs documentation does not work - it goes to https://github.com/mwouts/jupytext/blob/master/demo/World population.pandoc instead of https://github.com/mwouts/jupytext/blob/master/demo/World population.pandoc.md, i.e. the .md extension is missing. @choldgraf, maybe you will know how to fix that? Thanks!

@choldgraf
Copy link
Contributor

I think I figured this out, will add it to #257

@mwouts mwouts closed this as completed in c1b802c Jun 20, 2019
@mwouts
Copy link
Owner Author

mwouts commented Jun 20, 2019

The link is working now! Thanks Chris.

@mwouts mwouts added this to the 1.1.7 milestone Jun 20, 2019
@psychemedia
Copy link

Re: the diffs between Jupytext and pandoc .md: thanks for that demo folder. Just been having an explore via @choldgraf's Binder link in #257 and the diffs seem to be quite mechanical, e.g. pandoc's use of ::: {.cell .markdown} delimiters.

Are the differences in the use of apostrophes in the jupytext header metadata meaningful?

image

Also, I note a diff in the presence of the nbformat metadata?

@mwouts
Copy link
Owner Author

mwouts commented Jun 21, 2019

Are the differences in the use of apostrophes in the jupytext header metadata meaningful?

I think they are not. I mean, both headers are valid YAML. Probably the difference here comes from the way they are written. Jupytext's one is writen with pyyaml, while Pandoc's one is writen by pandoc itself.

Also, I note a diff in the presence of the nbformat metadata?

Pandoc preserves the nbformat information by including it in the notebook metadata (in the notebook itself it is at a different level). I have not seen the need for that yet in the other formats.

@psychemedia , you should expect a few more differences on

  • markdown cells with metadata
  • and markdown cells with two consecutive blank lines.

We discussed the two formats some time ago with @jgm on pandoc-discuss. Given the differences, I have chosen to implement the pandoc format by calling pandoc itself, cf. pandoc.py, after applying Jupytext's filters on the notebook and cell metadata (otherwise you would have seen a longer header). You could also have a look at #208, especially to the recent discussion with @ickc starting with this comment.

@ickc
Copy link

ickc commented Jun 21, 2019

@psychemedia, note that markdown has a lot of different flavors and pandoc is one of them. (pandoc is both a program that converts between a ton of formats, and a markdown flavor, occasionally called Pandoc Favored Markdown.)

the ::: and {} you are seeing are the div marker and attribute markers respectively. The diff. you're seeing is the YAML header is because pandoc has its own YAML parser that is written in Haskell (in fact most of pandoc is written in Haskell.)

At the very least you could consider the diff you're seeing is just 2 different "flavors", 2 different ways a mapping between ipynb and md can be realized.

@mwouts mwouts mentioned this issue Jun 21, 2019
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

4 participants