orangeqs.juice._sphinx._directives#

Module Contents#

Classes#

GenerateDirective

Document the options of a Configurable class.

SchemaDirective

Directive to describe a class, function or similar object.

FieldDirective

Directive to describe a class, function or similar object.

API#

class orangeqs.juice._sphinx._directives.GenerateDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)#

Bases: sphinx.util.docutils.SphinxDirective

Document the options of a Configurable class.

This directive has to be registered in sphinx via the setup function as configurable-summary. Assumes the configurable and configurable-option object types have been registered.

Examples#

Add the following to your documentation source file:

:::{configurable-summary} orangeqs.juice.schemas.logging.ServiceLoggingConfigs
:::
has_content#

True

required_arguments#

1

run() list[docutils.nodes.Node]#
class orangeqs.juice._sphinx._directives.SchemaDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)#

Bases: sphinx.directives.ObjectDescription[str]

Directive to describe a class, function or similar object.

Not used directly, but subclassed (in domain-specific directives) to add custom behaviour.

has_content#

True

required_arguments#

1

handle_signature(sig: str, signode: sphinx.addnodes.desc_signature) str#

Parse the signature sig.

The individual nodes are then appended to signode. If ValueError is raised, parsing is aborted and the whole sig is put into a single desc_name node.

The return value should be a value that identifies the object. It is passed to :meth:add_target_and_index() unchanged, and otherwise only used to skip duplicates.

add_target_and_index(name: str, sig: str, signode: sphinx.addnodes.desc_signature) None#

Add cross-reference IDs and entries to self.indexnode, if applicable.

name is whatever :meth:handle_signature() returned.

class orangeqs.juice._sphinx._directives.FieldDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)#

Bases: sphinx.directives.ObjectDescription[str]

Directive to describe a class, function or similar object.

Not used directly, but subclassed (in domain-specific directives) to add custom behaviour.

has_content#

True

required_arguments#

1

handle_signature(sig: str, signode: sphinx.addnodes.desc_signature) str#

Parse the signature sig.

The individual nodes are then appended to signode. If ValueError is raised, parsing is aborted and the whole sig is put into a single desc_name node.

The return value should be a value that identifies the object. It is passed to :meth:add_target_and_index() unchanged, and otherwise only used to skip duplicates.

add_target_and_index(name: str, sig: str, signode: sphinx.addnodes.desc_signature) None#

Add cross-reference IDs and entries to self.indexnode, if applicable.

name is whatever :meth:handle_signature() returned.