Merge pull request #4810 from tk0miya/define_priority_for_transforms

Proposal: Define priority for transforms
This commit is contained in:
Takeshi KOMIYA 2018-04-21 11:29:48 +09:00 committed by GitHub
commit 320421be67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -970,7 +970,30 @@ class Sphinx(object):
Add the standard docutils :class:`Transform` subclass *transform* to
the list of transforms that are applied after Sphinx parses a reST
document.
"""
.. list-table:: priority range categories for Sphinx transforms
* - Priority
- Main purpose in Sphinx
* - 0-99
- Fix invalid nodes by docutils. Translate a doctree.
* - 100-299
- Preparation
* - 300-399
- early
* - 400-699
- main
* - 700-799
- Post processing. Deadline to modify text and referencing.
* - 800-899
- Collect referencing and referenced nodes. Domain processing.
* - 900-999
- Finalize and clean up.
refs: `Transform Priority Range Categories`__
__ http://docutils.sourceforge.net/docs/ref/transforms.html#transform-priority-range-categories
""" # NOQA
self.registry.add_transform(transform)
def add_post_transform(self, transform):