[Bf-blender-cvs] [2d0c9542fe0] master: BPY API: Fix usless links leading to compile errors

Aaron Carlisle noreply at git.blender.org
Sun Jul 16 23:17:17 CEST 2017


Commit: 2d0c9542fe0b7a8a76ae24376ebea5c376362351
Author: Aaron Carlisle
Date:   Sun Jul 16 17:05:29 2017 -0400
Branches: master
https://developer.blender.org/rB2d0c9542fe0b7a8a76ae24376ebea5c376362351

BPY API: Fix usless links leading to compile errors

See https://github.com/sphinx-doc/sphinx/issues/3866 for more information

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

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 3b0e8f52c83..525eebe5790 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -1630,7 +1630,8 @@ def write_sphinx_conf_py(basepath):
     file = open(filepath, "w", encoding="utf-8")
     fw = file.write
 
-    fw("import sys, os\n\n")
+    fw("import sys, os\n")
+    fw("from sphinx.domains.python import PythonDomain\n\n")
     fw("extensions = ['sphinx.ext.intersphinx']\n\n")
     fw("intersphinx_mapping = {'blender_manual': ('https://docs.blender.org/manual/en/dev/', None)}\n\n")
     fw("project = 'Blender'\n")
@@ -1653,6 +1654,15 @@ def write_sphinx_conf_py(basepath):
     fw("html_favicon = '__/static/favicon.ico'\n")
     fw("html_logo = '__/static/blender_logo.svg'\n\n")
 
+    fw("class PatchedPythonDomain(PythonDomain):\n")
+    fw("    def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):\n")
+    fw("        if 'refspecific' in node:\n")
+    fw("            del node['refspecific']\n")
+    fw("        return super(PatchedPythonDomain, self).resolve_xref(\n")
+    fw("            env, fromdocname, builder, typ, target, node, contnode)\n\n")
+    fw("def setup(sphinx):\n")
+    fw("    sphinx.override_domain(PatchedPythonDomain)\n\n")
+
     # needed for latex, pdf gen
     fw("latex_elements = {\n")
     fw("  'papersize': 'a4paper',\n")




More information about the Bf-blender-cvs mailing list