From fb20efae596565e4498fd0ea0ba310d977bab274 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Thu, 8 Oct 2020 16:20:45 +1100 Subject: PyDoc: fix most of the sphinx-build warnings Use `.. currentmodule::` instead of `.. module::` for `bpy.types` and `bpy.ops`. This change fixes most of the errors. Ref D9139 --- doc/python_api/sphinx_doc_gen.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index af7461263c8..38cc9ea8528 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -1311,7 +1311,7 @@ def pyrna2sphinx(basepath): fw(title_string(title, "=")) - fw(".. module:: %s\n\n" % struct_module_name) + fw(".. currentmodule:: %s\n\n" % struct_module_name) # docs first?, ok write_example_ref("", fw, "%s.%s" % (struct_module_name, struct_id)) @@ -1542,8 +1542,7 @@ def pyrna2sphinx(basepath): fw(title_string(class_name, "=")) - fw(".. module:: %s\n" % class_module_name) - fw("\n") + fw(".. currentmodule:: %s\n\n" % class_module_name) if use_subclasses: subclass_ids = [ @@ -1853,6 +1852,7 @@ def write_rst_types_index(basepath): file = open(filepath, "w", encoding="utf-8") fw = file.write fw(title_string("Types (bpy.types)", "=")) + fw(".. module:: bpy.types\n\n") fw(".. toctree::\n") fw(" :glob:\n\n") fw(" bpy.types.*\n\n") @@ -1868,6 +1868,7 @@ def write_rst_ops_index(basepath): file = open(filepath, "w", encoding="utf-8") fw = file.write fw(title_string("Operators (bpy.ops)", "=")) + fw(".. module:: bpy.ops\n\n") write_example_ref("", fw, "bpy.ops") fw(".. toctree::\n") fw(" :glob:\n\n") @@ -1909,7 +1910,7 @@ def write_rst_data(basepath): file = open(filepath, "w", encoding="utf-8") fw = file.write fw(title_string("Data Access (bpy.data)", "=")) - fw(".. module:: bpy\n") + fw(".. module:: bpy.data\n") fw("\n") fw("This module is used for all Blender/Python access.\n") fw("\n") -- cgit v1.2.3