Skip to content

Commit 8e2bc91

Browse files
echedey-lskandersolarAdamRJensenRDaxinicwhanse
authored
Bump docs infraestructure (#2112)
* Initial version bump * Pin latests, okay * Update extlinks See sphinx#11094 * add entries to html_context, from pydata sphinx theme * Update edit-this-page.html * Update edit-this-page.html * Update conf.py * Update conf.py * Footer warning * `"left_sidebar_end"` -> `"primary_sidebar_end"` * Add favicons * Add favicons dependency * GH desktop is a bit broken * linter * Edit link (I?) * `"use_edit_page_button": True,` else I can't test it xd * Add `edit-this-page.html` again * `html_show_sourcelink = False` * Update conf.py * this was unnecessary * Update edit-this-page.html https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/source-buttons.html#custom-link-text * Revert "Update edit-this-page.html" This reverts commit 4175be5. * Update conf.py * Suppress warnings See numpy#25504 * Revert back to original * Did I already try this? * Using the docs * Fix the edit -> view on github * linter * No way linter * Fix references formatting Co-Authored-By: Kevin Anderson <[email protected]> * Remove prev/next links Co-Authored-By: Kevin Anderson <[email protected]> Co-Authored-By: Adam R. Jensen <[email protected]> Co-Authored-By: RDaxini <[email protected]> Co-Authored-By: Cliff Hansen <[email protected]> * Delay updating docs build env in the future Co-Authored-By: Adam R. Jensen <[email protected]> * Copyright Co-Authored-By: Adam R. Jensen <[email protected]> * Fix empty sidebar not collapsing (I hope) Co-Authored-By: Adam R. Jensen <[email protected]> * Stylize navigation and footer per Adam comment Co-Authored-By: Adam R. Jensen <[email protected]> * linter on diff F * Update docs/sphinx/source/conf.py Co-authored-by: Adam R. Jensen <[email protected]> --------- Co-authored-by: Kevin Anderson <[email protected]> Co-authored-by: Adam R. Jensen <[email protected]> Co-authored-by: RDaxini <[email protected]> Co-authored-by: Cliff Hansen <[email protected]>
1 parent 048b70f commit 8e2bc91

File tree

5 files changed

+56
-51
lines changed

5 files changed

+56
-51
lines changed
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
/* no reference superscript */
22
.footnote-reference {
3-
font-size: 100% !important; /* default is 90% */
4-
top: 0.0em !important; /* default is -0.4em */
5-
}
6-
7-
/* reference number in brackets */
8-
.footnote-reference::before {
9-
content: '[';
10-
}
11-
.footnote-reference::after {
12-
content: ']';
3+
font-size: 100% !important;
4+
vertical-align: baseline !important;
135
}
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
{#
22

33
Modify the "Edit on Github" links to handle auto-generated pages in the
4-
example gallery and the API reference listings. The GH links that sphinx
4+
example gallery and the API reference listings. The GH links that sphinx
55
generates by default make the assumption that an HTML file comes from an RST
66
file with the same filepath, which isn't the case for autogenerated files. The
77
logic to generate the correct URL is in conf.py, but we still have to modify
88
the template here to change the "Edit this page" text to "View on GitHub".
99

1010
#}
1111

12-
{% if sourcename is defined and theme_use_edit_page_button==true and page_source_suffix %}
13-
{% set src = sourcename.split('.') %}
14-
<div class="tocsection editthispage">
15-
<a href="{{ get_edit_url() }}">
16-
<i class="fab fa-github-square"></i> {{ _("View on GitHub") }}
17-
</a>
18-
</div>
19-
{% endif %}
12+
{% extends "!components/edit-this-page.html" %}
13+
14+
{% block edit_this_page_text %}
15+
View on GitHub
16+
{% endblock %}

docs/sphinx/source/conf.py

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
# https://github.com/pypa/setuptools/issues/3044
2525
import distutils # noqa: F401
2626
import pandas as pd
27+
2728
pd.show_versions()
2829

2930
# If extensions (or modules to document with autodoc) are in another directory,
@@ -54,6 +55,7 @@
5455
'IPython.sphinxext.ipython_console_highlighting',
5556
'sphinx_gallery.gen_gallery',
5657
'sphinx_toggleprompt',
58+
'sphinx_favicon',
5759
]
5860

5961
mathjax3_config = {'chtml': {'displayAlign': 'left',
@@ -83,7 +85,7 @@
8385
# |version| and |release|, also used in various other places throughout the
8486
# built documents.
8587

86-
import pvlib
88+
import pvlib # noqa: E402
8789

8890
# The short X.Y version.
8991
version = '%s' % (pvlib.__version__)
@@ -142,10 +144,6 @@
142144
# https://pydata-sphinx-theme.rtfd.io/en/latest/user_guide/configuring.html
143145
html_theme_options = {
144146
"github_url": "https://github.com/pvlib/pvlib-python",
145-
"favicons": [
146-
{"rel": "icon", "sizes": "16x16", "href": "favicon-16x16.png"},
147-
{"rel": "icon", "sizes": "32x32", "href": "favicon-32x32.png"},
148-
],
149147
"icon_links": [
150148
{
151149
"name": "StackOverflow",
@@ -165,12 +163,23 @@
165163
],
166164
"use_edit_page_button": True,
167165
"show_toc_level": 1,
168-
"footer_items": ["copyright", "sphinx-version", "sidebar-ethical-ads"],
169-
"left_sidebar_end": [],
170-
}
166+
# "footer_start": [], # "copyright", "sphinx-version"
167+
# "footer_center": [],
168+
"footer_end": [],
169+
# "primary_sidebar_end": [],
170+
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html#hide-the-previous-and-next-buttons
171+
"show_prev_next": False, # disable next/previous links
172+
} # noqa: E501
173+
174+
# Add favicons from extension sphinx_favicon
175+
favicons = [
176+
{"rel": "icon", "sizes": "16x16", "href": "favicon-16x16.png"},
177+
{"rel": "icon", "sizes": "32x32", "href": "favicon-32x32.png"},
178+
]
179+
171180

172181
# Add any paths that contain custom themes here, relative to this directory.
173-
#html_theme_path = []
182+
# html_theme_path = []
174183

175184
# The name for this set of Sphinx documents. If None, it defaults to
176185
# "<project> v<release> documentation".
@@ -196,40 +205,42 @@
196205
# Add any extra paths that contain custom files (such as robots.txt or
197206
# .htaccess) here, relative to this directory. These files are copied
198207
# directly to the root of the documentation.
199-
#html_extra_path = []
208+
# html_extra_path = []
200209

201210
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
202211
# using the given strftime format.
203-
#html_last_updated_fmt = '%b %d, %Y'
212+
# html_last_updated_fmt = '%b %d, %Y'
204213

205214
# If true, SmartyPants will be used to convert quotes and dashes to
206215
# typographically correct entities.
207-
#html_use_smartypants = True
216+
# html_use_smartypants = True
208217

209218
# Custom sidebar templates, maps document names to template names.
210-
# html_sidebars = {}
219+
# html_sidebars = {
220+
# "**": ["sidebar-nav-bs"]
221+
# }
211222

212223
# Additional templates that should be rendered to pages, maps page names to
213224
# template names.
214-
#html_additional_pages = {}
225+
# html_additional_pages = {}
215226

216227
# If false, no module index is generated.
217-
#html_domain_indices = True
228+
# html_domain_indices = True
218229

219230
# If false, no index is generated.
220-
#html_use_index = True
231+
# html_use_index = True
221232

222233
# If true, the index is split into individual pages for each letter.
223-
#html_split_index = False
234+
# html_split_index = False
224235

225236
# If true, links to the reST sources are added to the pages.
226-
#html_show_sourcelink = True
237+
html_show_sourcelink = False
227238

228239
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
229-
#html_show_sphinx = True
240+
# html_show_sphinx = True
230241

231242
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
232-
html_show_copyright = False
243+
# html_show_copyright = False
233244

234245
# If true, an OpenSearch description file will be output, and all pages will
235246
# contain a <link> tag referring to it. The value of this option must be the
@@ -297,12 +308,15 @@ def setup(app):
297308

298309
# extlinks alias
299310
extlinks = {
300-
'issue': ('https://github.com/pvlib/pvlib-python/issues/%s', 'GH'),
301-
'pull': ('https://github.com/pvlib/pvlib-python/pull/%s', 'GH'),
302-
'wiki': ('https://github.com/pvlib/pvlib-python/wiki/%s', 'wiki '),
303-
'doi': ('http://dx.doi.org/%s', 'DOI: '),
304-
'ghuser': ('https://github.com/%s', '@'),
305-
'discuss': ('https://github.com/pvlib/pvlib-python/discussions/%s', 'GH'),
311+
"issue": ("https://github.com/pvlib/pvlib-python/issues/%s", "GH%s"),
312+
"pull": ("https://github.com/pvlib/pvlib-python/pull/%s", "GH%s"),
313+
"wiki": ("https://github.com/pvlib/pvlib-python/wiki/%s", "wiki %s"),
314+
"doi": ("http://dx.doi.org/%s", "DOI: %s"),
315+
"ghuser": ("https://github.com/%s", "@%s"),
316+
"discuss": (
317+
"https://github.com/pvlib/pvlib-python/discussions/%s",
318+
"GH%s",
319+
),
306320
}
307321

308322
# -- Options for manual page output ---------------------------------------

pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ optional = [
5656
]
5757
doc = [
5858
'ipython',
59+
'pickleshare', # required by ipython
5960
'matplotlib',
60-
'sphinx == 4.5.0',
61-
'pydata-sphinx-theme == 0.8.1',
61+
'sphinx == 7.3.7',
62+
'pydata-sphinx-theme == 0.15.4',
6263
'sphinx-gallery',
63-
'docutils == 0.15.2',
64+
'docutils == 0.21',
6465
'pillow',
65-
'sphinx-toggleprompt >= 0.0.5',
66+
'sphinx-toggleprompt == 0.5.2',
67+
'sphinx-favicon',
6668
'solarfactors',
6769
]
6870
test = [

readthedocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
version: 2
77

88
build:
9-
os: ubuntu-20.04
9+
os: ubuntu-lts-latest
1010
tools:
11-
python: "3.8"
11+
python: "3.11"
1212
jobs:
1313
# fetch the full history so that setuptools_scm can determine the
1414
# correct version string for long PRs with many commits

0 commit comments

Comments
 (0)