question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider using pandoc markdown for "div"s and RMarkdown for code cells in Jupytext markdown

See original GitHub issue

In using Jupytext, I’ve found that I’d love to have a combination of two features from two different markup languages supported by jupytext:

Pandoc div fences for markdown cells

I often want to tag-up my markdown with metadata that is cell-specific, which means that I need to be able to separate out my markdown chunks into multiple cells. Right now in Jupytext, the way to do this is to write <!-- md --> and <!-- endmd -->. This isn’t bad, but it is a bit cumbersome. I find it much more streamlined to use the Pandoc syntax for divs, such as:

:::md
:::

as opposed to

<!-- #md -->
<!-- #endmd -->

This could be extended to other types as well, e.g.:

:::raw
:::

What do you think about supporting syntax such as this for Jupytext markdown?

RMarkdown code blocks in markdown cells

Another feature I love about RMarkdown is the ability to distinguish “regular” code blocks (using python) from "runnable" code blocks (using {python}). This could be a nice way to separate out the same behavior in Jupytext markdown.

I’m curious what others think about incorporating these into the base flavor of Jupytext md (In addition to manually specifying with comments).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mwoutscommented, Mar 8, 2020

It has been some time since we last discussed this…

  • Indeed people can use Rmd if they want to distinguish between runnable and non-runnable code cells
  • I have added the ~~~python trick to the documentation to make non-runnable code cells in the markdown format
  • I am not sure I would invite non R users to use the Rmd format, because the code cell metadata have to be coded in R
  • More generally, I have the intuition that these kind of questions will be adressed with the myst format (#447)… do you mind if we continue the conversation there?
1reaction
mwoutscommented, Jan 22, 2020

Hello @choldgraf , I agree that pandoc div are easier to type, and nicer to read in a text editor. But… they don’t look nice yet in GitHub or in VS code… that was the reason why we did’nt took them. That said, sure, why not allowing them in addition to the other cell markers, as you suggest? I’ll think about that.

The same remark holds for the RMarkdown code blocks: I don’t think that ```{python} blocks are well rendered on GitHub… But I agree with you that having a simple way to distinguish between executable and non-executable cells is necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notebook formats - Jupytext documentation - Read the Docs
In Pandoc Markdown, all cells are marked with pandoc divs ( ::: ). The format is therefore slightly more verbose than the Jupytext...
Read more >
Pandoc User's Guide
Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses this library. Pandoc can...
Read more >
jupytext - PyPI
The notebook metadata (Jupyter kernel, etc) goes to a YAML header; Code and raw cells are encoded as Markdown code blocks with triple...
Read more >
Pandoc Markdown - Data Science with R
Turn your analyses into high quality documents, reports, presentations and dashboards with R Markdown. Use a productive notebook interface to weave together ...
Read more >
Supported formats — Jupytext documentation
R Markdown code cell options are mapped to the corresponding Jupyter cell ... In the case of the pandoc format, paired notebooks are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found