Commit 4a72d1a4 authored by Anton Gladky's avatar Anton Gladky

Fix doc generation for newer sphinx. #955097

parent 602d7000
......@@ -363,12 +363,17 @@ def setup(app):
lexers['python'] = PythonLexer(tabsize=3)
app.connect('source-read',fixSrc)
app.connect('autodoc-skip-member',customExclude)
app.connect('autodoc-process-signature',fixSignature)
app.connect('autodoc-process-docstring',fixDocstring)
app.add_description_unit('ystaticattr',None,objname='static attribute',indextemplate='pair: %s; static method',parse_node=parse_ystaticattr)
import sphinx.versioning
if (sphinx.version_info[0] == 1):
# In newer sphinx version add_description_unit was deprecated. Keep for backcompatability
app.add_description_unit('ystaticattr',None,objname='static attribute',indextemplate='pair: %s; static method',parse_node=parse_ystaticattr)
else:
app.add_object_type('ystaticattr',None,objname='static attribute',indextemplate='pair: %s; static method',parse_node=parse_ystaticattr)
import sys, os
......
......@@ -305,12 +305,14 @@ for bib in ('references','yade-articles','yade-theses','yade-conferences','citin
# Workaround: launch this script as many times as needed (3 times for doc compilations and 1 time for post workarounds), see CMakeLists.txt.
if(writer != "workarounds"):
genWrapperRst()
# HACK: must rewrite sys.argv, since reference generator in conf.py determines if we output latex/html by inspecting it
sys.argv=['sphinx-build','-a','-v','-T','-P','-E','-b','%s'%writer,'-d',outDir+'/doctrees','.',outDir+'/%s'%writer]
try:
sphinx.main(sys.argv)
except Exception:
pass
runBuildParams=['sphinx-build','-a','-v','-T','-P','-E','-b','%s'%writer,'-d',outDir+'/doctrees','.',outDir+'/%s'%writer]
if (sphinx.version_info[0] == 1):
# In newer sphinx version sphinx.main was deprecated. Keep for backcompatability
sphinx.main(runBuildParams)
else:
import sphinx.cmd.build
sphinx.cmd.build.main(runBuildParams[1:])
else:
#HTML FIXES:
makeBaseClassesClickable((outDir+'/html/yade.wrapper.html'),"html")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment