Commit a257247c authored by Pierre Augier's avatar Pierre Augier

Compatibility sphinx >= 1.8 (maybe version 0.3.1)

parent 4873fea5493c
0.3.1 (2019-02-14)
------------------
- Compatibility sphinx >= 1.8
- Improve cluster Slurm
0.3.0 (2019-01-27)
------------------
......
......@@ -71,25 +71,14 @@ operator, :math:`\nu` the viscosity and :math:`\bnabla^2` the Laplacian operator
"""
from __future__ import print_function
import re
from docutils.parsers.rst.directives.misc import Replace
from docutils import nodes, utils
from docutils.parsers.rst.roles import math_role as old_math_role
from sphinx.directives.patches import MathDirective
class math(nodes.Inline, nodes.TextElement):
pass
def old_math_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
latex = utils.unescape(text, restore_backslashes=True)
return [math(latex=latex)], []
def multiple_replacer(replace_dict):
"""Return a function replacing doing multiple replacements.
......@@ -174,15 +163,10 @@ def new_math_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
def setup(app):
# when sphinx 1.8 is available, we can add the argument override=True to
# add_role and add_directive to avoid warnings...
try:
# sphinx 1.8
app.add_role("math", new_math_role, override=True)
app.add_directive("math", NewMathDirective, override=True)
except TypeError:
app.add_role("math", new_math_role)
app.add_directive("math", NewMathDirective)
app.add_role("math", new_math_role, override=True)
app.add_directive("math", NewMathDirective, override=True)
app.add_directive("mathmacro", MathMacro)
......
......@@ -11,4 +11,4 @@ http://legacy.python.org/dev/peps/pep-0386/
'a' or 'alpha' means alpha version (internal testing),
'b' or 'beta' means beta version (external testing).
"""
__version__ = "0.3.0"
__version__ = "0.3.1"
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