Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3a944a6

Browse files
committed
Merge pull request #6238 from jenshnielsen/fixsphinx140issues
Fix sphinx 1.4.0 issues Conflicts: .travis.yml Reject all changes
1 parent 40cfef1 commit 3a944a6

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
plot_formats = [('png', 80), ('hires.png', 200), ('pdf', 50)]
119119

120120
# Subdirectories in 'examples/' directory of package and titles for gallery
121-
mpl_example_sections = (
121+
mpl_example_sections = [
122122
('lines_bars_and_markers', 'Lines, bars, and markers'),
123123
('shapes_and_collections', 'Shapes and collections'),
124124
('statistics', 'Statistical plots'),
@@ -138,7 +138,7 @@
138138
('axes_grid', 'axes_grid toolkit'),
139139
('units', 'units'),
140140
('widgets', 'widgets'),
141-
)
141+
]
142142

143143

144144
# Github extension

lib/matplotlib/sphinxext/mathmpl.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,15 @@ def latex2html(node, source):
8787

8888
return '<img src="%s/%s.png" %s%s/>' % (path, name, cls, style)
8989

90+
9091
def setup(app):
9192
setup.app = app
9293

93-
app.add_node(latex_math)
94-
app.add_role('math', math_role)
95-
9694
# Add visit/depart methods to HTML-Translator:
9795
def visit_latex_math_html(self, node):
9896
source = self.document.attributes['source']
9997
self.body.append(latex2html(node, source))
98+
10099
def depart_latex_math_html(self, node):
101100
pass
102101

@@ -109,13 +108,13 @@ def visit_latex_math_latex(self, node):
109108
self.body.extend(['\\begin{equation}',
110109
node['latex'],
111110
'\\end{equation}'])
111+
112112
def depart_latex_math_latex(self, node):
113113
pass
114114

115-
app.add_node(latex_math, html=(visit_latex_math_html,
116-
depart_latex_math_html))
117-
app.add_node(latex_math, latex=(visit_latex_math_latex,
118-
depart_latex_math_latex))
115+
app.add_node(latex_math,
116+
html=(visit_latex_math_html, depart_latex_math_html),
117+
latex=(visit_latex_math_latex, depart_latex_math_latex))
119118
app.add_role('math', math_role)
120119
app.add_directive('math', math_directive,
121120
True, (0, 0, 0), **options_spec)

lib/matplotlib/sphinxext/only_directives.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ def builder_inited(app):
4141
else:
4242
html_only.traverse = only_base.dont_traverse
4343

44+
4445
def setup(app):
4546
app.add_directive('htmlonly', html_only_directive, True, (0, 0, 0))
4647
app.add_directive('latexonly', latex_only_directive, True, (0, 0, 0))
47-
app.add_node(html_only)
48-
app.add_node(latex_only)
4948

5049
# This will *really* never see the light of day As it turns out,
5150
# this results in "broken" image nodes since they never get
@@ -55,14 +54,19 @@ def setup(app):
5554
# Add visit/depart methods to HTML-Translator:
5655
def visit_perform(self, node):
5756
pass
57+
5858
def depart_perform(self, node):
5959
pass
60+
6061
def visit_ignore(self, node):
6162
node.children = []
63+
6264
def depart_ignore(self, node):
6365
node.children = []
6466

65-
app.add_node(html_only, html=(visit_perform, depart_perform))
66-
app.add_node(html_only, latex=(visit_ignore, depart_ignore))
67-
app.add_node(latex_only, latex=(visit_perform, depart_perform))
68-
app.add_node(latex_only, html=(visit_ignore, depart_ignore))
67+
app.add_node(html_only,
68+
html=(visit_perform, depart_perform),
69+
latex=(visit_ignore, depart_ignore))
70+
app.add_node(latex_only,
71+
latex=(visit_perform, depart_perform),
72+
html=(visit_ignore, depart_ignore))

0 commit comments

Comments
 (0)