xanadu_sphinx_theme.BioDirective¶
- class xanadu_sphinx_theme.BioDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶
Bases:
DirectiveEmbed author bio in posts (ReST format).
Based on the pelican_youtube plugin: https://github.com/kura/pelican_youtube
Usage:
Author name goes here
Attributes
May the final argument contain whitespace?
May the directive have content?
Mapping of option names to validator functions.
Number of optional arguments after the 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.
Methods
add_name(node)Append self.options['name'] to node['names'] if it exists.
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.
- 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)¶
- severe(message)¶
- warning(message)¶