From 52cefa4bc1104231cf6c6ef5b12124df135e2914 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Sep 2010 09:21:40 +0000 Subject: sphinx doc gen - use 3 column lists for inherited props, funcs and for references to save on vertical space. - use the blender version string for the upload path and PDF name. --- source/blender/python/doc/sphinx_doc_gen.py | 32 +++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'source/blender/python/doc/sphinx_doc_gen.py') diff --git a/source/blender/python/doc/sphinx_doc_gen.py b/source/blender/python/doc/sphinx_doc_gen.py index 06d1a9021b8..5d70e62dde8 100644 --- a/source/blender/python/doc/sphinx_doc_gen.py +++ b/source/blender/python/doc/sphinx_doc_gen.py @@ -307,6 +307,9 @@ def rna2sphinx(BASEPATH): if bpy.app.build_revision != "Unknown": version_string = version_string + " r" + bpy.app.build_revision + # for use with files + version_string_fp = "_".join(str(v) for v in bpy.app.version) + fw("project = 'Blender'\n") # fw("master_doc = 'index'\n") fw("copyright = u'Blender Foundation'\n") @@ -336,7 +339,7 @@ def rna2sphinx(BASEPATH): fw("\n") fw("An introduction to Blender and Python can be found at \n") fw("\n") - fw("`A PDF version of this document is also available `__\n") + fw("`A PDF version of this document is also available `__\n" % version_string_fp) fw("\n") fw(".. warning:: The Python API in Blender is **UNSTABLE**, It should only be used for testing, any script written now may break in future releases.\n") fw(" \n") @@ -636,20 +639,24 @@ def rna2sphinx(BASEPATH): if _BPY_STRUCT_FAKE: for key, descr in descr_items: if type(descr) == GetSetDescriptorType: - lines.append("* :class:`%s.%s`\n" % (_BPY_STRUCT_FAKE, key)) + lines.append(" * :class:`%s.%s`\n" % (_BPY_STRUCT_FAKE, key)) for base in bases: for prop in base.properties: - lines.append("* :class:`%s.%s`\n" % (base.identifier, prop.identifier)) + lines.append(" * :class:`%s.%s`\n" % (base.identifier, prop.identifier)) for identifier, py_prop in base.get_py_properties(): - lines.append("* :class:`%s.%s`\n" % (base.identifier, identifier)) + lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier)) for identifier, py_prop in base.get_py_properties(): - lines.append("* :class:`%s.%s`\n" % (base.identifier, identifier)) + lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier)) if lines: fw(".. rubric:: Inherited Properties\n\n") + + fw(".. hlist::\n") + fw(" :columns: 3\n\n") + for line in lines: fw(line) fw("\n") @@ -661,16 +668,20 @@ def rna2sphinx(BASEPATH): if _BPY_STRUCT_FAKE: for key, descr in descr_items: if type(descr) == MethodDescriptorType: - lines.append("* :class:`%s.%s`\n" % (_BPY_STRUCT_FAKE, key)) + lines.append(" * :class:`%s.%s`\n" % (_BPY_STRUCT_FAKE, key)) for base in bases: for func in base.functions: - lines.append("* :class:`%s.%s`\n" % (base.identifier, func.identifier)) + lines.append(" * :class:`%s.%s`\n" % (base.identifier, func.identifier)) for identifier, py_func in base.get_py_functions(): - lines.append("* :class:`%s.%s`\n" % (base.identifier, identifier)) + lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier)) if lines: fw(".. rubric:: Inherited Functions\n\n") + + fw(".. hlist::\n") + fw(" :columns: 3\n\n") + for line in lines: fw(line) fw("\n") @@ -682,11 +693,14 @@ def rna2sphinx(BASEPATH): # use this otherwise it gets in the index for a normal heading. fw(".. rubric:: References\n\n") + fw(".. hlist::\n") + fw(" :columns: 3\n\n") + for ref in struct.references: ref_split = ref.split(".") if len(ref_split) > 2: ref = ref_split[-2] + "." + ref_split[-1] - fw("* :class:`%s`\n" % ref) + fw(" * :class:`%s`\n" % ref) fw("\n") -- cgit v1.2.3