10000 DOC better styling for topic sections · phobson/matplotlib@388a4a0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 388a4a0

Browse files
committed
DOC better styling for topic sections
* DOC adressed reviewer's comments * DOC rdt.org -> rdt.io
1 parent 19603a5 commit 388a4a0

File tree

9 files changed

+74
-73
lines changed

9 files changed

+74
-73
lines changed

doc/_static/mpl.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,20 @@ div.admonition {
400400
}
401401

402402

403-
div.note, div.topic {
403+
div.note {
404404
background-color: #eee;
405405
border: 1px solid #ccc;
406406
}
407407

408+
div.topic {
409+
background-color: #eee;
410+
border: 1px solid #CCC;
411+
margin: 10px 0px;
412+
padding: 7px 7px 0px;
413+
border-radius: 4px;
414+
-moz-border-radius: 4px;
415+
}
416+
408417
p.topic-title {
409418
font-size: 1.1em;
410419
font-weight: bold;

doc/devel/add_new_projection.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _adding-new-scales:
22

3-
========================================================
4-
Developer's guide for creating scales and transformation
5-
========================================================
3+
=========================================================
4+
Developer's guide for creating scales and transformations
5+
=========================================================
66

77
.. ::author Michael Droettboom
88

doc/devel/contributing.rst

Lines changed: 50 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The project is hosted on https://github.com/matplotlib/matplotlib
1212
Submitting a bug report
1313
=======================
1414

15-
In case you experience issues using this package, do not hesitate to submit a
15+
If you find a bug in the code or documentation, do not hesitate to submit a
1616
ticket to the
1717
`Bug Tracker <https://github.com/matplotlib/matplotlib/issues>`_. You are
1818
also welcome to post feature requests or pull requests.
@@ -30,52 +30,56 @@ You can check out the latest sources with the command::
3030
git clone git@github.com:matplotlib/matplotlib.git
3131

3232

33-
After obtaining a local copy of the matpotlib source code (:ref:`set-up-fork`),
34-
navigate to the matplotlib directory and run the following in the shell:
35-
36< B41A code class="diff-text syntax-highlighted-line deletion">-
::
33+
After obtaining a local copy of the matplotlib source code (:ref:`set-up-fork`),
34+
navigate to the matplotlib directory and run the following in the shell::
3735
3836
python setup.py develop
3937

4038
or::
4139
4240
pip install -v -e .
4341

44-
This installs matplotlib for development (i.e., builds everything and places the
45-
symbolic links back to the source code). You can then run the tests your work
46-
environment is set up properly::
4742

48-
python tests.py
43+
This installs matplotlib for development (i.e., builds everything and places the
44+
symbolic links back to the source code).
4945

46+
.. warning::
5047

51-
You may want to consider setting up a `virtual environment
52-
<http://docs.python-guide.org/en/latest/dev/virtualenvs/>`_ or a `conda
53-
environment <http://conda.pydata.org/docs/using/envs.html>`_
48+
If you already have a version of matplotlib installed, you will need to
49+
uninstall it.
5450

5551

5652
.. note::
5753

58-
If you decide to do this, you will have to rerun::
54+
If you decide to do install with ``python setup.py develop`` or ``pip
55+
install -v -e``, you will have to rerun::
5956

6057
python setup.py build
6158

< F438 /div>
6259
every time the source code of a compiled extension is changed (for
6360
instance when switching branches or pulling changes from upstream).
6461

65-
.. _nose: http://nose.readthedocs.org/en/latest/
66-
.. _pep8: http://pep8.readthedocs.org/en/latest/
62+
63+
64+
You can then run the tests to check your work environment is set up properly::
65+
66+
python tests.py
67+
68+
69+
.. _nose: https://nose.readthedocs.io/en/latest/
70+
.. _pep8: https://pep8.readthedocs.io/en/latest/
6771

6872
.. note::
6973

7074
**Additional dependencies for testing**: nose_ (version 1.0 or later), `mock
71-
<http://www.voidspace.org.uk/python/mock/>`_ (if python < 3.3), `Ghostscript
72-
<http://pages.cs.wisc.edu/~ghost/>`_, `Inkscape <http://inkscape.org>`_
75+
<https://docs.python.org/dev/library/unittest.mock.html>`_ (if python < 3.3), `Ghostscript
76+
<http://www.ghostscript.com/>`_, `Inkscape <http://inkscape.org>`_
7377

7478
.. note:: To make sure the tests run locally:
7579

7680
* Copy setup.cfg.template to setup.cfg
77-
* Edit setup.cfg to set `test` to True, and `local_freetype` to True
78-
* If you have build matplotlib previously, remove the build folder.
81+
* Edit setup.cfg to set ``test`` to True, and ``local_freetype`` to True
82+
* If you have built matplotlib previously, remove the ``build`` folder.
7983
* Execute the build command.
8084

8185
When working on bleeding edge packages, setting up a
@@ -112,21 +116,22 @@ then submit a "pull request" (PR):
112116

113117
4. Create a branch to hold your changes::
114118

115-
$ git checkout -b my-feature
119+
$ git checkout -b my-feature origin/master
116120

117121
and start making changes. Never work in the ``master`` branch!
118122

119123
5. Work on this copy, on your computer, using Git to do the version
120-
control. When you're done editing, do::
124+
control. When you're done editing e.g., ``lib/matplotlib/collections.py``,
125+
do::
121126

122-
$ git add modified_files
127+
$ git add lib/matplotlib/collections.py
123128
$ git commit
124129

125130
to record your changes in Git, then push them to GitHub with::
126131

127132
$ git push -u origin my-feature
128133

129-
Finally, go to the web page of the your fork of the matplotlib repo,
134+
Finally, go to the web page of your fork of the matplotlib repo,
130135
and click 'Pull request' to send your changes to the maintainers for review.
131136
You may want to consider sending an email to the mailing list for more
132137
visibility.
@@ -143,24 +148,24 @@ Contributing pull requests
143148
It is recommended to check that your contribution complies with the following
144149
rules before submitting a pull request:
145150

146-
* If your pull request addresses an issue, please use the title todescribe
151+
* If your pull request addresses an issue, please use the title to describe
147152
the issue and mention the issue number in the pull request description
148153
to ensure a link is created to the original issue.
149154

150155
* All public methods should have informative docstrings with sample
151-
usage presented as doctests when appropriate. Use the
156+
usage when appropriate. Use the
152157
`numpy docstring standard <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_
153158

154-
* Formatting should follow `PEP8 recommandation
155-
<http://www.python.org/dev/peps/pep-0008/>`_. You should consider
159+
* Formatting should follow `PEP8 recommendation
160+
<https://www.python.org/dev/peps/pep-0008/>`_. You should consider
156161
installing/enabling automatic PEP8 checking in your editor. Part of the
157162
test suite is checking PEP8 compliance, things go smoother if the code is
158163
mostly PEP8 compliant to begin with.
159164

160165
* Each high-level plotting function should have a simple example in
161-
the `Example` section of the docstring. This should be as simple as
166+
the ``Example`` section of the docstring. This should be as simple as
162167
possible to demonstrate the method. More complex examples should go
163-
in the `examples` tree.
168+
in the ``examples`` tree.
164169

165170
* Changes (both new features and bugfixes) should be tested. See
166171
:ref:`testing` for more details.
@@ -170,13 +175,12 @@ rules before submitting a pull request:
170175
import numpy as np
171176
import numpy.ma as ma
172177
import matplotlib as mpl
173-
from matplotlib import pyplot as plt
178+
import matplotlib.pyplot as plt
174179
import matplotlib.cbook as cbook
175-
import matplotlib.collections as mcol
176180
import matplotlib.patches as mpatches
177181

178-
* If your change is a major new feature, add an entry to `What's new`
179-
section by adding a new file in `doc/users/whats_new` (see
182+
* If your change is a major new feature, add an entry to the ``What's new``
183+
section by adding a new file in ``doc/users/whats_new`` (see
180184
:file:`doc/users/whats_new/README` for more information).
181185

182186
* If you change the API in a backward-incompatible way, please
@@ -205,7 +209,7 @@ tools:
205209

206210
The current state of the matplotlib code base is not compliant with all
207211
of those guidelines, but we expect that enforcing those constraints on all
208-
new contributions will get the overall code base quality in the right
212+
new contributions will move the overall code base quality in the right
209213
direction.
210214

211215

@@ -223,23 +227,14 @@ Issues for New Contributors
223227
---------------------------
224228

225229
New contributors should look for the following tags when looking for issues.
226-
We strongly recommend that new contributors tackle "new-contributor-friendly"
230+
We strongly recommend that new contributors tackle
231+
`new-contributor-friendly <https://github.com/matplotlib/matplotlib/labels/new-contributor-friendly>`_
227232
issues (easy, well documented issues, that do not require an understanding of
228-
the different submodules of matplotlib) and "Easy-fix" issues. This helps the
229-
contributor become familiar with the contribution workflow, and for the core
230-
devs to become acquainted with the contributor; besides which, we frequently
231-
underestimate how easy an issue is to solve!
232-
233-
.. topic:: new-contributor-friendly
234-
235-
A great way to start contributing to matplotlib is to pick an item from
236-
the list of
237-
`new-contributor-friendly <https://github.com/matplotlib/matplotlib/labels/new-contributor-friendly>`_
238-
in the issue tracker. Resolving these issues allow you to start
239-
contributing to the project without much prior knowledge. Your assistance
240-
in this area will be greatly appreciated by the more experienced
241-
developers as it helps free up their time to concentrate on other issues.
242-
233+
the different submodules of matplotlib) and
234+
`Easy-fix <https://github.com/matplotlib/matplotlib/labels/Difficulty%3A%20Easy>`_
235+
issues. This helps the contributor become familiar with the contribution
236+
workflow, and for the core devs to become acquainted with the contributor;
237+
besides which, we frequently underestimate how easy an issue is to solve!
243238

244239
.. _other_ways_to_contribute:
245240

@@ -266,7 +261,7 @@ New modules and files: installation
266261
-----------------------------------
267262

268263
* If you have added new files or directories, or reorganized existing
269-
ones, make sure the new files included in the match patterns in
264+
ones, make sure the new files are included in the match patterns in
270265
:file:`MANIFEST.in`, and/or in `package_data` in `setup.py`.
271266

272267
C/C++ extensions
@@ -277,9 +272,6 @@ C/C++ extensions
277272
* Code style should conform to PEP7 (understanding that PEP7 doesn't
278273
address C++, but most of its admonitions still apply).
279274

280-
* Interfacing with Python may be done either with the raw Python/C API
281-
or Cython.
282-
283275
* Python/C interface code should be kept separate from the core C/C++
284276
code. The interface code should be named `FOO_wrap.cpp` or
285277
`FOO_wrapper.cpp`.
@@ -296,7 +288,7 @@ Keyword argument processing
296288

297289
Matplotlib makes extensive use of ``**kwargs`` for pass-through
298290
customizations from one function to another. A typical example is in
299-
:func:`matplotlib.pylab.text`. The definition of the pylab text
291+
:func:`matplotlib.pyplot.text`. The definition of the pylab text
300292
function is a simple pass-through to
301293
:meth:`matplotlib.axes.Axes.text`::
302294

@@ -310,7 +302,7 @@ function is a simple pass-through to
310302
i.e., it just passes all ``args`` and ``kwargs`` on to
311303
:meth:`matplotlib.text.Text.__init__`::
312304

313-
# in axes.py
305+
# in axes/_axes.py
314306
def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
315307
t = Text(x=x, y=y, text=s, **kwargs)
316308

@@ -342,7 +334,7 @@ used locally and pass on the rest. For example, in
342334
local arguments and the rest are passed on as
343335
:meth:`~matplotlib.lines.Line2D` keyword arguments::
344336

345-
# in axes.py
337+
# in axes/_axes.py
346338
def plot(self, *args, **kwargs):
347339
scalex = kwargs.pop('scalex', True)
348340
scaley = kwargs.pop('scaley', True)
@@ -381,7 +373,7 @@ If you are working on a custom backend, the *backend* setting in
381373
:file:`matplotlibrc` (:ref:`customizing-matplotlib`) supports an
382374
external backend via the ``module`` directive. if
383375
:file:`my_backend.py` is a matplotlib backend in your
384-
:envvar:`PYTHONPATH`, you can set use it on one of several ways
376+
:envvar:`PYTHONPATH`, you can set it on one of several ways
385377

386378
* in matplotlibrc::
387379

doc/devel/portable_code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.. _portable_code:
33

44
=====================================================
5-
Developer's tips for writing code for python 2 and 3
5+
Developer's tips for writing code for Python 2 and 3
66
=====================================================
77

88
As of matplotlib 1.4, the `six <http://pythonhosted.org/six/>`_

doc/devel/testing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ customizations to the nose testing infrastructure are in
1010
:mod:`matplotlib.testing`. (There is other old testing cruft around,
1111
please ignore it while we consolidate our testing to these locations.)
1212

13-
.. _nose: http://nose.readthedocs.org/en/latest/
13+
.. _nose: https://nose.readthedocs.io/en/latest/
1414

1515
Requirements
1616
------------
1717

1818
The following software is required to run the tests:
1919

2020
- nose_, version 1.0 or later
21-
- `mock <http://www.voidspace.org.uk/python/mock/>`_, when running python
21+
- `mock <https://docs.python.org/dev/library/unittest.mock.html>`_, when running python
2222
versions < 3.3
23-
- `Ghostscript <http://pages.cs.wisc.edu/~ghost/>`_ (to render PDF
23+
- `Ghostscript <http://www.ghostscript.com/>`_ (to render PDF
2424
files)
2525
- `Inkscape <http://inkscape.org>`_ (to render SVG files)
2626

2727
Optionally you can install:
2828

2929
- `coverage <http://nedbatchelder.com/code/coverage/>`_ to collect coverage
3030
information
31-
- `pep8 <http://pep8.readthedocs.org/en/latest>`_ to test coding standards
31+
- `pep8 <http://pep8.readthedocs.io/en/latest>`_ to test coding standards
3232

3333
Building matplotlib for image comparison tests
3434
----------------------------------------------
@@ -103,7 +103,7 @@ matplotlib library function :func:`matplotlib.test`::
103103
pip install mock
104104

105105

106-
.. _`nosetest arguments`: http://nose.readthedocs.org/en/latest/usage.html
106+
.. _`nosetest arguments`: http://nose.readthedocs.io/en/latest/usage.html
107107

108108

109109
Writing a simple test

doc/faq/installing_faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Python.org Python
205205
^^^^^^^^^^^^^^^^^
206206

207207
Install pip following the `standard pip install instructions
208-
<http://pip.readthedocs.org/en/latest/installing.html>`_. For the impatient,
208+
<http://pip.readthedocs.io/en/latest/installing.html>`_. For the impatient,
209209
open a new Terminal.app window and::
210210

211211
curl -O https://bootstrap.pypa.io/get-pip.py

doc/faq/virtualenv_faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ to virtualenv when creating an environment. This adds all system wide packages
5353
to the virtual environment. However, this breaks the isolation between the
5454
virtual environment and the system install. Among other issues it results in
5555
hard to debug problems with system packages shadowing the environment packages.
56-
If you use `virtualenvwrapper <https://virtualenvwrapper.readthedocs.org/>`_
56+
If you use `virtualenvwrapper <https://virtualenvwrapper.readthedocs.io/>`_
5757
this can be toggled with the ``toggleglobalsitepackages`` command.
5858

5959
Alternatively, you can manually symlink the GUI frameworks into the environment.

doc/glossary/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Glossary
1616

1717

1818
dateutil
19-
The `dateutil <https://dateutil.readthedocs.org>`_ library
19+
The `dateutil <https://dateutil.readthedocs.io>`_ library
2020
provides extensions to the standard datetime module
2121

2222
EPS

lib/matplotlib/dates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
locators you create. See `pytz <http://pythonhosted.org/pytz/>`_ for
4040
information on :mod:`pytz` and timezone handling.
4141
42-
The `dateutil module <https://dateutil.readthedocs.org>`_ provides
42+
The `dateutil module <https://dateutil.readthedocs.io>`_ provides
4343
additional code to handle date ticking, making it easy to place ticks
4444
on any kinds of dates. See examples below.
4545
@@ -87,7 +87,7 @@
8787
:class:`matplotlib.dates.rrulewrapper`. The
8888
:class:`rrulewrapper` is a simple wrapper around a
8989
:class:`dateutil.rrule` (`dateutil
90-
<https://dateutil.readthedocs.org>`_) which allow almost
90+
<https://dateutil.readthedocs.io>`_) which allow almost
9191
arbitrary date tick specifications. See `rrule example
9292
<../examples/pylab_examples/date_demo_rrule.html>`_.
9393

0 commit comments

Comments
 (0)
0