class documentation

class TitlePromoter(Transform):

Known subclasses: docutils.transforms.frontmatter.DocTitle, docutils.transforms.frontmatter.SectionSubTitle

View In Hierarchy

Abstract base class for DocTitle and SectionSubTitle transforms.
Method candidate​_index Find and return the promotion candidate and its index.
Method promote​_subtitle Transform the following node tree:
Method promote​_title Transform the following tree:

Inherited from Transform:

Method __init__ Initial setup for in-place document transforms.
Method apply Override to apply the transform to the document tree.
Class Variable default​_priority Numerical priority of this transform, 0 through 999 (override).
Instance Variable document The document tree to transform.
Instance Variable language Language module local to this document.
Instance Variable startnode Node from which to begin the transform. For many transforms which apply to the document as a whole, startnode is not set (i.e. its value is None).
def candidate_index(self, node):

Find and return the promotion candidate and its index.

Return (None, None) if no valid candidate was found.

def promote_subtitle(self, node):

Transform the following node tree:

<node>
    <title>
    <section>
        <title>
        ...

into

<node>
    <title>
    <subtitle>
    ...
def promote_title(self, node):

Transform the following tree:

<node>
    <section>
        <title>
        ...

into

<node>
    <title>
    ...

node is normally a document.