8000 Merge pull request #17074 from mattip/pydata-sphinx-theme · numpy/numpy@60f9c61 · GitHub
[go: up one dir, main page]

Skip to content

Commit 60f9c61

Browse files
authored
Merge pull request #17074 from mattip/pydata-sphinx-theme
DOC: use the pydata_sphinx_theme
2 parents 5481120 + 48de200 commit 60f9c61

File tree

10 files changed

+85
-167
lines changed

10 files changed

+85
-167
lines changed

.circleci/config.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ jobs:
1616
- checkout
1717

1818
- run:
19-
name: install dependencies
19+
name: create virtual environment, install dependencies
2020
command: |
2121
python3 -m venv venv
2222
ln -s $(which python3) venv/bin/python3.6
2323
. venv/bin/activate
24-
pip install cython sphinx==2.3.1 matplotlib ipython
2524
sudo apt-get update
2625
sudo apt-get install -y graphviz texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra texlive-generic-extra latexmk texlive-xetex
2726
@@ -30,10 +29,9 @@ jobs:
3029
command: |
3130
. venv/bin/activate
3231
pip install --upgrade pip 'setuptools<49.2.0'
33-
pip install cython
32+
pip install -r test_requirements.txt
3433
pip install .
35-
pip install scipy
36-
pip install pandas
34+
pip install -r doc_requirements.txt
3735
3836
- run:
3937
name: create release notes
@@ -69,8 +67,8 @@ jobs:
6967
path: doc/build/html/
7068

7169

72-
# - store_artifacts:
73-
# path: doc/neps/_build/html/
70+
- store_artifacts:
71+
path: doc/neps/_build/html/
7472
# destination: neps
7573

7674
- add_ssh_keys:

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "doc/scipy-sphinx-theme"]
2-
path = doc/scipy-sphinx-theme
3-
url = https://github.com/scipy/scipy-sphinx-theme.git
41
[submodule "doc/sphinxext"]
52
path = doc/sphinxext
63
url = https://github.com/numpy/numpydoc.git

doc/neps/conf.py

Lines changed: 15 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545 6DB6
source_suffix = '.rst'
4646

4747
# The master toctree document.
48-
master_doc = 'index'
48+
master_doc = 'content'
4949

5050
# General information about the project.
5151
project = u'NumPy Enhancement Proposals'
@@ -82,69 +82,21 @@
8282

8383
## -- Options for HTML output ----------------------------------------------
8484
#
85-
## The theme to use for HTML and HTML Help pages. See the documentation for
86-
## a list of builtin themes.
87-
##
88-
#html_theme = 'alabaster'
89-
#
90-
## Theme options are theme-specific and customize the look and feel of a theme
91-
## further. For a list of options available for each theme, see the
92-
## documentation.
93-
##
94-
## html_theme_options = {}
95-
#
96-
## Add any paths that contain custom static files (such as style sheets) here,
97-
## relative to this directory. They are copied after the builtin static files,
98-
## so a file named "default.css" will overwrite the builtin "default.css".
99-
#html_static_path = ['_static']
100-
#
101-
## Custom sidebar templates, must be a dictionary that maps document names
102-
## to template names.
103-
##
104-
## This is required for the alabaster theme
105-
## refs: https://alabaster.readthedocs.io/en/latest/installation.html#sidebars
106-
#html_sidebars = {
107-
# '**': [
108-
# 'relations.html', # needs 'show_related': True theme option to display
109-
# 'searchbox.html',
110-
# ]
111-
#}
112-
113-
## -----------------------------------------------------------------------------
114-
# HTML output
115-
# -----------------------------------------------------------------------------
11685

117-
themedir = os.path.join(os.pardir, 'scipy-sphinx-theme', '_theme')
118-
if not os.path.isdir(themedir):
119-
raise RuntimeError("Get the scipy-sphinx-theme first, "
120-
"via git submodule init && git submodule update")
121-
122-
html_theme = 'scipy'
123-
html_theme_path = [themedir]
124-
125-
#if 'scipyorg' in tags:
126-
if True:
127-
# Build for the scipy.org website
128-
html_theme_options = {
129-
"edit_link": True,
130-
"sidebar": "right",
131-
"scipy_org_logo": True,
132-
"rootlinks": [("https://scipy.org/", "Scipy.org"),
133-
("https://docs.scipy.org/", "Docs")]
134-
}
135-
else:
136-
# Default build
137-
html_theme_options = {
138-
"edit_link": False,
139-
"sidebar": "left",
140-
"scipy_org_logo": False,
141-
"rootlinks": []
142-
}
143-
html_sidebars = {'index': 'indexsidebar.html'}
144-
145-
#html_additional_pages = {
146-
# 'index': 'indexcontent.html',
147-
#}
86+
html_theme = 'pydata_sphinx_theme'
87+
88+
html_logo = '../source/_static/numpylogo.svg'
89+
90+
html_theme_options = {
91+
"github_url": "https://github.com/numpy/numpy",
92+
"twitter_url": "https://twitter.com/numpy_team",
93+
"external_links": [
94+
{"name": "Wishlist",
95+
"url": "https://github.com/numpy/numpy/issues?q=is%3Aopen+is%3Aissue+label%3A%2223+-+Wish+List%22",
96+
},
97+
],
98+
"show_prev_next": False,
99+
}
148100

149101
html_title = "%s" % (project)
150102
html_static_path = ['../source/_static']

doc/neps/content.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
=====================================
2+
Roadmap & NumPy Enhancement Proposals
3+
=====================================
4+
5+
This page provides an overview of development priorities for NumPy.
6+
Specifically, it contains a roadmap with a higher-level overview, as
7+
well as NumPy Enhancement Proposals (NEPs)—suggested changes
8+
to the library—in various stages of discussion or completion (see `NEP
9+
0 <nep-0000>`__).
10+
11+
Roadmap
12+
-------
13+
.. toctree::
14+
:maxdepth: 1
15+
16+
Index <index>
17+
The Scope of NumPy <scope>
18+
Current roadmap <roadmap>
19+
Wishlist (opens new window) |wishlist_link|
20+
21+
.. |wishlist_link| raw:: html
22+
23+
<a href="https://github.com/numpy/numpy/issues?q=is%3Aopen+is%3Aissue+label%3A%2223+-+Wish+List%22" target=" blank">WishList</a>
24+
25+

doc/scipy-sphinx-theme

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/source/_templates/layout.html

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,12 @@
22

33
{%- block extrahead %}
44
<style>
5-
.main {
6-
-moz-box-shadow: none;
7-
-webkit-box-shadow: none;
8-
box-shadow: none;
9-
}
10-
div.top-scipy-org-logo-header {
11-
background-color: #fafafa;
12-
border-bottom: 2px solid #013243; /* Warm Black */
13-
margin-top: 0;
14-
box-shadow: none;
15-
}
16-
div.top-scipy-org-logo-header img {
17-
height: 100px;
18-
padding-left: 27px;
19-
}
20-
div.spc-navbar .nav-pills > li > a {
21-
background-color: #4d77cf; /* Han Blue */
22-
}
5+
.navbar-brand img {
6+
height: 75px;
7+
}
8+
.navbar-brand {
9+
height: 75px;
10+
}
2311
</style>
2412
{{ super() }}
2513
{% endblock %}
26-
27-
{%- block header %}
28-
<div class="container">
29-
<div class="top-scipy-org-logo-header">
30-
<a href="{{ pathto('index') }}">
31-
<img border=0 alt="NumPy" src="{{ pathto('_static/numpylogo.svg', 1) }}">
32-
</a>
33-
</div>
34-
</div>
35-
36-
{% endblock %}
37-
{% block rootrellink %}
38-
{% if pagename != 'index' %}
39-
<li class="active"><a href="{{ pathto('index') }}">{{ shorttitle|e }}</a></li>
40-
{% endif %}
41-
{% endblock %}
42-
43-
{% block sidebarsearch %}
44-
{%- if sourcename %}
45-
<ul class="this-page-menu">
46-
{%- if 'reference/generated' in sourcename %}
47-
<li><a href="/numpy/docs/{{ sourcename.replace('reference/generated/', '').replace('.txt', '') |e }}">{{_('Edit page')}}</a></li>
48-
{%- else %}
49-
<li><a href="/numpy/docs/numpy-docs/{{ sourcename.replace('.txt', '.rst') |e }}">{{_('Edit page')}}</a></li>
50-
{%- endif %}
51-
</ul>
52-
{%- endif %}
53-
{{ super() }}
54-
{% endblock %}

doc/source/conf.py

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -94,34 +94,15 @@ def setup(app):
9494
# HTML output
9595
# -----------------------------------------------------------------------------
9696

97-
themedir = os.path.join(os.pardir, 'scipy-sphinx-theme', '_theme')
98-
if not os.path.isdir(themedir):
99-
raise RuntimeError("Get the scipy-sphinx-theme first, "
100-
"via git submodule init && git submodule update")
101-
102-
html_theme = 'scipy'
103-
html_theme_path = [themedir]
104-
105-
if 'scipyorg' in tags:
106-
# Build for the scipy.org website
107-
html_theme_options = {
108-
"edit_link": True,
109-
"sidebar": "right",
110-
"scipy_org_logo": True,
111-
"rootlinks": [("https://scipy.org/", "Scipy.org"),
112-
("https://docs.scipy.org/", "Docs")]
113-
}
114-
else:
115-
# Default build
116-
html_theme_options = {
117-
"edit_link": False,
118-
"sidebar": "left",
119-
"scipy_org_logo": False,
120-
"rootlinks": [("https://numpy.org/", "NumPy.org"),
121-
("https://numpy.org/doc", "Docs"),
122-
]
123-
}
124-
html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']}
97+
html_theme = 'pydata_sphinx_theme'
98+
99+
html_logo = '_static/numpylogo.svg'
100+
101+
html_theme_options = {
102+
"github_url": "https://github.com/numpy/numpy",
103+
"twitter_url": "https://twitter.com/numpy_team",
104+
}
105+
125106

126107
html_additional_pages = {
127108
'index': 'indexcontent.html',

doc/source/contents.rst

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,12 @@ NumPy Documentation
55
###################
66

77
.. toctree::
8+
:maxdepth: 1
89

9-
user/setting-up
10-
user/quickstart
11-
user/absolute_beginners
12-
user/tutorials_index
13-
user/howtos_index
14-
reference/index
15-
user/explanations_index
16-
f2py/index
17-
glossary
18-
dev/index
19-
dev/underthehood
20-
docs/index
21-
docs/howto_document
22-
benchmarking
23-
bugs
24-
release
25-
about
26-
license
10+
User Guide <user/index>
11+
API reference <reference/index>
12+
Development <dev/index>
2713

14+
.. This is not really the index page, that is found in
15+
_templates/indexcontent.html The toctree content here will be added to the
16+
top of the template header

doc/source/user/index.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,20 @@ classes contained in the package, see the :ref:`reference`.
2424
c-info
2525
tutorials_index
2626
howtos_index
27+
28+
29+
.. These are stuck here to avoid the "WARNING: document isn't included in any
30+
toctree" message
31+
32+
.. toctree::
33+
:hidden:
34+
35+
explanations_index
36+
../f2py/index
37+
../glossary
38+
../dev/underthehood
39+
../docs/index
40+
../bugs
41+
../release
42+
../about
43+
../license

doc_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ ipython
33
scipy
44
matplotlib
55
pandas
6+
pydata-sphinx-theme==0.3.2

0 commit comments

Comments
 (0)
0