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

How to convert MyST to Markdown #4

Open
rgaiacs opened this issue Jul 11, 2023 · 2 comments
Open

How to convert MyST to Markdown #4

rgaiacs opened this issue Jul 11, 2023 · 2 comments

Comments

@rgaiacs
Copy link
Contributor

rgaiacs commented Jul 11, 2023

No description provided.

@rgaiacs
Copy link
Contributor Author

rgaiacs commented Jul 11, 2023

myst build --md index.md produces

---
title: Minimal Example of Tutorial in MyST (Markedly Structured Text)
authors:
  - name: Raniere Silva
---
+++
This example demonstrates the **required** metadata by Methods Hub.

+++ is a cell block annotation, see https://mystmd.org/guide/blocks#blocks.

@rgaiacs
Copy link
Contributor Author

rgaiacs commented Jul 11, 2023

jupytext fail to convert to Pandoc:

$ jupytext --from md:myst --to md:pandoc index.md
[jupytext] Reading index.md in format md:myst
3.1.5
2.7.2
/home/raniere/micromamba/envs/myst/lib/python3.11/site-packages/nbformat/__init__.py:129: MissingIDFieldWarning: Code cell is missing an id field, this will become a hard error in future nbformat versions. You may want to use `normalize()` on your notebooks before validations (available since nbformat 5.1.4). Previous versions of nbformat are fixing this issue transparently, and will stop doing so in the future.
  validate(nb)
Unknown option --atx-headers.
Try pandoc --help for more information.
Traceback (most recent call last):
  File "/home/raniere/micromamba/envs/myst/bin/jupytext", line 10, in <module>
    sys.exit(jupytext())
             ^^^^^^^^^^
  File "/home/raniere/micromamba/envs/myst/lib/python3.11/site-packages/jupytext/cli.py", line 488, in jupytext
    exit_code += jupytext_single_file(nb_file, args, log)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raniere/micromamba/envs/myst/lib/python3.11/site-packages/jupytext/cli.py", line 895, in jupytext_single_file
    lazy_write(nb_dest, fmt=dest_fmt, action=action)
  File "/home/raniere/micromamba/envs/myst/lib/python3.11/site-packages/jupytext/cli.py", line 794, in lazy_write
    new_content = writes(notebook, fmt=fmt, config=config)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raniere/micromamba/envs/myst/lib/python3.11/site-packages/jupytext/jupytext.py", line 484, in writes
    return writer.writes(notebook, metadata)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raniere/micromamba/envs/myst/lib/python3.11/site-packages/jupytext/jupytext.py", line 218, in writes
    return notebook_to_md(self.filter_notebook(nb, metadata))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raniere/micromamba/envs/myst/lib/python3.11/site-packages/jupytext/pandoc.py", line 112, in notebook_to_md
    pandoc(
  File "/home/raniere/micromamba/envs/myst/lib/python3.11/site-packages/jupytext/pandoc.py", line 35, in pandoc
    raise PandocError(
jupytext.pandoc.PandocError: pandoc exited with return code 6
None

I open a pull request to fix it: mwouts/jupytext#1099

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