Skip to content

Commit 4007617

Browse files
DOC: migrate from sphinx-panels to sphinx-design (#46227)
* DOC: migrate from sphinx-panels to sphinx-design * update css for latest pydata-sphinx-theme * add sphinx-design to env * further fix css * Convert panels to grid, address warning, remove panel dependency * Try addressing failures * Fix css * Fix more css * Just use one comparison card class --------- Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 9dbe210 commit 4007617

File tree

7 files changed

+211
-167
lines changed

7 files changed

+211
-167
lines changed

doc/source/_static/css/getting_started.css

+20-4
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,21 @@ ul.task-bullet > li > p:first-child {
138138
margin: 0px;
139139
}
140140

141-
.comparison-card .card-img-top {
141+
.comparison-card .sd-card-img-top {
142142
margin: 10px;
143143
margin-bottom: 20px;
144-
height: 72px;
144+
height: 52px;
145145
background: none !important;
146146
}
147147

148-
.comparison-card-excel .card-img-top, .comparison-card-stata .card-img-top, .comparison-card-sas .card-img-top {
149-
height: 52px;
148+
.comparison-card .sd-btn-secondary {
149+
background-color: #6c757d !important;
150+
border-color: #6c757d !important;
151+
}
152+
153+
.comparison-card .sd-btn-secondary:hover {
154+
background-color: #5a6268 !important;
155+
border-color: #545b62 !important;
150156
}
151157

152158
.comparison-card .card-footer {
@@ -178,6 +184,16 @@ ul.task-bullet > li > p:first-child {
178184
margin: 0 1em 1em 1em;
179185
}
180186

187+
.install-card .sd-btn-secondary {
188+
background-color: #6c757d !important;
189+
border-color: #6c757d !important;
190+
}
191+
192+
.install-card .sd-btn-secondary:hover {
193+
background-color: #5a6268 !important;
194+
border-color: #545b62 !important;
195+
}
196+
181197
.custom-button {
182198
background-color:#DCDCDC;
183199
border: none;

doc/source/_static/css/pandas.css

+17-18
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,41 @@ table {
1212
/* Main index page overview cards */
1313

1414
.intro-card {
15-
background: #fff;
16-
border-radius: 0;
1715
padding: 30px 10px 20px 10px;
18-
margin: 10px 0px;
1916
}
2017

21-
.intro-card p.card-text {
22-
margin: 0px;
23-
}
24-
25-
.intro-card .card-img-top {
18+
.intro-card .sd-card-img-top {
2619
margin: 10px;
2720
height: 52px;
2821
background: none !important;
2922
}
3023

31-
.intro-card .card-header {
32-
border: none;
33-
background-color: transparent;
34-
color: #150458 !important;
24+
.intro-card .sd-card-title {
25+
color: var(--pst-color-primary);
3526
font-size: var(--pst-font-size-h5);
36-
font-weight: bold;
37-
padding: 2.5rem 0rem 0.5rem 0rem;
27+
padding: 1rem 0rem 0.5rem 0rem;
3828
}
3929

40-
.intro-card .card-footer {
41-
border: none;
42-
background-color: transparent;
30+
.intro-card .sd-card-footer {
31+
border: none !important;
4332
}
4433

45-
.intro-card .card-footer p.card-text{
34+
.intro-card .sd-card-footer p.sd-card-text {
4635
max-width: 220px;
4736
margin-left: auto;
4837
margin-right: auto;
4938
}
5039

40+
.intro-card .sd-btn-secondary {
41+
background-color: #6c757d !important;
42+
border-color: #6c757d !important;
43+
}
44+
45+
.intro-card .sd-btn-secondary:hover {
46+
background-color: #5a6268 !important;
47+
border-color: #545b62 !important;
48+
}
49+
5150
.card, .card img {
5251
background-color: var(--pst-color-background);
5352
}

doc/source/conf.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"matplotlib.sphinxext.plot_directive",
5757
"numpydoc",
5858
"sphinx_copybutton",
59-
"sphinx_panels",
59+
"sphinx_design",
6060
"sphinx_toggleprompt",
6161
"sphinx.ext.autodoc",
6262
"sphinx.ext.autosummary",
@@ -143,10 +143,6 @@
143143
# nbsphinx do not use requirejs (breaks bootstrap)
144144
nbsphinx_requirejs_path = ""
145145

146-
# sphinx-panels shouldn't add bootstrap css since the pydata-sphinx-theme
147-
# already loads it
148-
panels_add_bootstrap_css = False
149-
150146
# https://sphinx-toggleprompt.readthedocs.io/en/stable/#offset
151147
toggleprompt_offset_right = 35
152148

@@ -467,7 +463,7 @@
467463

468464
# extlinks alias
469465
extlinks = {
470-
"issue": ("https://github.com/pandas-dev/pandas/issues/%s", "GH"),
466+
"issue": ("https://github.com/pandas-dev/pandas/issues/%s", "GH %s"),
471467
}
472468

473469

doc/source/getting_started/index.rst

+111-87
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,53 @@ Getting started
99
Installation
1010
------------
1111

12-
.. panels::
13-
:card: + install-card
14-
:column: col-lg-6 col-md-6 col-sm-12 col-xs-12 p-3
12+
.. grid:: 1 2 2 2
13+
:gutter: 4
1514

16-
Working with conda?
17-
^^^^^^^^^^^^^^^^^^^
15+
.. grid-item-card:: Working with conda?
16+
:class-card: install-card
17+
:columns: 12 12 6 6
18+
:padding: 3
1819

19-
pandas is part of the `Anaconda <https://docs.continuum.io/anaconda/>`__
20-
distribution and can be installed with Anaconda or Miniconda:
20+
pandas is part of the `Anaconda <https://docs.continuum.io/anaconda/>`__
21+
distribution and can be installed with Anaconda or Miniconda:
2122

22-
++++++++++++++++++++++
23+
++++++++++++++++++++++
2324

24-
.. code-block:: bash
25+
.. code-block:: bash
2526
26-
conda install pandas
27+
conda install pandas
2728
28-
---
29+
.. grid-item-card:: Prefer pip?
30+
:class-card: install-card
31+
:columns: 12 12 6 6
32+
:padding: 3
2933

30-
Prefer pip?
31-
^^^^^^^^^^^
34+
pandas can be installed via pip from `PyPI <https://pypi.org/project/pandas>`__.
3235

33-
pandas can be installed via pip from `PyPI <https://pypi.org/project/pandas>`__.
36+
++++
3437

35-
++++
38+
.. code-block:: bash
3639
37-
.. code-block:: bash
40+
pip install pandas
3841
39-
pip install pandas
42+
.. grid-item-card:: In-depth instructions?
43+
:class-card: install-card
44+
:columns: 12
45+
:padding: 3
4046

41-
---
42-
:column: col-12 p-3
47+
Installing a specific version? Installing from source? Check the advanced
48+
installation page.
4349

44-
In-depth instructions?
45-
^^^^^^^^^^^^^^^^^^^^^^
50+
+++
4651

47-
Installing a specific version? Installing from source? Check the advanced
48-
installation page.
52+
.. button-ref:: install
53+
:ref-type: ref
54+
:click-parent:
55+
:color: secondary
56+
:expand:
4957

50-
.. link-button:: ./install.html
51-
:type: url
52-
:text: Learn more
53-
:classes: btn-secondary stretched-link
58+
Learn more
5459

5560

5661
.. _gentle_intro:
@@ -536,91 +541,110 @@ Coming from...
536541
Are you familiar with other software for manipulating tabular data? Learn
537542
the pandas-equivalent operations compared to software you already know:
538543

539-
.. panels::
540-
:img-top-cls: dark-light
541-
:card: + comparison-card text-center shadow
542-
:column: col-lg-6 col-md-6 col-sm-6 col-xs-12 d-flex
544+
.. grid:: 1 2 2 2
545+
:gutter: 4
546+
:class-container: sd-text-center sd-d-inline-flex
543547

544-
---
545-
:card: + comparison-card-r
546-
:img-top: ../_static/logo_r.svg
548+
.. grid-item-card::
549+
:img-top: ../_static/logo_r.svg
550+
:columns: 12 6 6 6
551+
:class-card: comparison-card
552+
:shadow: md
547553

548-
The `R programming language <https://www.r-project.org/>`__ provides the
549-
``data.frame`` data structure and multiple packages, such as
550-
`tidyverse <https://www.tidyverse.org>`__ use and extend ``data.frame``
551-
for convenient data handling functionalities similar to pandas.
554+
The `R programming language <https://www.r-project.org/>`__ provides the
555+
``data.frame`` data structure and multiple packages, such as
556+
`tidyverse <https://www.tidyverse.org>`__ use and extend ``data.frame``
557+
for convenient data handling functionalities similar to pandas.
552558

553-
+++
559+
+++
554560

555-
.. link-button:: compare_with_r
556-
:type: ref
557-
:text: Learn more
558-
:classes: btn-secondary stretched-link
561+
.. button-ref:: compare_with_r
562+
:ref-type: ref
563+
:click-parent:
564+
:color: secondary
565+
:expand:
559566

567+
Learn more
560568

561-
---
562-
:card: + comparison-card-sql
563-
:img-top: ../_static/logo_sql.svg
569+
.. grid-item-card::
570+
:img-top: ../_static/logo_sql.svg
571+
:columns: 12 6 6 6
572+
:class-card: comparison-card
573+
:shadow: md
564574

565-
Already familiar to ``SELECT``, ``GROUP BY``, ``JOIN``, etc.?
566-
Most of these SQL manipulations do have equivalents in pandas.
575+
Already familiar to ``SELECT``, ``GROUP BY``, ``JOIN``, etc.?
576+
Most of these SQL manipulations do have equivalents in pandas.
567577

568-
+++
578+
+++
569579

570-
.. link-button:: compare_with_sql
571-
:type: ref
572-
:text: Learn more
573-
:classes: btn-secondary stretched-link
580+
.. button-ref:: compare_with_sql
581+
:ref-type: ref
582+
:click-parent:
583+
:color: secondary
584+
:expand:
574585

586+
Learn more
575587

576-
---
577-
:card: + comparison-card-stata
578-
:img-top: ../_static/logo_stata.svg
588+
.. grid-item-card::
589+
:img-top: ../_static/logo_stata.svg
590+
:columns: 12 6 6 6
591+
:class-card: comparison-card
592+
:shadow: md
579593

580-
The ``data set`` included in the `STATA <https://en.wikipedia.org/wiki/Stata>`__
581-
statistical software suite corresponds to the pandas ``DataFrame``.
582-
Many of the operations known from STATA have an equivalent in pandas.
594+
The ``data set`` included in the `STATA <https://en.wikipedia.org/wiki/Stata>`__
595+
statistical software suite corresponds to the pandas ``DataFrame``.
596+
Many of the operations known from STATA have an equivalent in pandas.
583597

584-
+++
598+
+++
585599

586-
.. link-button:: compare_with_stata
587-
:type: ref
588-
:text: Learn more
589-
:classes: btn-secondary stretched-link
600+
.. button-ref:: compare_with_stata
601+
:ref-type: ref
602+
:click-parent:
603+
:color: secondary
604+
:expand:
590605

606+
Learn more
591607

592-
---
593-
:card: + comparison-card-excel
594-
:img-top: ../_static/spreadsheets/logo_excel.svg
608+
.. grid-item-card::
609+
:img-top: ../_static/spreadsheets/logo_excel.svg
610+
:columns: 12 6 6 6
611+
:class-card: comparison-card
612+
:shadow: md
595613

596-
Users of `Excel <https://en.wikipedia.org/wiki/Microsoft_Excel>`__
597-
or other spreadsheet programs will find that many of the concepts are
598-
transferrable to pandas.
614+
Users of `Excel <https://en.wikipedia.org/wiki/Microsoft_Excel>`__
615+
or other spreadsheet programs will find that many of the concepts are
616+
transferrable to pandas.
599617

600-
+++
618+
+++
601619

602-
.. link-button:: compare_with_spreadsheets
603-
:type: ref
604-
:text: Learn more
605-
:classes: btn-secondary stretched-link
620+
.. button-ref:: compare_with_spreadsheets
621+
:ref-type: ref
622+
:click-parent:
623+
:color: secondary
624+
:expand:
606625

626+
Learn more
607627

608-
---
609-
:card: + comparison-card-sas
610-
:img-top: ../_static/logo_sas.svg
628+
.. grid-item-card::
629+
:img-top: ../_static/logo_sas.svg
630+
:columns: 12 6 6 6
631+
:class-card: comparison-card
632+
:shadow: md
611633

612-
The `SAS <https://en.wikipedia.org/wiki/SAS_(software)>`__ statistical software suite
613-
also provides the ``data set`` corresponding to the pandas ``DataFrame``.
614-
Also SAS vectorized operations, filtering, string processing operations,
615-
and more have similar functions in pandas.
634+
The `SAS <https://en.wikipedia.org/wiki/SAS_(software)>`__ statistical software suite
635+
also provides the ``data set`` corresponding to the pandas ``DataFrame``.
636+
Also SAS vectorized operations, filtering, string processing operations,
637+
and more have similar functions in pandas.
616638

617-
+++
639+
+++
618640

619-
.. link-button:: compare_with_sas
620-
:type: ref
621-
:text: Learn more
622-
:classes: btn-secondary stretched-link
641+
.. button-ref:: compare_with_sas
642+
:ref-type: ref
643+
:click-parent:
644+
:color: secondary
645+
:expand:
623646

647+
Learn more
624648

625649
Tutorials
626650
---------

0 commit comments

Comments
 (0)