GESIS-Methods-Hub / minimal-example-myst

Minimal Example of Tutorial in MyST (Markedly Structured Text)
GNU Affero General Public License v3.0
1 stars 0 forks source link

How to convert MyST to Markdown #4

Open rgaiacs opened 1 year ago

rgaiacs commented 1 year ago

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 commented 1 year ago

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: https://github.com/mwouts/jupytext/pull/1099