CLI Commands#

rst2myst#

CLI for converting ReStructuredText to MyST Markdown.

rst2myst [OPTIONS] COMMAND [ARGS]...

Options

--version#

Show the version and exit.

ast#

Parse file / stdin (-) and print RST Abstract Syntax Tree.

rst2myst ast [OPTIONS] PATH_OR_STDIN

Options

-l, --language <language>#

Language code for directive names

Default:

en

--sphinx, --no-sphinx#

Load sphinx.

Default:

True

-e, --extensions <extensions>#

A comma-separated list of sphinx extensions to load.

-c, --conversions <PATH>#

YAML file mapping directives -> conversions

--config <config>#

YAML file to read default configuration from

Arguments

PATH_OR_STDIN#

Required argument

convert#

Convert one or more files.

rst2myst convert [OPTIONS] [PATHS]...

Options

-d, --dry-run#

Do not write/remove any files

-R, --replace-files#

Remove parsed files

-S, --stop-on-fail#

Stop on first failure

-W, --raise-on-warning#

Raise exception on parsing warning

-l, --language <language>#

Language code for directive names

Default:

en

--sphinx, --no-sphinx#

Load sphinx.

Default:

True

-e, --extensions <extensions>#

A comma-separated list of sphinx extensions to load.

-dd, --default-domain <default_domain>#

Default sphinx domain

Default:

py

-dr, --default-role <default_role>#

Default sphinx role [default: convert to literal]

-cp, --cite-prefix <cite_prefix>#

Prefix to add to citation references

Default:

cite

--consecutive-numbering, --no-consecutive-numbering#

Apply consecutive numbering to ordered lists

Default:

True

--colon-fences, --no-colon-fences#

Use colon fences for directives with parsed content

Default:

True

--dollar-math, --no-dollar-math#

Convert math (where possible) to dollar-delimited math

Default:

True

-c, --conversions <PATH>#

YAML file mapping directives -> conversions

--encoding <encoding>#

Encoding for read/write

Default:

utf8

--config <config>#

YAML file to read default configuration from

Arguments

PATHS#

Optional argument(s)

directives#

Commands for showing available directives.

rst2myst directives [OPTIONS] COMMAND [ARGS]...

list#

List available directives.

rst2myst directives list [OPTIONS]

Options

--sphinx, --no-sphinx#

Load sphinx.

Default:

True

-e, --extensions <extensions>#

A comma-separated list of sphinx extensions to load.

show#

Show information about a single role.

rst2myst directives show [OPTIONS] NAME

Options

--sphinx, --no-sphinx#

Load sphinx.

Default:

True

-e, --extensions <extensions>#

A comma-separated list of sphinx extensions to load.

-l, --language <language>#

Language code for directive names

Default:

en

Arguments

NAME#

Required argument

roles#

Commands for showing available roles.

rst2myst roles [OPTIONS] COMMAND [ARGS]...

list#

List available roles.

rst2myst roles list [OPTIONS]

Options

--sphinx, --no-sphinx#

Load sphinx.

Default:

True

-e, --extensions <extensions>#

A comma-separated list of sphinx extensions to load.

show#

Show information about a single role.

rst2myst roles show [OPTIONS] NAME

Options

--sphinx, --no-sphinx#

Load sphinx.

Default:

True

-e, --extensions <extensions>#

A comma-separated list of sphinx extensions to load.

-l, --language <language>#

Language code for directive names

Default:

en

Arguments

NAME#

Required argument

stream#

Parse file / stdin (-) and print Markdown text.

rst2myst stream [OPTIONS] PATH_OR_STDIN

Options

-l, --language <language>#

Language code for directive names

Default:

en

--sphinx, --no-sphinx#

Load sphinx.

Default:

True

-e, --extensions <extensions>#

A comma-separated list of sphinx extensions to load.

-dd, --default-domain <default_domain>#

Default sphinx domain

Default:

py

-dr, --default-role <default_role>#

Default sphinx role [default: convert to literal]

-cp, --cite-prefix <cite_prefix>#

Prefix to add to citation references

Default:

cite

--consecutive-numbering, --no-consecutive-numbering#

Apply consecutive numbering to ordered lists

Default:

True

--colon-fences, --no-colon-fences#

Use colon fences for directives with parsed content

Default:

True

--dollar-math, --no-dollar-math#

Convert math (where possible) to dollar-delimited math

Default:

True

-c, --conversions <PATH>#

YAML file mapping directives -> conversions

--config <config>#

YAML file to read default configuration from

Arguments

PATH_OR_STDIN#

Required argument

tokens#

Parse file / stdin (-) and print Markdown-It tokens.

rst2myst tokens [OPTIONS] PATH_OR_STDIN

Options

-l, --language <language>#

Language code for directive names

Default:

en

--sphinx, --no-sphinx#

Load sphinx.

Default:

True

-e, --extensions <extensions>#

A comma-separated list of sphinx extensions to load.

-dd, --default-domain <default_domain>#

Default sphinx domain

Default:

py

-dr, --default-role <default_role>#

Default sphinx role [default: convert to literal]

-cp, --cite-prefix <cite_prefix>#

Prefix to add to citation references

Default:

cite

--colon-fences, --no-colon-fences#

Use colon fences for directives with parsed content

Default:

True

--dollar-math, --no-dollar-math#

Convert math (where possible) to dollar-delimited math

Default:

True

-c, --conversions <PATH>#

YAML file mapping directives -> conversions

--config <config>#

YAML file to read default configuration from

Arguments

PATH_OR_STDIN#

Required argument