10

How to convert a Markdown file (or text) into a Mathematica notebook?

For example, easy conversion of comprehensive MSE posts is desirable.


Possible approaches ordered according to their convenience:

  1. [ ] Extensions of "pandoc" and/or "jupytext".

  2. [ ] Web service that does that.

  3. [ ] A Mathematica package that does the conversion.

  4. [X] A stand-alone implementation (in some programming language.)


This question is an inverse of "How to export a Mathematica notebook into Markdown?".

There is a similar question, "Markdown parser in Mathematica" that asks for something more specific -- the Markdown parser to be written in Mathematica.

Anton Antonov
  • 37,787
  • 3
  • 100
  • 178

1 Answers1

10

Here is a stand-alone Command Line Interface (CLI) app implemented in Raku : "Markdown::Grammar".

See the video "Markdown to Mathematica converter (CLI and StackExchange examples)" for a (quick, 7.5 min) demo.

enter image description here


For a detailed description see the corresponding:

Warning: Installation of Raku on macOS (using rakudo.org) might be not that easy. I advice using rakubrew.


Here is another video showing how to convert Jupyter notebooks into Mathematica/WL notebooks:

enter image description here

Anton Antonov
  • 37,787
  • 3
  • 100
  • 178