Skip to main content

Checks syntax of reStructuredText and code blocks nested within it

Project description

General

Maintenance - intended License Semantic Versioning - 2.0.0

Read the Docs - Build Status (latest)

CI

Test status Documentation status QA status pre-commit status

PyPI

PyPI - Package latest release PyPI - Supported Python Versions PyPI - Supported Implementations

PyPI - Format PyPI - Monthly downloads

Github

Github - Latest Release GitHub - Last Commit

Github - Stars Github - Forks Github - Contributors Github - Watchers

Checks syntax of reStructuredText and code blocks nested within it.

See the full documentation at read-the-docs

Installation

From pip

$ pip install rstcheck

To use pyproject.toml for configuration:

$ pip install rstcheck[toml]

To add sphinx support:

$ pip install rstcheck[sphinx]

Pre-commit Hook with Extras

To use rstcheck in a Git pre-commit hook with optional features:

  1. Install pre-commit:

    pip install pre-commit
  2. Add to .pre-commit-config.yaml:

    - repo: https://github.com/rstcheck/rstcheck
      rev: main # should be replaced with the current verison
      hooks:
        - id: rstcheck
          additional_dependencies: ['rstcheck[sphinx,toml]']
  3. Run pre-commit install to activate.

Supported languages in code blocks

  • Bash

  • Doctest

  • C (C99)

  • C++ (C++11)

  • JSON

  • XML

  • Python

  • reStructuredText

Examples

With bad Python syntax:

====
Test
====

.. code:: python

    print(
$ rstcheck bad_python.rst
bad_python.rst:7: (ERROR/3) (python) unexpected EOF while parsing

With bad C++ syntax:

====
Test
====

.. code:: cpp

    int main()
    {
        return x;
    }
$ rstcheck bad_cpp.rst
bad_cpp.rst:9: (ERROR/3) (cpp) error: 'x' was not declared in this scope

With bad syntax in the reStructuredText document itself:

====
Test
===
$ rstcheck bad_rst.rst
bad_rst.rst:1: (SEVERE/4) Title overline & underline mismatch.

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

rstcheck-6.3.0.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rstcheck-6.3.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file rstcheck-6.3.0.tar.gz.

File metadata

  • Download URL: rstcheck-6.3.0.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for rstcheck-6.3.0.tar.gz
Algorithm Hash digest
SHA256 583072b43939627b1b0f4492e8af2587092efc1fb5e9f0228fa2df9ea3b44873
MD5 506efd470ea5b5986eeb5f9c9c9b64f3
BLAKE2b-256 0a3e54182f5a310e0e2eb287170eb590bb93011161e28e51aa499120ab5c9318

See more details on using hashes here.

File details

Details for the file rstcheck-6.3.0-py3-none-any.whl.

File metadata

  • Download URL: rstcheck-6.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for rstcheck-6.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c1d8753b5dc01c33d114711552b2c4855fde00e0713f5a8341d7aaab2777058
MD5 592bbe3462cb358d5afc465b1f346076
BLAKE2b-256 44138bdf4e9f028e147ebabd8e093d30b0bc6e70ebbcfa9dbd9b93861e7315cd

See more details on using hashes here.

Supported by

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