Skip to content

Commit c53030d

Browse files
committed
Merged revisions 6627,6629 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint ........ r6627 | jdh2358 | 2008-12-16 06:44:09 -0800 (Tue, 16 Dec 2008) | 1 line removed mpl_data link ........ r6629 | jdh2358 | 2008-12-16 08:13:07 -0800 (Tue, 16 Dec 2008) | 1 line applied Darren's sphinx patch, cleaned up some docstrings ........ svn path=/trunk/matplotlib/; revision=6630
1 parent d7b46b1 commit c53030d

File tree

14 files changed

+126
-121
lines changed

14 files changed

+126
-121
lines changed

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2008-12-15 Removed mpl_data symlink in docs. On platforms that do not
2+
support symlinks, these become copies, and the font files
3+
are large, so the distro becomes unneccessarily bloaded.
4+
Keeping the mpl_examples dir because relative links are
5+
harder for the plot directive and the *.py files are not so
6+
large. - JDH
7+
18
2008-12-15 Fix \$ in non-math text with usetex off. Document
29
differences between usetex on/off - MGD
310

doc/README.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ python documentation system built on top of ReST. This directory contains
2727

2828
* sphinxext - Sphinx extensions for the mpl docs
2929

30-
* mpl_data - a symbolic link to the matplotlib data for reference by
31-
sphinx documentation
32-
3330
* mpl_examples - a link to the matplotlib examples in case any
3431
documentation wants to literal include them
3532

doc/api/api_changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ The :class:`Polar` class has moved to :mod:`matplotlib.projections.polar`.
260260
`Axes.toggle_log_lineary()` has been removed.
261261
262262
:mod:`matplotlib.artist`
263-
~~~~~~~~~~~~~~~~~~~~~~~~
263+
~~~~~~~~~~~~~~~~~~~~~~~~~~
264264

265265
============================================================ ============================================================
266266
Old method New method

doc/api/font_manager_api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ matplotlib font_manager
1111
:show-inheritance:
1212

1313
:mod:`matplotlib.fontconfig_pattern`
14-
====================================
14+
========================================
1515

1616
.. automodule:: matplotlib.fontconfig_pattern
1717
:members:

doc/devel/documenting_mpl.rst

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -271,25 +271,40 @@ Referring to mpl documents
271271
==========================
272272

273273
In the documentation, you may want to include to a document in the
274-
matplotlib src, e.g. a license file, an image file from `mpl-data`, or an
275-
example. When you include these files, include them using a symbolic
276-
link from the documentation parent directory. This way, if we
277-
relocate the mpl documentation directory, all of the internal pointers
278-
to files will not have to change, just the top level symlinks. For
279-
example, In the top level doc directory we have symlinks pointing to
280-
the mpl `examples` and `mpl-data`::
281-
282-
home:~/mpl/doc2> ls -l mpl_*
283-
mpl_data -> ../lib/matplotlib/mpl-data
284-
mpl_examples -> ../examples
274+
matplotlib src, e.g. a license file or an image file from `mpl-data`,
275+
refer to it via a relative path from the document where the rst file
276+
resides, eg, in :file:`users/navigation_toolbar.rst`, we refer to the
277+
image icons with::
285278

279+
.. image:: ../../lib/matplotlib/mpl-data/images/subplots.png
286280

287281
In the `users` subdirectory, if I want to refer to a file in the mpl-data
288282
directory, I use the symlink directory. For example, from
289283
`customizing.rst`::
290284

291-
.. literalinclude:: ../mpl_data/matplotlibrc
285+
.. literalinclude:: ../../lib/matplotlib/mpl-data/matplotlibrc
286+
287+
On exception to this is when referring to the examples dir. Relative
288+
paths are extremely confusing in the sphinx plot extensions, so
289+
without getting into the dirty details, it is easier to simply include
290+
a symlink to the files at the top doc level directory. This way, API
291+
documents like :meth:`matplotlib.pyplot.plot` can refer to the
292+
examples in a known location.
293+
294+
In the top level doc directory we have symlinks pointing to
295+
the mpl `examples`::
296+
297+
home:~/mpl/doc> ls -l mpl_*
298+
mpl_examples -> ../examples
299+
300+
So we can include plots from the examples dir using the symlink::
301+
302+
.. plot:: mpl_examples/pylab_examples/simple_plot.py
303+
292304

305+
We used to use a symlink for :file:`mpl-data` too, but the distro
306+
becomes very large on platforms that do not support links (eg the font
307+
files are duplicated and large)
293308

294309
.. _internal-section-refs:
295310

doc/make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def html():
4141
check_build()
4242
if not os.path.exists('examples/index.rst'):
4343
examples()
44-
shutil.copy('mpl_data/matplotlibrc', '_static/matplotlibrc')
44+
shutil.copy('../lib/matplotlib/mpl-data/matplotlibrc', '_static/matplotlibrc')
4545
#figs()
4646
if os.system('sphinx-build -b html -d build/doctrees . build/html'):
4747
raise SystemExit("Building HTML failed.")

doc/pyplots/plotmap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# read in topo data (on a regular lat/lon grid)
1212
# longitudes go from 20 to 380.
1313
# you can get this data from matplolib svn matplotlib/htdocs/screenshots/data/
14-
datadir = '/home/jdhunter/python/svn/matplotlib/htdocs/screenshots/data/'
14+
datadir = '/home/jdhunter/python/svn/matplotlib/trunk/htdocs/screenshots/data/'
1515
if not os.path.exists(datadir):
1616
raise SystemExit('You need to download the data with svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/htdocs/screenshots/data/" and set the datadir variable in %s'%__file__)
1717

doc/sphinxext/inheritance_diagram.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ class E(B): pass
3939
from md5 import md5
4040

4141
from docutils.nodes import Body, Element
42-
from docutils.writers.html4css1 import HTMLTranslator
43-
from sphinx.latexwriter import LaTeXTranslator
4442
from docutils.parsers.rst import directives
4543
from sphinx.roles import xfileref_role
4644

@@ -409,12 +407,9 @@ def run(self):
409407
inheritance_diagram_directive)
410408

411409
def setup(app):
412-
app.add_node(inheritance_diagram)
413-
414-
HTMLTranslator.visit_inheritance_diagram = \
415-
visit_inheritance_diagram(html_output_graph)
416-
HTMLTranslator.depart_inheritance_diagram = do_nothing
417-
418-
LaTeXTranslator.visit_inheritance_diagram = \
419-
visit_inheritance_diagram(latex_output_graph)
420-
LaTeXTranslator.depart_inheritance_diagram = do_nothing
410+
app.add_node(inheritance_diagram,
411+
html=(visit_inheritance_diagram(html_output_graph),
412+
do_nothing))
413+
app.add_node(inheritance_diagram,
414+
latex=(visit_inheritance_diagram(latex_output_graph),
415+
do_nothing))

doc/sphinxext/mathmpl.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
from docutils import nodes
88
from docutils.parsers.rst import directives
9-
from docutils.writers.html4css1 import HTMLTranslator
10-
from sphinx.latexwriter import LaTeXTranslator
119
import warnings
1210

1311
# Define LaTeX math node:
@@ -69,8 +67,6 @@ def visit_latex_math_html(self, node):
6967
self.body.append(latex2html(node, source))
7068
def depart_latex_math_html(self, node):
7169
pass
72-
HTMLTranslator.visit_latex_math = visit_latex_math_html
73-
HTMLTranslator.depart_latex_math = depart_latex_math_html
7470

7571
# Add visit/depart methods to LaTeX-Translator:
7672
def visit_latex_math_latex(self, node):
@@ -83,8 +79,13 @@ def visit_latex_math_latex(self, node):
8379
'\\end{equation}'])
8480
def depart_latex_math_latex(self, node):
8581
pass
86-
LaTeXTranslator.visit_latex_math = visit_latex_math_latex
87-
LaTeXTranslator.depart_latex_math = depart_latex_math_latex
82+
83+
app.add_node(latex_math, html=(visit_latex_math_html,
84+
depart_latex_math_html))
85+
app.add_node(latex_math, latex=(visit_latex_math_latex,
86+
depart_latex_math_latex))
87+
app.add_role('math', math_role)
88+
8889

8990
from matplotlib import rcParams
9091
from matplotlib.mathtext import MathTextParser

doc/sphinxext/only_directives.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#
55

66
from docutils.nodes import Body, Element
7-
from docutils.writers.html4css1 import HTMLTranslator
8-
from sphinx.latexwriter import LaTeXTranslator
97
from docutils.parsers.rst import directives
108

119
class html_only(Body, Element):
@@ -63,9 +61,6 @@ class LatexOnlyDirective(OnlyDirective):
6361
directives.register_directive('latexonly', LatexOnlyDirective)
6462

6563
def setup(app):
66-
app.add_node(html_only)
67-
app.add_node(latex_only)
68-
6964
# Add visit/depart methods to HTML-Translator:
7065
def visit_perform(self, node):
7166
pass
@@ -76,12 +71,7 @@ def visit_ignore(self, node):
7671
def depart_ignore(self, node):
7772
node.children = []
7873

79-
HTMLTranslator.visit_html_only = visit_perform
80-
HTMLTranslator.depart_html_only = depart_perform
81-
HTMLTranslator.visit_latex_only = visit_ignore
82-
HTMLTranslator.depart_latex_only = depart_ignore
83-
84-
LaTeXTranslator.visit_html_only = visit_ignore
85-
LaTeXTranslator.depart_html_only = depart_ignore
86-
LaTeXTranslator.visit_latex_only = visit_perform
87-
LaTeXTranslator.depart_latex_only = depart_perform
74+
app.add_node(html_only, html=(visit_perform, depart_perform))
75+
app.add_node(html_only, latex=(visit_ignore, depart_ignore))
76+
app.add_node(latex_only, latex=(visit_perform, depart_perform))
77+
app.add_node(latex_only, html=(visit_ignore, depart_ignore))

0 commit comments

Comments
 (0)