Convert ReStructuredText to MyST Markdown, and also explore available roles/directives.
See tests/fixtures/render.txt for examples of inputs -> outputs.
pip install rst-to-mystor with sphinx:
pip install rst-to-myst[sphinx]To then run a basic conversion of a whole project:
$ rst2myst convert docs/**/*.rstFor greater control, you can pass configuration with CLI options, or via a YAML configuration file:
$ rst2myst convert --config config.yaml docs/**/*.rstconfig.yaml:
language: en
sphinx: true
extensions:
- sphinx_panels
default_domain: py
consecutive_numbering: true
colon_fences: true
dollar_math: true
conversions:
sphinx_panels.dropdpwn.DropdownDirective: parse_allSee the documentation for more information: https://rst-to-myst.readthedocs.io/
This package utilises flit as the build engine, and tox for test automation.
To install these development dependencies:
pip install flit toxTo run the tests:
toxTo run the code formatting and style checks:
pip install pre-commit
pre-commit run --allEither use flit directly:
flit publishor trigger the GitHub Action job, by creating a release with a tag equal to the version, e.g. v0.0.1.
Note, this requires generating an API key on PyPi and adding it to the repository Settings/Secrets, under the name PYPI_KEY.
The conversion covers almost all syntaxes (see https://docutils.sourceforge.io/docs/user/rst/quickref.htm) except:
- line blocks
- option lists
Also custom functions for directive parsing would be desirable.