govuk_tech_docs_sphinx_theme.NotificationBanner
¶
- class govuk_tech_docs_sphinx_theme.NotificationBanner(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)¶
Create a notification banner based on the GOV.UK Design System.
The notification banner is based on the GOV.UK Design System, excluding the id attributes. Some attributes are generated using JavaScript in the theme.js file.
- Returns
A nodes.Element object containing the compiled notification banner.
- __init__(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)¶
Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(name, arguments, options, content, …)Initialize self.
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.
debug
(message)directive_error
(level, message)Return a DirectiveError suitable for being thrown as an exception.
error
(message)info
(message)run
()Create a notification banner based on the GOV.UK Design System.
severe
(message)warning
(message)Attributes
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.