xanadu_sphinx_theme.IndexCardDirective¶
- class xanadu_sphinx_theme.IndexCardDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶
Bases:
DirectiveCreates an index card.
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.
- add_index = False¶
- final_argument_whitespace = True¶
May the final argument contain whitespace?
- has_content = False¶
May the directive have content?
- option_spec = {'description': <function unchanged_required>, 'link': <function unchanged_required>, 'name': <function unchanged_required>}¶
Mapping of option names to validator functions.
- optional_arguments = 0¶
Number of optional arguments after the required arguments.
- required_arguments = 0¶
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.
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)¶