Skip to main content

Parse, test, and assert RST code-blocks

Project description

License PyPI CI pre-commit.ci status CodeQL codecov.io readthedocs.org python3.8 Black pylint

Parse, test, and assert RST code-blocks

Installation

$ pip install readmetester

Usage

readmetester [-h] [--version] [README.rst]

If a README.rst file is present in the current working directory it will be used if no arguments are provided

$ readmetester README.rst

Documenting

Python code begins with ">>> "

Continuation lines begin with "... "

Expected output can be quoted or unquoted

.. code-block:: python

    >>> n = [
    ...     "zero",
    ...     "one",
    ...     "two",
    ... ]
    >>> for c, i in enumerate(n):
    ...     print(c, i)
    0 zero
    1 one
    2 two

Styles can be configured in a pyproject.toml file

[tool.readmetester]
style = "monokai"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

readmetester-2.4.1.tar.gz (11.3 kB view hashes)

Uploaded Source

Built Distribution

readmetester-2.4.1-py3-none-any.whl (11.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page