Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

reStructuredText

Learn how Vale handles reStructuredText content.

reStructuredText is supported through the external program rst2html. To get started, you’ll need to install the docutils package:

$ pip install docutils

Vale looks for rst2html, rst2html.py, rst2html-3, or rst2html-3.py on your $PATH, which installing docutils normally provides. The script is asked which Python it runs under, so the interpreter docutils was installed into is the one used, even when it is not the python3 on the path.

The supported extensions are .rst and .rest.

A Sphinx project is read the same way; that page covers its directives and roles.

By default, Vale ignores:

Directives and roles

Docutils defines the standard directives and roles. A Sphinx project uses Sphinx's as well, and whatever its extensions add, and on its own Docutils drops the body of a directive it doesn't know. Vale fills the gap before parsing: the body of an unknown directive is read as prose, and the text of an unknown role as code, which is what nearly every Sphinx directive and role amounts to. So versionadded, seealso, a tab, or a grid card is linted like any paragraph, and :func: or :doc: is left alone, without Sphinx being installed.

The exceptions Vale knows are Sphinx's own: toctree, literalinclude, math, the auto* family, and the doctest blocks are not prose; ref, doc, term, guilabel, and menuselection carry prose. A reference written with a title, :ref:`the setup guide <setup>` , is linted as its title; a bare target is code. A project names what its extensions add in a [sphinx] section:

[sphinx]
# Directives whose body is code, data, or a diagram: not linted.
CodeDirectives = mermaid, plantuml
# Roles whose text is prose rather than an identifier.
ProseRoles = kbd

Both keys add to the built-in lists. Requires Vale v3.23.0 or later.

Comments

Vale supports comment-based configuration in reStructuredText files:

  • Turn Vale off entirely:

  • Turn off a specific rule:

  • Turn off specific match(es) within a rule:

  • Turn on or off specific styles:

  • Set styles (enabling them and switching off any other styles):

Last updated