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

jupytext --to md:myst *.md should be idempotent #1317

Open
mwouts opened this issue Feb 16, 2025 · 0 comments
Open

jupytext --to md:myst *.md should be idempotent #1317

mwouts opened this issue Feb 16, 2025 · 0 comments
Milestone

Comments

@mwouts
Copy link
Owner

mwouts commented Feb 16, 2025

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: .md

    format_name: myst

    format_version: 0.13

    jupytext_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.

Originally posted by @mforbes in #789

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

1 participant