summaryrefslogtreecommitdiff
path: root/sphinx/parsers.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/parsers.py')
-rw-r--r--sphinx/parsers.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/sphinx/parsers.py b/sphinx/parsers.py
index b7ca89aa5..926de9f1c 100644
--- a/sphinx/parsers.py
+++ b/sphinx/parsers.py
@@ -14,7 +14,22 @@ import docutils.parsers
class Parser(docutils.parsers.Parser):
"""
- A base class of parsers.
+ 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 (:class:`sphinx.application.Sphinx`)
+ self.config
+ The config object (:class:`sphinx.config.Config`)
+ self.env
+ The environment object (:class:`sphinx.environment.BuildEnvironment`)
+ self.warn()
+ Emit a warning. (Same as :meth:`sphinx.application.Sphinx.warn()`)
+ self.info()
+ Emit a informational message. (Same as :meth:`sphinx.application.Sphinx.info()`)
"""
def set_application(self, app):