xanadu_sphinx_theme.BioDirective

class xanadu_sphinx_theme.BioDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: Directive

Embed author bio in posts (ReST format).

Based on the pelican_youtube plugin: https://github.com/kura/pelican_youtube

Usage:

Author name goes here

Author name goes here

Write the author bio content here. It must be preceded by a blank line.

final_argument_whitespace

May the final argument contain whitespace?

has_content

May the directive have content?

option_spec

Mapping of option names to validator functions.

optional_arguments

Number of optional arguments after the required arguments.

required_arguments

Number of required directive arguments.

final_argument_whitespace = False

May the final argument contain whitespace?

has_content = True

May the directive have content?

option_spec = {'photo': <class 'str'>}

Mapping of option names to validator functions.

optional_arguments = 8

Number of optional arguments after the required arguments.

required_arguments = 1

Number of required directive arguments.

add_name(node)

Append self.options['name'] to node['names'] if it exists.

assert_has_content()

Throw an ERROR-level DirectiveError if the directive doesn't have contents.

boolean()

Conversion function for yes/no True/False.

debug(message)

directive_error(level, message)

Return a DirectiveError suitable for being thrown as an exception.

error(message)

info(message)

run()

severe(message)

warning(message)

add_name(node)

Append self.options[‘name’] to node[‘names’] if it exists.

Also normalize the name string and register it as explicit target.

assert_has_content()

Throw an ERROR-level DirectiveError if the directive doesn’t have contents.

boolean()[source]

Conversion function for yes/no True/False.

debug(message)
directive_error(level, message)

Return a DirectiveError suitable for being thrown as an exception.

Call “raise self.directive_error(level, message)” from within a directive implementation to return one single system message at level level, which automatically gets the directive block and the line number added.

Preferably use the debug, info, warning, error, or severe wrapper methods, e.g. self.error(message) to generate an ERROR-level directive error.

error(message)
info(message)
run()[source]
severe(message)
warning(message)