bag.check_rst module

reStructuredText document validator / verifier / checker.

For Python code you have 2 available functions:

warnings = check_rst_document(a_string)
warnings = check_rst_file(path)

These functions will return an empty list if the document is OK.

In shell, use it like this:

check_rst < some_document.rst

Or like this if the package bag isn’t easy_installed:

python < some_document.rst

The command prints either “OK” or the warnings. And it returns 0 if the document is OK.

bag.check_rst.check_rst_document(source, source_path='<string>', settings=None)[source]

Return a list of objects containing problems in a rst document.

Provide the reStructuredText document through the argument source.

settings is the settings object for the docutils document instance. If None, the default settings are used.

bag.check_rst.check_rst_file(path, encoding='utf-8', settings=None)[source]

Entry point; becomes a console script when the package is installed.