jupytext icon indicating copy to clipboard operation
jupytext copied to clipboard

mermaid.js scripts in ipynb markdown

Open psychemedia opened this issue 2 years ago • 2 comments

A heads up regarding a PR in JupyterLab, and associated JEP request that introduces support for rendering mermaid.js diagrams for diagrams described using the GFM syntax:

```mermaid
flowchart LR
  chicken --> egg --> chicken
```

In .qmd and .myst the corresponding syntax is:

```{mermaid}
flowchart LR
  chicken --> egg --> chicken
```

Comments to the JupyterLab PR hint that support for additional diagram types, presumably using a similar syntactic approach, are possible.

psychemedia avatar Jun 06 '23 08:06 psychemedia

Hey @psychemedia , thanks for the links!

Are you suggesting that we should do the translation from

```mermaid

in ipynb documents, to

```{mermaid}

in .qmd or .myst ? or should we plan something other than this?

mwouts avatar Jun 08 '23 07:06 mwouts

It was more of a heads up that the diagram scripts are being added to ipynb/gfm markdown using one form of syntax, and qmd and myst use another.

It's going to be confusing, I think, for ipynb docs. Eg if you author ipynb docs with the JuptyerLab MSTt extension you would presumably use MyST syntax, but if you are in a vanilla JupyterLab environment, the syntax will be GLF flavoured.

Converting to qmd, MyST should be easy enough, but returning to ipynb may depend on the user. Does ipynb use metadata to say whether someone has been using MyST or GFM (default), for example, in markdown cells?

psychemedia avatar Jun 08 '23 10:06 psychemedia