[Bf-blender-cvs] [3c016fbfd09] master: Fix error indenting new-lines in generated RST API docs

Campbell Barton noreply at git.blender.org
Mon Jul 18 12:00:25 CEST 2022


Commit: 3c016fbfd092e0ea2bbdc62b2967a6b1f7da00d5
Author: Campbell Barton
Date:   Mon Jul 18 19:55:51 2022 +1000
Branches: master
https://developer.blender.org/rB3c016fbfd092e0ea2bbdc62b2967a6b1f7da00d5

Fix error indenting new-lines in generated RST API docs

New-lines in RNA type descriptions caused invalid RST indentation.

This resolve the error noted by @nutti in D15481.

===================================================================

M	doc/python_api/sphinx_doc_gen.py

===================================================================

diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 17ffdb8e244..f5e0369cede 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -1529,7 +1529,8 @@ def pyrna2sphinx(basepath):
         else:
             fw(".. class:: %s\n\n" % struct_id)
 
-        fw("   %s\n\n" % struct.description)
+        write_indented_lines("   ", fw, struct.description, False)
+        fw("\n")
 
         # Properties sorted in alphabetical order.
         sorted_struct_properties = struct.properties[:]



More information about the Bf-blender-cvs mailing list