Skip to content

Commit

Permalink
DOC: Proposal - make the doc landing page cards more similar to scipy…
Browse files Browse the repository at this point in the history
…/pandas (#21491)

* DOC: Add panel elements to index matching scipy/pandas.

* DOC: Update card styling in css to match scipy/pandas.

* DOC: Add release notes to nav bar.

* DOC: replace css in layout with html_css_files conf val.

* DOC: Fix page layout.

Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu>

Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu>
  • Loading branch information
2 people authored and charris committed May 15, 2022
1 parent ff353e3 commit 8146afc
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 20 deletions.
40 changes: 40 additions & 0 deletions doc/source/_static/numpy.css
Expand Up @@ -32,3 +32,43 @@ h3 {
color: #013243; /* warm black */
letter-spacing: -.03em;
}

/* Main page overview cards */

.intro-card {
background: #fff;
border-radius: 0;
padding: 30px 10px 20px 10px;
margin: 10px 0px;
}

.intro-card p.card-text {
margin: 0px;
}

.intro-card .card-img-top {
height: 52px;
width: 52px;
margin-left: auto;
margin-right: auto;
}

.intro-card .card-header {
border: none;
background-color: white;
color: #150458 !important;
font-size: var(--pst-font-size-h5);
font-weight: bold;
padding: 2.5rem 0rem 0.5rem 0rem;
}

.intro-card .card-footer {
border: none;
background-color: white;
}

.intro-card .card-footer p.card-text {
max-width: 220px;
margin-left: auto;
margin-right: auto;
}
10 changes: 0 additions & 10 deletions doc/source/_templates/layout.html

This file was deleted.

5 changes: 5 additions & 0 deletions doc/source/conf.py
Expand Up @@ -184,6 +184,11 @@ def setup(app):
html_title = "%s v%s Manual" % (project, version)
html_static_path = ['_static']
html_last_updated_fmt = '%b %d, %Y'
html_css_files = ["numpy.css"]

# Prevent sphinx-panels from loading bootstrap css, the pydata-sphinx-theme
# already loads it
panels_add_bootstrap_css = False

html_use_modindex = True
html_copy_source = False
Expand Down
29 changes: 19 additions & 10 deletions doc/source/index.rst
Expand Up @@ -11,6 +11,7 @@ NumPy documentation
User Guide <user/index>
API reference <reference/index>
Development <dev/index>
release


**Version**: |version|
Expand All @@ -35,7 +36,7 @@ basic statistical operations, random simulation and much more.

.. panels::
:card: + intro-card text-center
:column: col-lg-6 col-md-6 col-sm-6 col-xs-12 p-2
:column: col-lg-6 col-md-6 col-sm-6 col-xs-12 d-flex

---
:img-top: ../source/_static/index-images/getting_started.svg
Expand All @@ -46,10 +47,12 @@ basic statistical operations, random simulation and much more.
New to NumPy? Check out the Absolute Beginner's Guide. It contains an
introduction to NumPy's main concepts and links to additional tutorials.

+++

.. link-button:: user/absolute_beginners
:type: ref
:text:
:classes: stretched-link
:text: To the absolute beginner's guide
:classes: btn-block btn-secondary stretched-link

---
:img-top: ../source/_static/index-images/user_guide.svg
Expand All @@ -60,10 +63,12 @@ basic statistical operations, random simulation and much more.
The user guide provides in-depth information on the
key concepts of NumPy with useful background information and explanation.

+++

.. link-button:: user
:type: ref
:text:
:classes: stretched-link
:text: To the user guide
:classes: btn-block btn-secondary stretched-link

---
:img-top: ../source/_static/index-images/api.svg
Expand All @@ -76,25 +81,29 @@ basic statistical operations, random simulation and much more.
methods work and which parameters can be used. It assumes that you have an
understanding of the key concepts.

+++

.. link-button:: reference
:type: ref
:text:
:classes: stretched-link
:text: To the reference guide
:classes: btn-block btn-secondary stretched-link

---
:img-top: ../source/_static/index-images/contributor.svg

Contributor's Guide
^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^

Want to add to the codebase? Can help add translation or a flowchart to the
documentation? The contributing guidelines will guide you through the
process of improving NumPy.

+++

.. link-button:: devindex
:type: ref
:text:
:classes: stretched-link
:text: To the contributor's guide
:classes: btn-block btn-secondary stretched-link

.. This is not really the index page, that is found in
_templates/indexcontent.html The toctree content here will be added to the
Expand Down

0 comments on commit 8146afc

Please sign in to comment.