osewb.docs.ext¶
Custom Sphinx Extensions for OSE Workbenches.
These extensions designed to be externalized into separate projects if others are interested in using them.
all_summary_table¶
Name |
Description |
---|---|
Setup extension. |
-
setup
(app: sphinx.application.Sphinx) → None¶ Setup extension.
- Parameters
app – application object controlling high-level functionality, such as the setup of extensions, event dispatching, and logging. See Also: https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx
freecad_custom_property_table¶
Adds a .. fc-custom-property-table::
directive to create a table documenting the properties of custom FreeCAD objects.
Must add the .. fc-custom-property-table::
directive to the docstring of a scripted object class:
class BoxModel:
"""
.. fc-custom-property-table::
"""
Or pass the path to the class as an optional argument:
.. fc-custom-property-table:: examples.box_model.BoxModel
Supports a remove_app_property_prefix_from_type
configuration value to remove the App::Property
prefix from the Type. Defaults to False
.
These objects are also known as “FeaturePython Objects” or “Scripted Objects” in the FreeCAD community.
-
class
FreeCADCustomPropertyTable
(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)¶ Bases:
sphinx.util.docutils.SphinxDirective
-
has_content
= False¶
-
optional_arguments
= 1¶
-
run
()¶
-
-
create_table_row
(row_cells)¶
-
setup
(app: <module 'FreeCAD' from '/home/docs/checkouts/readthedocs.org/user_builds/ose-workbench-platform/conda/latest/lib/FreeCAD.so'>) → None¶ Setup extension.
- Parameters
app – application object controlling high-level functionality, such as the setup of extensions, event dispatching, and logging. See Also: https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx
freecad_icon¶
-
fcicon_role
(name: str, rawtext: str, text: str, lineno: int, inliner: docutils.parsers.rst.states.Inliner, options: dict = {}, content: List[str] = [])¶ FreeCAD Icon role function.
Returns 2 part tuple containing list of nodes to insert into the document and a list of system messages. Both are allowed to be empty.
- For additional information on role functions, see:
- Parameters
name – The role name used in the document.
rawtext – The entire markup snippet, with role.
text – The text marked with the role.
lineno – The line number where rawtext appears in the input.
inliner – The inliner instance that called us.
options – Directive options for customization.
content – The directive content for customization.
-
make_image_node
(freecad_icon_directory: str, alt: str, size: str, filename: str) → docutils.nodes.image¶ Make image node for icon.
- Parameters
freecad_icon_directory – Directory to FreeCAD Icons.
alt – Alt text of icon.
size – Must be one of “sm” (small), “md”, (medium), or “lg” (large).
filename – Filename of icon.
-
setup
(app: sphinx.application.Sphinx) → None¶ Setup extension.
- Parameters
app – application object controlling high-level functionality, such as the setup of extensions, event dispatching, and logging. See Also: https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx
osewb_docstring_process¶
Name |
Description |
---|---|
Setup extension. |
-
setup
(app: sphinx.application.Sphinx) → None¶ Setup extension.
- Parameters
app – application object controlling high-level functionality, such as the setup of extensions, event dispatching, and logging. See Also: https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx