diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-03-06 16:28:54 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-03-06 16:29:03 +0300 |
commit | 2d5773d11a0698f1cf421d7fc7c7d823be601124 (patch) | |
tree | 10bbb31759a15292875794d47b271d5e2a56c274 /doc/python_api/sphinx_doc_gen.py | |
parent | 07c5ca7f2cfc1e9bd898d88f7ed84d24cfc105c2 (diff) |
Documentation: added bpy.msgbus description and examples
The `bpy.msgbus` namespace was not included in the documentation generation.
I've added it, and ported Campbell's examples from P563.
Diffstat (limited to 'doc/python_api/sphinx_doc_gen.py')
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 60058d5d17f..b47b59b473d 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -1756,6 +1756,7 @@ def write_rst_contents(basepath): app_modules = ( "bpy.context", # note: not actually a module "bpy.data", # note: not actually a module + "bpy.msgbus", # note: not actually a module "bpy.ops", "bpy.types", @@ -1846,6 +1847,29 @@ def write_rst_ops_index(basepath): file.close() +def write_rst_msgbus(basepath): + """ + Write the rst files of bpy.msgbus module + """ + if 'bpy.msgbus' in EXCLUDE_MODULES: + return + + # Write the index. + filepath = os.path.join(basepath, "bpy.msgbus.rst") + file = open(filepath, "w", encoding="utf-8") + fw = file.write + fw(title_string("Message Bus (bpy.msgbus)", "=")) + write_example_ref("", fw, "bpy.msgbus") + fw(".. toctree::\n") + fw(" :glob:\n\n") + fw(" bpy.msgbus.*\n\n") + file.close() + + # Write the contents. + pymodule2sphinx(basepath, 'bpy.msgbus', bpy.msgbus, 'Message Bus') + EXAMPLE_SET_USED.add("bpy.msgbus") + + def write_rst_data(basepath): ''' Write the rst file of bpy.data module @@ -2000,6 +2024,7 @@ def rna2sphinx(basepath): write_rst_bpy(basepath) # bpy, disabled by default write_rst_types_index(basepath) # bpy.types write_rst_ops_index(basepath) # bpy.ops + write_rst_msgbus(basepath) # bpy.msgbus pyrna2sphinx(basepath) # bpy.types.* and bpy.ops.* write_rst_data(basepath) # bpy.data write_rst_importable_modules(basepath) |