docutils.transforms.peps module
Transforms for PEP processing.
Headers: Used to transform a PEP’s initial RFC-2822 header. It remains a field list, but some entries get processed.
Contents: Auto-inserts a table of contents.
PEPZero: Special processing for PEP 0.
- class Headers(document, startnode=None)[source]
Bases:
TransformProcess fields in a PEP’s initial RFC-2822 header.
- default_priority = 360
Numerical priority of this transform, 0 through 999 (override).
- pep_url = 'pep-%04d'
- pep_cvs_url = 'http://hg.python.org/peps/file/default/pep-%04d.txt'
- rcs_keyword_substitutions = ((re.compile('\\$RCSfile: (.+),v \\$$', re.IGNORECASE), '\\1'), (re.compile('\\$[a-zA-Z]+: (.+) \\$$'), '\\1'))
- class Contents(document, startnode=None)[source]
Bases:
TransformInsert an empty table of contents topic and a transform placeholder into the document after the RFC 2822 header.
- default_priority = 380
Numerical priority of this transform, 0 through 999 (override).
- class TargetNotes(document, startnode=None)[source]
Bases:
TransformLocate the “References” section, insert a placeholder for an external target footnote insertion transform at the end, and schedule the transform to run immediately.
- default_priority = 520
Numerical priority of this transform, 0 through 999 (override).
- class PEPZero(document, startnode=None)[source]
Bases:
TransformSpecial processing for PEP 0.
- default_priority = 760
Numerical priority of this transform, 0 through 999 (override).
- class PEPZeroSpecial(document)[source]
Bases:
SparseNodeVisitorPerform the special processing needed by PEP 0:
Mask email addresses.
Link PEP numbers in the second column of 4-column tables to the PEPs themselves.
- pep_url = 'pep-%04d'
- mask_email(ref, pepno=None)[source]
Mask the email address in ref and return a replacement node.
ref is returned unchanged if it contains no email address.
For email addresses such as “user@host”, mask the address as “user at host” (text) to thwart simple email address harvesters (except for those listed in non_masked_addresses). If a PEP number (pepno) is given, return a reference including a default email subject.