jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
192 stars 61 forks source link

Export document to Markdown #482

Open rgaiacs opened 1 year ago

rgaiacs commented 1 year ago

https://mystmd.org/guide/quickstart-myst-documents#export-documents has examples of how to export a document to Microsoft Word, PDF, and LaTeX. Will be great to also be able to export the document to Pandoc Markdown.

User case

Jane Doe is writing a academic paper using MyST to submit to the Journal of Open Source Software (JOSS). Now, is time for her to submit the academic paper. For JOSS,

Your paper (paper.md and BibTeX files, plus any figures) must be hosted in a Git-based repository together with your software (although they may be in a short-lived branch which is never merged with the default).

Source: https://joss.readthedocs.io/en/latest/submitting.html#submission-requirements

Because JOSS "uses Pandoc to compile papers from their Markdown form into a PDF", Jane Doe must convert MyST to Pandoc Markdown.

Proposal

Add myst build --md or myst build --pandoc-md.

Notes

welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

rgaiacs commented 1 year ago

I discovered that jupytext supports MyST Markdown and Pandoc Markdown (see https://jupytext.readthedocs.io/en/latest/formats-markdown.html).

Consider the follow minimal working example (called mwe.md)

---
title: MWE
author: Raniere Silva
---

DOI links can be used to include citations <doi:10.5281/zenodo.6476040>.

jupytext --from md:myst --to md:pandoc --output - mwe.md produces

---
jupyter:
  jupytext:
    text_representation:
      extension: .md
      format_name: pandoc
      format_version: 2.19.2
      jupytext_version: 1.14.7+dev
  nbformat: 4
  nbformat_minor: 5
---

::: {#9313a39a .cell .markdown}
DOI links can be used to include citations <doi:10.5281/zenodo.6476040>.
:::

instead of

---
title: MWE
author: Raniere Silva
---

DOI links can be used to include citations @cockett2015.