Commit ec2b9f93 authored by Anton Gladky's avatar Anton Gladky

Fix compilation with the newer sphinx.

parent 20d3a2e0
Description: Fix sphinx-doc compilation with a newer sphinx
Author: Anton Gladky <gladk@debian.org>
Last-Update: 2018-06-09
--- yade-2018.02b.orig/doc/sphinx/conf.py
+++ yade-2018.02b/doc/sphinx/conf.py
@@ -172,6 +172,7 @@ def fixSrc(app,docname,source):
source[0]=replaceLaTeX(source[0])
def fixDocstring(app,what,name,obj,options,lines):
+ for i in range(0,len(lines)): lines[i]=lines[i].decode('utf-8')
# remove empty default roles, which is not properly interpreted by docutils parser
for i in range(0,len(lines)):
lines[i]=lines[i].replace(':ydefault:``','')
@@ -187,8 +188,9 @@ def fixDocstring(app,what,name,obj,optio
lines[i]=l2[i] if i<len(l2) else ''
elif isBoostMethod(what,obj):
l2=boostFuncSignature(name,obj)[1]
- for i in range(0,len(lines)):
- lines[i]=l2[i] if i<len(l2) else ''
+ if (l2):
+ for i in range(0,len(lines)):
+ lines[i]=l2[i] if i<len(l2) else ''
# LaTeX: replace $...$ by :math:`...`
# must be done after calling boostFuncSignature which uses original docstring
for i in range(0,len(lines)): lines[i]=replaceLaTeX(lines[i])
--- yade-2018.02b.orig/doc/sphinx/formulation.rst
+++ yade-2018.02b/doc/sphinx/formulation.rst
@@ -452,7 +452,7 @@ Updating particle orientation $\curr{q}$
.. math:: \curraaccel_i&=\vec{T}_i/\vec{I}_{11},
-We use the same approximation scheme, obtaining an equation analogous to :eq:`eq-leapfrog-nnextvel`
+We use the same approximation scheme, obtaining an equation analogous to :eq:`eq-leapfrog-nextvel`
.. math:: \nnextangvel&=\pprevangvel+\Dt\curraaccel.
--- yade-2018.02b.orig/doc/sphinx/yadeSphinx.py
+++ yade-2018.02b/doc/sphinx/yadeSphinx.py
@@ -4,6 +4,8 @@
# module documentation
#
import sys,os,os.path
+reload(sys)
+sys.setdefaultencoding('utf8')
outDir=sys.argv[2] if len(sys.argv)>2 else '_build'
for d in (outDir,outDir+'/latex',outDir+'/html'):
--- yade-2018.02b.orig/doc/sphinx/ipython_directive012.py
+++ yade-2018.02b/doc/sphinx/ipython_directive012.py
@@ -75,7 +75,11 @@ import matplotlib
import sphinx
from docutils.parsers.rst import directives
from docutils import nodes
-from sphinx.util.compat import Directive
+try:
+ from sphinx.util.compat import Directive
+except ImportError:
+ from docutils.parsers.rst import Directive
+
matplotlib.use('Agg')
--- yade-2018.02b.orig/doc/sphinx/ipython_directive013.py
+++ yade-2018.02b/doc/sphinx/ipython_directive013.py
@@ -76,7 +76,10 @@ import matplotlib
import sphinx
from docutils.parsers.rst import directives
from docutils import nodes
-from sphinx.util.compat import Directive
+try:
+ from sphinx.util.compat import Directive
+except ImportError:
+ from docutils.parsers.rst import Directive
matplotlib.use('Agg')
--- yade-2018.02b.orig/doc/sphinx/ipython_directive200.py
+++ yade-2018.02b/doc/sphinx/ipython_directive200.py
@@ -143,7 +143,10 @@ except ImportError:
import sphinx
from docutils.parsers.rst import directives
from docutils import nodes
-from sphinx.util.compat import Directive
+try:
+ from sphinx.util.compat import Directive
+except ImportError:
+ from docutils.parsers.rst import Directive
# Our own
from IPython import Config, InteractiveShell
--- yade-2018.02b.orig/doc/sphinx/ipython_directive500.py
+++ yade-2018.02b/doc/sphinx/ipython_directive500.py
@@ -138,7 +138,10 @@ import shutil
# Third-party
from docutils.parsers.rst import directives
-from sphinx.util.compat import Directive
+try:
+ from sphinx.util.compat import Directive
+except ImportError:
+ from docutils.parsers.rst import Directive
# Our own
from traitlets.config import Config
......@@ -2,5 +2,4 @@
08_fix_gui.patch
10_fix_bz2_pyhon2_problem.patch
fix_docs_directive.patc
fix_docs2.patch
12_fix_doc_generation.patch
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