Parser API

class sphinx.parsers.Parser[source]

A base class of source parsers. The additonal parsers should inherits this class instead of docutils.parsers.Parser. Compared with docutils.parsers.Parser, this class improves accessibility to Sphinx APIs.

The subclasses can access following objects and functions:

self.app
The application object (sphinx.application.Sphinx)
self.config
The config object (sphinx.config.Config)
self.env
The environment object (sphinx.environment.BuildEnvironment)
self.warn()
Emit a warning. (Same as sphinx.application.Sphinx.warn())
self.info()
Emit a informational message. (Same as sphinx.application.Sphinx.info())