diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-06-27 22:34:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-06-27 22:34:27 +0400 |
commit | 768ecb1ba90b964ff1eeae8798889d0b07dea741 (patch) | |
tree | 9eb6d26b0c46aa97c667046723639e33721d6085 /source/blender/python/doc/sphinx_doc_gen.py | |
parent | 650de24271501bddce1c0782ea071e9d8727101a (diff) |
api reference docs: include bpy.data in the main page since its used everywhere.
since this isnt a module its self its a little odd to do this but toctree cant make arbitrary cross-references.
Also added some usage examples: http://www.blender.org/documentation/250PythonDoc/bpy.data.html
Diffstat (limited to 'source/blender/python/doc/sphinx_doc_gen.py')
-rw-r--r-- | source/blender/python/doc/sphinx_doc_gen.py | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/source/blender/python/doc/sphinx_doc_gen.py b/source/blender/python/doc/sphinx_doc_gen.py index 6363e14d85c..195a91e7539 100644 --- a/source/blender/python/doc/sphinx_doc_gen.py +++ b/source/blender/python/doc/sphinx_doc_gen.py @@ -296,7 +296,7 @@ def rna2sphinx(BASEPATH): if bpy.app.build_revision != "Unknown": version_string = version_string + " r" + bpy.app.build_revision - fw("project = 'Blender 3D'\n") + fw("project = 'Blender'\n") # fw("master_doc = 'index'\n") fw("copyright = u'Blender Foundation'\n") fw("version = '%s - UNSTABLE API'\n" % version_string) @@ -323,7 +323,7 @@ def rna2sphinx(BASEPATH): fw("\n") fw("This document is an API reference for Blender %s. built %s.\n" % (version_string, bpy.app.build_date)) fw("\n") - fw("An introduction to blender and python can be found at <http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro>\n") + fw("An introduction to Blender and Python can be found at <http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro>\n") fw("\n") fw("`A PDF version of this document is also available <blender_python_reference_250.pdf>`__\n") fw("\n") @@ -350,6 +350,7 @@ def rna2sphinx(BASEPATH): fw("\n") fw(".. toctree::\n") fw(" :maxdepth: 1\n\n") + fw(" bpy.data.rst\n\n") # note: not actually a module fw(" bpy.ops.rst\n\n") fw(" bpy.types.rst\n\n") @@ -390,8 +391,8 @@ def rna2sphinx(BASEPATH): 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("Operators (bpy.ops)\n") + fw("===================\n\n") fw(".. toctree::\n") fw(" :glob:\n\n") fw(" bpy.ops.*\n\n") @@ -400,14 +401,37 @@ def rna2sphinx(BASEPATH): 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("Types (bpy.types)\n") + fw("=================\n\n") fw(".. toctree::\n") fw(" :glob:\n\n") fw(" bpy.types.*\n\n") file.close() + # not actually a module, only write this file so we + # can reference in the TOC + filepath = os.path.join(BASEPATH, "bpy.data.rst") + file = open(filepath, "w") + fw = file.write + fw("Data Access (bpy.data)\n") + fw("======================\n\n") + fw(".. module:: bpy\n") + fw("\n") + fw("This module is used for all blender/python access.\n") + fw("\n") + fw(" .. literalinclude:: ../examples/bpy.data.py\n") + fw("\n") + fw(" .. data:: data\n") + fw("\n") + fw(" Access to blenders internal data\n") + fw("\n") + fw(" :type: :class:`bpy.types.Main`\n") + file.close() + + EXAMPLE_SET_USED.add("bpy.data") + + # python modules from bpy import utils as module pymodule2sphinx(BASEPATH, "bpy.utils", module, "Utilities (bpy.utils)") @@ -424,7 +448,7 @@ def rna2sphinx(BASEPATH): del module import blf as module - pymodule2sphinx(BASEPATH, "blf", module, "Blender Font Drawing (blf)") + pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing (blf)") del module # game engine |