[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26354] trunk/blender/source/blender/ python/sphinx_doc_gen.py: nicer start page for sphinx docs

Campbell Barton ideasman42 at gmail.com
Wed Jan 27 23:17:27 CET 2010


Revision: 26354
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26354
Author:   campbellbarton
Date:     2010-01-27 23:17:27 +0100 (Wed, 27 Jan 2010)

Log Message:
-----------
nicer start page for sphinx docs

Modified Paths:
--------------
    trunk/blender/source/blender/python/sphinx_doc_gen.py

Modified: trunk/blender/source/blender/python/sphinx_doc_gen.py
===================================================================
--- trunk/blender/source/blender/python/sphinx_doc_gen.py	2010-01-27 21:40:08 UTC (rev 26353)
+++ trunk/blender/source/blender/python/sphinx_doc_gen.py	2010-01-27 22:17:27 UTC (rev 26354)
@@ -213,8 +213,8 @@
     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 @@
     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 <http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro>\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 @@
         # 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()





More information about the Bf-blender-cvs mailing list