Skip to main content

rst-to-myst

Build Status codecov.io PyPI version

Convert ReStructuredText to MyST Markdown, and also explore available roles/directives.

See tests/fixtures/render.txt for examples of inputs -> outputs.

Install

pip install rst-to-myst

or with sphinx:

pip install rst-to-myst[sphinx]

To then run a basic conversion of a whole project:

$ rst2myst convert docs/**/*.rst

For greater control, you can pass configuration with CLI options, or via a YAML configuration file:

$ rst2myst convert --config config.yaml docs/**/*.rst

config.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_all

See the documentation for more information: https://rst-to-myst.readthedocs.io/

Development

This package utilises flit as the build engine, and tox for test automation.

To install these development dependencies:

pip install flit tox

To run the tests:

tox

To run the code formatting and style checks:

pip install pre-commit
pre-commit run --all

Publish to PyPi

Either use flit directly:

flit publish

or 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.

TODO

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.

Release files for rst-to-myst 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rst-to-myst 0.4.0
File Size Uploaded
rst_to_myst-0.4.0.tar.gz 37.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rst-to-myst 0.4.0
File Interpreter ABI Platform
rst_to_myst-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 74.3 kB

Release files / rst_to_myst-0.4.0.tar.gz

Download URL rst_to_myst-0.4.0.tar.gz
Size 37.8 kB
Tags Source
SHA-256 checksum
How to use checksums
877fb4664eb25d5f2536f8c6045ece765844a32619adde5bfb772215370c2b34
BLAKE2b-256 checksum
How to use checksums
93d36f876962fec19aadaf8f0bf0c826653246c958e09f45a12cc1445db6a6d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / rst_to_myst-0.4.0-py3-none-any.whl

Download URL rst_to_myst-0.4.0-py3-none-any.whl
Size 36.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16621b2960a3977052701d862d297e21e7afd7bcfbc678158255e97936e83644
BLAKE2b-256 checksum
How to use checksums
45c0cd0888c974b7faf5077413d5eb190677f9c9da33063a9e1a515a09eb2563
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page