diff --git a/source/blender/python/sphinx_doc_gen.py b/source/blender/python/sphinx_doc_gen.py index b5a5171d6a1..1d1e9d50916 100644 --- a/source/blender/python/sphinx_doc_gen.py +++ b/source/blender/python/sphinx_doc_gen.py @@ -213,8 +213,8 @@ def rna2sphinx(BASEPATH): fw("project = 'Blender 3D'\n") # fw("master_doc = 'index'\n") fw("copyright = u'Blender Foundation'\n") - fw("version = '2.5'\n") - fw("release = '2.5'\n") + fw("version = '%s'\n" % bpy.app.version_string) + fw("release = '%s'\n" % bpy.app.version_string) file.close() @@ -222,37 +222,70 @@ def rna2sphinx(BASEPATH): file = open(filepath, "w") fw = file.write + fw("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n") + fw(" Blender Documentation contents\n") + fw("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n") + fw("\n") + fw("This document is an API reference for Blender %s.\n" % bpy.app.version_string.split()[0]) + fw("\n") + fw("An introduction to blender and python can be found at \n") fw("\n") fw(".. toctree::\n") - fw(" :glob:\n\n") - fw(" bpy.ops.*\n\n") - fw(" bpy.types.*\n\n") + fw(" :maxdepth: 1\n\n") + fw(" bpy.ops.rst\n\n") + fw(" bpy.types.rst\n\n") # py modules - fw(" bpy.utils\n\n") - fw(" bpy.app\n\n") + fw(" bpy.utils.rst\n\n") + fw(" bpy.app.rst\n\n") # C modules - fw(" bpy.props\n\n") + fw(" bpy.props.rst\n\n") - fw(" Mathutils\n\n") + fw(" Mathutils.rst\n\n") file.close() + + + # internal modules + filepath = os.path.join(BASEPATH, "bpy.ops.rst") + file = open(filepath, "w") + fw = file.write + fw("Blender Operators (bpy.ops)\n") + fw("===========================\n\n") + fw(".. toctree::\n") + fw(" :glob:\n\n") + fw(" bpy.ops.*\n\n") + file.close() + + filepath = os.path.join(BASEPATH, "bpy.types.rst") + file = open(filepath, "w") + fw = file.write + fw("Blender Types (bpy.types)\n") + fw("=========================\n\n") + fw(".. toctree::\n") + fw(" :glob:\n\n") + fw(" bpy.types.*\n\n") + file.close() + + + # python modules from bpy import utils as module - pymodule2sphinx(BASEPATH, "bpy.utils", module, "Blender Python Utilities") + pymodule2sphinx(BASEPATH, "bpy.utils", module, "Utilities (bpy.utils)") from bpy import app as module - pymodule2sphinx(BASEPATH, "bpy.app", module, "Blender Python Application Constants") + pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data (bpy.app)") from bpy import props as module - pymodule2sphinx(BASEPATH, "bpy.props", module, "Blender Python Property Definitions") + pymodule2sphinx(BASEPATH, "bpy.props", module, "Property Definitions (bpy.props)") import Mathutils as module - pymodule2sphinx(BASEPATH, "Mathutils", module, "Blender Mathutils") + pymodule2sphinx(BASEPATH, "Mathutils", module, "Math Types & Utilities (Mathutils)") del module + if 0: filepath = os.path.join(BASEPATH, "bpy.rst") file = open(filepath, "w") @@ -432,6 +465,7 @@ if __name__ == '__main__': # os.system("rm source/blender/python/doc/sphinx-in/*.rst") # os.system("rm -rf source/blender/python/doc/sphinx-out/*") rna2sphinx('source/blender/python/doc/sphinx-in') + # os.system("rm source/blender/python/doc/sphinx-in/bpy.types.*.rst") import sys sys.exit()