sphinx_packaging.peps

Sphinx extension which modifies the pep role to use normal (i.e. not bold) text for custom titles.

Also adds the pep621 role for referencing sections within PEP 621, and the core-meta role for referencing sections in Python’s core metadata`.

Classes:

CoreMetadata()

Sphinx role for referencing a core metadata field.

PEP()

Sphinx role for referencing a PEP or a section thereof.

PEP621Section()

Sphinx role for referencing a section within PEP 621.

Functions:

class CoreMetadata[source]

Bases: ReferenceRole

Sphinx role for referencing a core metadata field.

Methods:

build_uri()

Construct the target URI for the reference node.

run()

Process the role.

build_uri()[source]

Construct the target URI for the reference node.

Return type:

str

has_explicit_title

Type:    bool

run()[source]

Process the role.

Return type:

Tuple[List[Node], List[system_message]]

target

Type:    str

title

Type:    str

class PEP[source]

Bases: ReferenceRole

Sphinx role for referencing a PEP or a section thereof.

Methods:

build_uri()

Constrict the target URI for the reference node.

run()

Process the role.

build_uri()[source]

Constrict the target URI for the reference node.

Return type:

str

has_explicit_title

Type:    bool

run()[source]

Process the role.

Return type:

Tuple[List[Node], List[system_message]]

target

Type:    str

title

Type:    str

class PEP621Section[source]

Bases: PEP

Sphinx role for referencing a section within PEP 621.

Methods:

__call__(name, rawtext, text, lineno, inliner)

Call self as a function.

__call__(name, rawtext, text, lineno, inliner, options={}, content=[])[source]

Call self as a function.

Return type:

Tuple[List[Node], List[system_message]]

has_explicit_title

Type:    bool

target

Type:    str

title

Type:    str

setup(app)[source]

Setup sphinx_packaging.peps.

Parameters:

app (Sphinx) – The Sphinx application.

Return type:

Dict[str, Any]