sphinx_hwt package¶
Submodules¶
sphinx_hwt.directive_autodoc module¶
- class sphinx_hwt.directive_autodoc.HwtAutodocDirective(*args, **kwargs)¶
Bases:
sphinx_hwt.directive_schematic.HwtSchematicDirective
- run()¶
Can not use multiple hwt-autodoc/hwt-schematic/hwt-params/hwt-interfaces in a single class
- sphinx_hwt.directive_autodoc.setup(app: sphinx.application.Sphinx)¶
sphinx_hwt.directive_components module¶
- class sphinx_hwt.directive_components.HwtComponentsDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)¶
Bases:
docutils.parsers.rst.Directive
- final_argument_whitespace = False¶
May the final argument contain whitespace?
- has_content = False¶
May the directive have content?
- optional_arguments = 1¶
Number of optional arguments after the required arguments.
- run()¶
- class sphinx_hwt.directive_components.hwt_components(obj_name_to_descr_paragraph: Dict[str, docutils.nodes.Element], rawsource='', *children, **attributes)¶
Bases:
sphinx_hwt.utils.hwt_objs
A directive which adds a list of defined HDL components for Unit instances The message also contains information about default value and type of the parameter.
- static depart_html(self, node: sphinx_hwt.directive_components.hwt_components)¶
- static visit_html(self, node: sphinx_hwt.directive_components.hwt_components)¶
- sphinx_hwt.directive_components.merge_variable_lists_into_hwt_components(app: sphinx.application.Sphinx, domain: str, objtype: str, contentnode: docutils.nodes.Element)¶
- sphinx_hwt.directive_components.setup(app: sphinx.application.Sphinx)¶
sphinx_hwt.directive_interfaces module¶
- class sphinx_hwt.directive_interfaces.HwtInterfacesDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)¶
Bases:
docutils.parsers.rst.Directive
- final_argument_whitespace = False¶
May the final argument contain whitespace?
- has_content = False¶
May the directive have content?
- optional_arguments = 1¶
Number of optional arguments after the required arguments.
- run()¶
- class sphinx_hwt.directive_interfaces.hwt_interfaces(obj_name_to_descr_paragraph: Dict[str, docutils.nodes.Element], rawsource='', *children, **attributes)¶
Bases:
sphinx_hwt.utils.hwt_objs
A directive which adds a list of HDL defined interfaces for Unit instances The message also contains information about default value and type of the parameter.
- static depart_html(self, node: sphinx_hwt.directive_interfaces.hwt_interfaces)¶
- static visit_html(self, node: sphinx_hwt.directive_interfaces.hwt_interfaces)¶
- sphinx_hwt.directive_interfaces.merge_variable_lists_into_hwt_interfaces(app: sphinx.application.Sphinx, domain: str, objtype: str, contentnode: docutils.nodes.Element)¶
- sphinx_hwt.directive_interfaces.setup(app: sphinx.application.Sphinx)¶
sphinx_hwt.directive_params module¶
- class sphinx_hwt.directive_params.HwtParamsDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)¶
Bases:
docutils.parsers.rst.Directive
- final_argument_whitespace = False¶
May the final argument contain whitespace?
- has_content = False¶
May the directive have content?
- optional_arguments = 1¶
Number of optional arguments after the required arguments.
- run()¶
- class sphinx_hwt.directive_params.hwt_params(obj_name_to_descr_paragraph: Dict[str, docutils.nodes.Element], rawsource='', *children, **attributes)¶
Bases:
sphinx_hwt.utils.hwt_objs
A directive which adds a list of defined HDL parameters for Unit instances The message also contains information about default value and type of the parameter.
- static depart_html(self, node: sphinx_hwt.directive_params.hwt_params)¶
- static visit_html(self, node: sphinx_hwt.directive_params.hwt_params)¶
- sphinx_hwt.directive_params.merge_variable_lists_into_hwt_params(app: sphinx.application.Sphinx, domain: str, objtype: str, contentnode: docutils.nodes.Element)¶
- sphinx_hwt.directive_params.setup(app: sphinx.application.Sphinx)¶
sphinx_hwt.directive_schematic module¶
- class sphinx_hwt.directive_schematic.HwtSchematicDirective(*args, **kwargs)¶
Bases:
docutils.parsers.rst.Directive
- copy_extra_static_files()¶
- final_argument_whitespace = False¶
May the final argument contain whitespace?
- has_content = False¶
May the directive have content?
- optional_arguments = 1¶
Number of optional arguments after the required arguments.
- run()¶
- class sphinx_hwt.directive_schematic.SchematicLink(constructor_fn_name: Optional[str], *args, **kwargs)¶
Bases:
docutils.nodes.General
,docutils.nodes.Inline
,docutils.nodes.TextElement
- static depart_html(self, node)¶
- static visit_html(self, node)¶
Generate html elements and schematic json
- class sphinx_hwt.directive_schematic.SchematicPaths¶
Bases:
object
- SCHEMATIC_DIR_PREFIX = '../../'¶
- SCHEMATIC_FILES_DIR = 'hwt_schematics'¶
- SCHEMATIC_FILES_EXTENSION = 'json'¶
- SCHEMATIC_VIEWER_SRC_DIR = '/home/docs/checkouts/readthedocs.org/user_builds/sphinx-hwt/checkouts/stable/sphinx_hwt/html'¶
- SCHEMATIC_VIEWER_URL = 'schematic_viewer/schematic_viewer.html'¶
- classmethod get_sch_file_name(document, absolute_name, serialno)¶
- classmethod get_sch_file_name_absolute(document, absolute_name, serialno)¶
- classmethod get_sch_viewer_dir(document)¶
- classmethod get_sch_viewer_link(document)¶
- classmethod get_static_path(document)¶
- sphinx_hwt.directive_schematic.setup(app: sphinx.application.Sphinx)¶
sphinx_hwt.utils module¶
- sphinx_hwt.utils.construct_hwt_obj(absolute_name: str, constructor_fn_name: str, allowed_classes, debug_directive_name: str)¶
- sphinx_hwt.utils.construct_property_description_list(name)¶
Construct a skeleton for sphinx member description block
- sphinx_hwt.utils.generic_import(name: Union[str, List[str]])¶
Import using string or list of module names
- sphinx_hwt.utils.get_absolute_name_of_class_of_node(node)¶
Get a module path for an object from its node in doc.
- sphinx_hwt.utils.get_constructor_name(directive: docutils.parsers.rst.Directive)¶
Get a first argument of the directive and check if it is a function.
- sphinx_hwt.utils.get_instance_from_directive_node(directive: docutils.parsers.rst.Directive, allowed_classes)¶
Converts
.. directive: .. directive: constructor_fn_name
to instance, if constructor_fn_name is not specified the current class instantiated.
- class sphinx_hwt.utils.hwt_objs(obj_name_to_descr_paragraph: Dict[str, docutils.nodes.Element], rawsource='', *children, **attributes)¶
Bases:
docutils.nodes.General
,docutils.nodes.Element
A directive which adds a list of HDL defined interfaces for Unit instances The message also contains information about default value and type of the parameter.
- Variables
obj_list – format (name, type_str, value_str)
- sphinx_hwt.utils.merge_field_lists_to_hdl_objs(field_list: docutils.nodes.field_list, hwt_obj_list: sphinx_hwt.utils.hwt_objs)¶
- sphinx_hwt.utils.merge_variable_lists_into_hwt_objs(app: sphinx.application.Sphinx, domain: str, objtype: str, contentnode: docutils.nodes.Element, hwt_objs_cls) → None¶
Move doc from variable lists in class documentation to HDL param list if the variable is a HDL Param instance.
- sphinx_hwt.utils.ref_to_class(class_obj)¶
Create the sphinx pending_xref for a class