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

Skip to content

Commit 20f5034

Browse files
authored
Merge pull request #23169 from QuLogic/sphinx-design
DOC: Migrate to sphinx-design
2 parents af83578 + 8954dfc commit 20f5034

File tree

8 files changed

+86
-94
lines changed

8 files changed

+86
-94
lines changed

doc/_static/mpl.css

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
:root {
2+
--sd-color-primary: #11557C;
3+
--sd-color-primary-highlight: #003c63;
4+
}
5+
16
a {
27
color: #11557C;
38
text-decoration: none;
@@ -174,29 +179,6 @@ hr.box-sep {
174179
font-size: 1.0em;
175180
}
176181

177-
178-
.mpl-button {
179-
background: #11557C;
180-
font-weight: normal;
181-
display: inline-block;
182-
padding: 0 1em;
183-
line-height: 2.8;
184-
font-size: 16px;
185-
text-align: center;
186-
cursor: pointer;
187-
color: #fff;
188-
text-decoration: none;
189-
border-radius: 6px;
190-
z-index: 1;
191-
transition: background .25s ease;
192-
}
193-
194-
.mpl-button:hover, .mpl-button:active, .mpl-button:focus {
195-
background: #003c63;
196-
outline-color: #003c63;
197-
}
198-
199-
200182
/* Hide red ¶ between the thumbnail and caption in gallery
201183
202184
Due the way that sphinx-gallery floats its captions the perma-link
@@ -251,25 +233,6 @@ table.property-table td {
251233
margin: 2.75rem 0;
252234
}
253235

254-
.sidebar-donate .mpl-button {
255-
/* fix width to width of cheatsheet */
256-
width: 210px;
257-
}
258-
259-
/* Two columns for install code blocks */
260-
div.twocol {
261-
padding-left: 0;
262-
padding-right: 0;
263-
display: flex;
264-
gap: 20px;
265-
}
266-
267-
div.twocol > div {
268-
flex-grow: 1;
269-
padding: 0;
270-
margin: 0;
271-
}
272-
273236
/* Fix selection of parameter names; remove when fixed in the theme
274237
* https://github.com/sphinx-doc/sphinx/pull/9763
275238
*/

doc/_templates/donate_sidebar.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
2-
3-
41
<div class="sidebar-donate">
5-
<a href="https://numfocus.org/donate-to-matplotlib" target="_blank">
6-
<span class="mpl-button" >Support Matplotlib</span>
2+
<a class="sd-btn sd-btn-primary sd-fs-5 sd-px-5 sd-py-2" href="https://numfocus.org/donate-to-matplotlib" target="_blank">
3+
Support Matplotlib
74
</a>
85
</div>

doc/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,13 @@
7272
'sphinxext.skip_deprecated',
7373
'sphinxext.redirect_from',
7474
'sphinx_copybutton',
75-
'sphinx_panels',
75+
'sphinx_design',
7676
]
7777

7878
exclude_patterns = [
7979
'api/prev_api_changes/api_changes_*/*',
8080
]
8181

82-
panels_add_bootstrap_css = False
83-
8482

8583
def _check_dependencies():
8684
names = {

doc/devel/index.rst

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,37 @@ process or how to fix something feel free to ask on `gitter
1919
<https://gitter.im/matplotlib/matplotlib>`_ for short questions and on
2020
`discourse <https://discourse.matplotlib.org>`_ for longer questions.
2121

22-
.. raw:: html
23-
24-
<div style="margin: 2em 0;">
25-
<a href="contributing.html#submitting-a-bug-report"><span class="mpl-button">Report a bug</span></a>
26-
<a href="contributing.html#request-a-new-feature"><span class="mpl-button">Request a feature</span></a>
27-
<a href="contributing.html#contributing-code"><span class="mpl-button">Contribute code</span></a>
28-
<a href="contributing.html#contributing-documentation"><span class="mpl-button">Write documentation</span></a>
29-
</div>
22+
.. rst-class:: sd-d-inline-block
23+
24+
.. button-ref:: submitting-a-bug-report
25+
:class: sd-fs-6
26+
:color: primary
27+
28+
Report a bug
29+
30+
.. rst-class:: sd-d-inline-block
31+
32+
.. button-ref:: request-a-new-feature
33+
:class: sd-fs-6
34+
:color: primary
35+
36+
Request a feature
37+
38+
.. rst-class:: sd-d-inline-block
39+
40+
.. button-ref:: contributing-code
41+
:class: sd-fs-6
42+
:color: primary
43+
44+
Contribute code
45+
46+
.. rst-class:: sd-d-inline-block
47+
48+
.. button-ref:: contributing_documentation
49+
:class: sd-fs-6
50+
:color: primary
51+
52+
Write documentation
3053

3154
.. toctree::
3255
:maxdepth: 2

doc/index.rst

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ and interactive visualizations in Python.
1616
Installation
1717
************
1818

19-
.. container:: twocol
19+
.. grid:: 1 1 2 2
2020

21-
.. container::
21+
.. grid-item::
2222

2323
Install using `pip <https://pypi.org/project/matplotlib>`__:
2424

2525
.. code-block:: bash
2626
2727
pip install matplotlib
2828
29-
.. container::
29+
.. grid-item::
3030

3131
Install using `conda <https://docs.continuum.io/anaconda/>`__:
3232

@@ -41,46 +41,57 @@ Further details are available in the :doc:`Installation Guide <users/installing/
4141
Learning resources
4242
******************
4343

44-
.. panels::
44+
.. grid:: 1 1 2 2
4545

46-
Tutorials
47-
^^^^^^^^^
46+
.. grid-item-card::
47+
:class-header: sd-bg-light
48+
:padding: 2
4849

49-
- :doc:`Quick-start guide <tutorials/introductory/quick_start>`
50-
- :doc:`Plot types <plot_types/index>`
51-
- `Introductory tutorials <../tutorials/index.html#introductory>`_
52-
- :doc:`External learning resources <users/resources/index>`
50+
Tutorials
51+
^^^
5352

54-
---
53+
- :doc:`Quick-start guide <tutorials/introductory/quick_start>`
54+
- :doc:`Plot types <plot_types/index>`
55+
- `Introductory tutorials <../tutorials/index.html#introductory>`_
56+
- :doc:`External learning resources <users/resources/index>`
5557

56-
How-tos
57-
^^^^^^^
58-
- :doc:`Example gallery <gallery/index>`
59-
- :doc:`Matplotlib FAQ <users/faq/index>`
58+
.. grid-item-card::
59+
:class-header: sd-bg-light
60+
:padding: 2
6061

61-
---
62+
How-tos
63+
^^^
6264

63-
Understand how Matplotlib works
64-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65+
- :doc:`Example gallery <gallery/index>`
66+
- :doc:`Matplotlib FAQ <users/faq/index>`
6567

66-
- The :ref:`users-guide-explain` in the :doc:`Users guide <users/index>`
67-
- Many of the :ref:`Intermediate <tutorials-intermediate>` and
68-
:ref:`Advanced <tutorials-advanced>` tutorials
69-
have explanatory material
68+
.. grid-item-card::
69+
:class-header: sd-bg-light
70+
:padding: 2
7071

71-
---
72+
Understand how Matplotlib works
73+
^^^
7274

73-
Reference
74-
^^^^^^^^^
75+
- The :ref:`users-guide-explain` in the :doc:`Users guide
76+
<users/index>`
77+
- Many of the :ref:`Intermediate <tutorials-intermediate>` and
78+
:ref:`Advanced <tutorials-advanced>` tutorials have explanatory
79+
material
7580

76-
- :doc:`API Reference <api/index>`
77-
- :doc:`Axes API <api/axes_api>` for most plotting methods
78-
- :doc:`Figure API <api/figure_api>` for figure-level methods
79-
- Top-level interfaces to create:
81+
.. grid-item-card::
82+
:class-header: sd-bg-light
83+
:padding: 2
8084

81-
- Figures (`.pyplot.figure`)
82-
- Subplots (`.pyplot.subplots`, `.pyplot.subplot_mosaic`)
85+
Reference
86+
^^^
8387

88+
- :doc:`API Reference <api/index>`
89+
- :doc:`Axes API <api/axes_api>` for most plotting methods
90+
- :doc:`Figure API <api/figure_api>` for figure-level methods
91+
- Top-level interfaces to create:
92+
93+
- Figures (`.pyplot.figure`)
94+
- Subplots (`.pyplot.subplots`, `.pyplot.subplot_mosaic`)
8495

8596

8697
********************

doc/users/getting_started/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ Getting started
44
Installation quick-start
55
------------------------
66

7-
.. container:: twocol
7+
.. grid:: 1 1 2 2
88

9-
.. container::
9+
.. grid-item::
1010

1111
Install using `pip <https://pypi.org/project/matplotlib>`__:
1212

1313
.. code-block:: bash
1414
1515
pip install matplotlib
1616
17-
.. container::
17+
.. grid-item::
1818

1919
Install using `conda <https://docs.continuum.io/anaconda/>`__:
2020

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies:
3333
- sphinx>=1.8.1,!=2.0.0
3434
- sphinx-copybutton
3535
- sphinx-gallery>=0.10
36-
- sphinx-panels
36+
- sphinx-design
3737
- pip
3838
- pip:
3939
- mpl-sphinx-theme

requirements/doc/doc-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ mpl-sphinx-theme
1818
sphinxcontrib-svg2pdfconverter>=1.1.0
1919
sphinx-gallery>=0.10
2020
sphinx-copybutton
21-
sphinx-panels
21+
sphinx-design

0 commit comments

Comments
 (0)