You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MyST Markdown notebooks normally use the pygments_lexer to anotate the code cells like e.g. ipython3 in this example:
```{code-cell} ipython3
1 + 1
```
This information comes from the language_info notebook metadata, which is taken either from the paired ipynb notebook, or recreated by Jupyter when the notebook is opened.
However when Jupytext CLI is used (e.g. jupytext --to md:myst on a MyST Markdown file), the language_info metadata might not be present, and the ipython3 marker disappears.
We should find a way to ensure the persistence of the lexer.
The text was updated successfully, but these errors were encountered:
A comment: jupytext --to md:myst sometimes makes other somewhat disturbing changes that preclude this being a good solution to issue #759. Let me know if I should open a new issue or a couple for each problem. Here are some examples:
Fenced code promoted to code-cells.
This could be bad in an environment where code cells are executed...
# Demo
You should be **very** careful about doing this:
```bash#rm -rf * # Commented out just in case!```
After jupytext --to md:myst *.md this transmutes to
# Demo
You should be **very** careful about doing this:
```{code-cell}#rm -rf * # Commented out just in case!```
which might execute code... also there are whitespace changes (new lines) that break idempotence of the conversion. After several runs of jupytext --to md:myst *.md I get
+++
+++
# Demo
You should be **very** careful about doing this:
```{code-cell}#rm -rf * # Commented out just in case!
i.e. added blank notebook cells at the top.
Reference-link replacement.
Here is another example:
# Demo
This is a [reference-link to the issue][].
:::{note}
This note is key... not sure why.
:::
[reference-link to the issue]: <https://github.com/mwouts/jupytext/issues/789>
This gets transmuted to
---jupytext:
text_representation:
extension: .mdformat_name: mystformat_version: 0.13jupytext_version: 1.16.2---# Demo
This is a [reference-link to the issue](https://github.com/mwouts/jupytext/issues/789).
This note is key… not sure why.
after which it no longer changes (idempotent). Note that note admonition was removed, and the reference-link was converted to an absolute link.
This is a follow-up on #759 .
MyST Markdown notebooks normally use the
pygments_lexer
to anotate the code cells like e.g.ipython3
in this example:This information comes from the
language_info
notebook metadata, which is taken either from the paired ipynb notebook, or recreated by Jupyter when the notebook is opened.However when Jupytext CLI is used (e.g.
jupytext --to md:myst
on a MyST Markdown file), thelanguage_info
metadata might not be present, and theipython3
marker disappears.We should find a way to ensure the persistence of the lexer.
The text was updated successfully, but these errors were encountered: