10000 Merge remote-tracking branch 'matplotlib/v2.0.0-doc' into v2.0.x · matplotlib/matplotlib@e035a3a · GitHub
[go: up one dir, main page]

Skip to content

Commit e035a3a

Browse files
committed
Merge remote-tracking branch 'matplotlib/v2.0.0-doc' into v2.0.x
2 parents eb06e2c + fa76580 commit e035a3a

File tree

7 files changed

+56
-10
lines changed

7 files changed

+56
-10
lines changed

doc/README.txt

Lines changed: 13 additions & 4 deletions
< 10000 td data-grid-cell-id="diff-58173a8c0707f9b78fd313f190cf8aa3363a26ddfbe11132d1c925789d972d7d-8-8-1" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-additionNum-bgColor, var(--diffBlob-addition-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">8
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,24 @@ Matplotlib documentation
55
Building the documentation
66
--------------------------
77

8-
A list of dependencies can be found in ../doc-requirements.txt.
+
To build the documentation, you will need additional dependencies:
99

10-
All of these dependencies can be installed through pip::
10+
* Sphinx-1.3 or later (version 1.5.0 is not supported)
11+
* numpydoc 0.4 or later
12+
* IPython
13+
* mock
14+
* colorspacious
15+
* pillow
16+
* graphviz
17+
18+
All of these dependencies *except graphviz* can be installed through pip::
1119

1220
pip install -r ../doc-requirements.txt
1321

14-
or conda::
22+
or all of them via conda and pip::
1523

16-
conda install sphinx numpydoc ipython mock colorspacious pillow
24+
conda install sphinx numpydoc ipython mock graphviz pillow
25+
pip install colorspacious
1726

1827
To build the HTML documentation, type ``python make.py html`` in this
1928
directory. The top file of the results will be ./build/html/index.html

doc/_static/depsy_badge_default.svg

Lines changed: 1 addition & 0 deletions
Loading

doc/_static/mpl.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pre {
4343
border: 1px solid #ccc;
4444
background-color: #f8f8f8;
4545
line-height: 140%;
46+
overflow-x: auto;
4647
}
4748

4849
td.linenos pre {

doc/_templates/badgesidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
<a href="http://depsy.org/package/python/matplotlib">
3-
<img src="http://depsy.org/api/package/pypi/matplotlib/badge.svg">
3+
<img src="{{ pathto('_static/depsy_badge.svg', 1) }}">
44
</a>
55

66
<br/>

doc/devel/coding_guide.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ Documentation
3535

3636
* See :ref:`documenting-matplotlib` for our documentation style guide.
3737

38-
* If your changes are non-trivial, please make an entry in the
39-
:file:`CHANGELOG`.
40-
4138
* If your change is a major new feature, add an entry to
4239
:file:`doc/users/whats_new.rst`.
4340

doc/devel/documenting_mpl.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@ Getting started
88
===============
99

1010
The documentation for matplotlib is generated from ReStructured Text using the
11-
Sphinx_ documentation generation tool. Sphinx-1.0 or later and numpydoc 0.4 or
12-
later is required.
11+
Sphinx_ documentation generation tool.
12+
The requirements are as follows (https://github.com/matplotlib/matplotlib/blob/master/doc-requirements.txt)
13+
14+
1. Sphinx-1.3 or later(Version 1.5.0 is not supported)
15+
2. numpydoc 0.4 or later
16+
3. IPython
17+
4. Mock
18+
5. colorspacious
19+
6. pillow
20+
7. graphviz
21+
1322

1423
The documentation sources are found in the :file:`doc/` directory in
1524
the trunk. To build the users guide in html format, cd into

doc/make.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import argparse
1111
import subprocess
1212
import matplotlib
13+
import six
1314

1415

1516
def copy_if_out_of_date(original, derived):
@@ -85,10 +86,38 @@ def generate_frontpage_pngs(only_if_needed=True):
8586
os.rename(fn_png, pn_png) # move file to _static/ directory
8687

8788

89+
DEPSY_PATH = "_static/depsy_badge.svg"
90+
DEPSY_URL = "http://depsy.org/api/package/pypi/matplotlib/badge.svg"
91+
DEPSY_DEFAULT = "_static/depsy_badge_default.svg"
92+
93+
94+
def fetch_depsy_badge():
95+
"""Fetches a static copy of the depsy badge.
96+
97+
If there is any network error, use a static copy from git.
98+
99+
This is to avoid a mixed-content warning when serving matplotlib.org
100+
over https, see https://github.com/Impactstory/depsy/issues/77
101+
102+
The downside is that the badge only updates when the documentation
103+
is rebuilt."""
104+
try:
105+
request = six.moves.urllib.request.urlopen(DEPSY_URL)
106+
try:
107+
data = request.read().decode('utf-8')
108+
with open(DEPSY_PATH, 'w') as output:
109+
output.write(data)
110+
finally:
111+
request.close()
112+
except six.moves.urllib.error.URLError:
113+
shutil.copyfile(DEPSY_DEFAULT, DEPSY_PATH)
114+
115+
88116
def html(buildername='html'):
89117
"""Build Sphinx 'html' target. """
90118
check_build()
91119
generate_frontpage_pngs()
120+
fetch_depsy_badge()
92121

93122
rc = '../lib/matplotlib/mpl-data/matplotlibrc'
94123
default_rc = os.path.join(matplotlib._get_data_path(), 'matplotlibrc')

0 commit comments

Comments
 (0)
0