taika.ext.rst – ReStructuredText

This extension parses the content of the documents into HTML using ReStructuredText specifications.

Trigger

This extension is subscribed to the “doc-post-read” event.

Frontmatter

None.

Process

  1. Reads the suffix of path and if it matches, process the document.
  2. Modifies the suffix of url path to “.html”.
  3. Process the content with docutils.publish_parts() and replaces it with the “body” part.
  4. Done!

Configuration

Note

All configuration hangs from a key in the YML configuration named ‘restructuredtext’. Inside it, you can add the following options:

suffixes(list)

Default: [.rst]

Tells the parser to ONLY modify docs with that suffix. Otherwise the document is ignored. This is checked against the source path (path), not the destination path (url).

strict(bool)

Default: True

Exits with error code 1 if there is any warning or error when parsing files.

options(dict)
Default:
{ stylesheet_path: ‘’,
halt_level: 1,
traceback: True,
report_level: 5,
syntax_highlight: ‘short’,
doctitle_xform: False }

You can check the available options at HTML writer documentation

Functions

parse_rst(site, document)[source]

Parse content and modify url keys of document.

Parameters:
site : taika.taika.Taika

The Taika site.

document : dict

The document to be parsed.

setup(site)[source]