Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 596627a

Browse files
committed
Fix highlighting of install docs.
Almost all code-blocks should be highlighted as shell, not python (most were already tagged so, but some were still mis-highlighted). The remaining python blocks are actually all doctests, and can thus use their own rst syntax.
1 parent b2e8b93 commit 596627a

File tree

2 files changed

+35
-42
lines changed

2 files changed

+35
-42
lines changed

‎doc/install/index.rst

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.. redirect-from:: /users/installing
22
.. redirect-from:: /users/installing/index
33

4+
.. highlight:: sh
5+
46
************
57
Installation
68
************
@@ -11,9 +13,7 @@ Install an official release
1113

1214
Matplotlib releases are available as wheel packages for macOS, Windows and
1315
Linux on `PyPI <https://pypi.org/project/matplotlib/>`_. Install it using
14-
``pip``:
15-
16-
.. code-block:: sh
16+
``pip``::
1717

1818
python -m pip install -U pip
1919
python -m pip install -U matplotlib
@@ -44,15 +44,11 @@ Various third-parties provide Matplotlib for their environments.
4444
Conda packages
4545
--------------
4646

47-
Matplotlib is available both via the *anaconda main channel*
48-
49-
.. code-block:: sh
47+
Matplotlib is available both via the *anaconda main channel* ::
5048

5149
conda install matplotlib
5250

53-
as well as via the *conda-forge community channel*
54-
55-
.. code-block:: sh
51+
as well as via the *conda-forge community channel* ::
5652

5753
conda install -c conda-forge matplotlib
5854

@@ -62,10 +58,8 @@ Python distributions
6258
Matplotlib is part of major Python distributions:
6359

6460
- `Anaconda <https://www.anaconda.com/>`_
65-
6661
- `ActiveState ActivePython
6762
<https://www.activestate.com/products/python/downloads/>`_
68-
6963
- `WinPython <https://winpython.github.io/>`_
7064

7165
Linux package manager
@@ -90,9 +84,7 @@ Matplotlib makes nightly development build wheels available on the
9084
`scientific-python-nightly-wheels Anaconda Cloud organization
9185
<https://anaconda.org/scientific-python-nightly-wheels>`_.
9286
These wheels can be installed with ``pip`` by specifying
93-
scientific-python-nightly-wheels as the package index to query:
94-
95-
.. code-block:: sh
87+
scientific-python-nightly-wheels as the package index to query::
9688

9789
python -m pip install \
9890
--upgrade \
@@ -143,8 +135,7 @@ Aspects of some behavioral defaults of the library can be configured via:
143135
environment_variables_faq.rst
144136

145137
Default plotting appearance and behavior can be configured via the
146-
:ref:`rcParams file <customizing-with-matplotlibrc-files>`
147-
138+
:ref:`rcParams file <customizing-with-matplotlibrc-files>`.
148139

149140
Dependencies
150141
============
@@ -266,13 +257,17 @@ at the Terminal.app command line::
266257

267258
python3 -c 'import matplotlib; print(matplotlib.__version__, matplotlib.__file__)'
268259

269-
You should see something like ::
260+
You should see something like
261+
262+
.. code-block:: none
270263
271264
3.10.0 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/matplotlib/__init__.py
272265
273266
where ``3.10.0`` is the Matplotlib version you just installed, and the path
274267
following depends on whether you are using Python.org Python, Homebrew or
275-
Macports. If you see another version, or you get an error like ::
268+
Macports. If you see another version, or you get an error like
269+
270+
.. code-block:: none
276271
277272
Traceback (most recent call last):
278273
File "<string>", line 1, in <module>

‎doc/install/troubleshooting_faq.inc.rst

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,23 @@ Obtaining Matplotlib version
1111
----------------------------
1212

1313
To find out your Matplotlib version number, import it and print the
14-
``__version__`` attribute::
15-
16-
>>> import matplotlib
17-
>>> matplotlib.__version__
18-
'0.98.0'
14+
``__version__`` attribute:
1915

16+
>>> import matplotlib
17+
>>> matplotlib.__version__
18+
'0.98.0'
2019

2120
.. _locating-matplotlib-install:
2221

2322
:file:`matplotlib` install location
2423
-----------------------------------
2524

2625
You can find what directory Matplotlib is installed in by importing it
27-
and printing the ``__file__`` attribute::
28-
29-
>>> import matplotlib
30-
>>> matplotlib.__file__
31-
'/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/__init__.pyc'
26+
and printing the ``__file__`` attribute:
3227

28+
>>> import matplotlib
29+
>>> matplotlib.__file__
30+
'/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/__init__.pyc'
3331

3432
.. _locating-matplotlib-config-dir:
3533

@@ -39,32 +37,32 @@ and printing the ``__file__`` attribute::
3937
Each user has a Matplotlib configuration directory which may contain a
4038
:ref:`matplotlibrc <customizing-with-matplotlibrc-files>` file. To
4139
locate your :file:`matplotlib/` configuration directory, use
42-
:func:`matplotlib.get_configdir`::
40+
:func:`matplotlib.get_configdir`:
4341

44-
>>> import matplotlib as mpl
45-
>>> mpl.get_configdir()
46-
'/home/darren/.config/matplotlib'
42+
>>> import matplotlib as mpl
43+
>>> mpl.get_configdir()
44+
'/home/darren/.config/matplotlib'
4745

4846
On Unix-like systems, this directory is generally located in your
4947
:envvar:`HOME` directory under the :file:`.config/` directory.
5048

5149
In addition, users have a cache directory. On Unix-like systems, this is
5250
separate from the configuration directory by default. To locate your
53-
:file:`.cache/` directory, use :func:`matplotlib.get_cachedir`::
51+
:file:`.cache/` directory, use :func:`matplotlib.get_cachedir`:
5452

55-
>>> import matplotlib as mpl
56-
>>> mpl.get_cachedir()
57-
'/home/darren/.cache/matplotlib'
53+
>>> import matplotlib as mpl
54+
>>> mpl.get_cachedir()
55+
'/home/darren/.cache/matplotlib'
5856

5957
On Windows, both the config directory and the cache directory are
6058
the same and are in your :file:`Documents and Settings` or :file:`Users`
61-
directory by default::
59+
directory by default:
6260

63-
>>> import matplotlib as mpl
64-
>>> mpl.get_configdir()
65-
'C:\\Documents and Settings\\jdhunter\\.matplotlib'
66-
>>> mpl.get_cachedir()
67-
'C:\\Documents and Settings\\jdhunter\\.matplotlib'
61+
>>> import matplotlib as mpl
62+
>>> mpl.get_configdir()
63+
'C:\\Documents and Settings\\jdhunter\\.matplotlib'
64+
>>> mpl.get_cachedir()
65+
'C:\\Documents and Settings\\jdhunter\\.matplotlib'
6866

6967
If you would like to use a different configuration directory, you can
7068
do so by specifying the location in your :envvar:`MPLCONFIGDIR`

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /