Skip to content

Commit f773652

Browse files
authored
ADD: Update package theme to furo and add sitemap and opengraph (#13)
* update package theme * update requirements * add site map * remove 503 error codes as generally those links work and ignore genindex.html
1 parent 2dbbb76 commit f773652

File tree

5 files changed

+57
-117
lines changed

5 files changed

+57
-117
lines changed

.github/workflows/build-book.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
with:
6868
directory: '_build/html'
6969
arguments: |
70-
--ignore-files "/.+\/_static\/.+/"
70+
--ignore-files "/.+\/_static\/.+/,/genindex.html/ "
71+
--ignore-status-codes "403, 503"
7172
7273

_static/pyos.css

Lines changed: 10 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,20 @@
11
html, body {
2-
font-size: 1.1rem;
2+
font-size: 1.02rem;
33
}
44

5-
body p {
6-
/* font-family: $header-font; */
7-
font-size: 1em;
8-
font-family: 'Verdana', sans-serif!important;
9-
color: #555!important;
10-
line-height: 1.5em;
11-
}
12-
13-
h1, h2, h3 {
14-
font-family: 'Trebuchet MS', sans-serif;
15-
color: #333!important;
5+
.admonition {
6+
margin-top: 40px;
7+
margin-bottom: 40px;
168
}
179

1810
h1 {
19-
padding-bottom: 1em!important;
20-
}
21-
22-
h3 {
23-
padding-top: 1.4em;
24-
margin-bottom: 14px;
25-
}
26-
27-
/* hide the right sidebar */
28-
.col-md-3 .bd-toc .show .noprint {
29-
display: none!important;
30-
}
31-
32-
#main-content {
33-
max-width: 80%;
34-
}
35-
36-
.bd-toc {
37-
color: #1abc9c;
38-
}
39-
40-
@media (min-width: 720px){
41-
.col-md-3 {
42-
flex: 0 0 25%;
43-
/* max-width: 25%; */
44-
display: none!important;
45-
}
46-
}
47-
48-
49-
/* HEADER BLOCK 2 */
50-
div.header__block {
51-
color: #222;
11+
margin-top: 40px;
12+
margin-bottom: 40px;
5213
}
53-
54-
.announcement div {
55-
background-color: #ccc;
56-
}
57-
58-
.header-item.announcement, .header-item.announcement .noprint {
59-
background-color:#ccc;
60-
}
61-
62-
div .announcement .header-item .noprint, header-item.announcement {
63-
background-color: #ccc!important;
64-
}
65-
66-
/* notes */
67-
68-
div.admonition.note .admonition-title, div.admonition.note .admonition-title::before {
69-
background-color: #C1CFD4;
70-
color: #222;
71-
14+
h2 {
15+
margin-top: 60px;
7216
}
7317

74-
div.admonition.note {
75-
border-color: #C1CFD4;
76-
background-color: #E3F4FA;
77-
}
78-
79-
80-
div.admonition.important .admonition-title, div.admonition.important .admonition-title::before {
81-
background-color: #107762;
82-
color: #ffffff!important;
83-
}
84-
85-
div.admonition.important .admonition-title {
86-
background-color: #107762;
87-
border-color: #1abc9c;
88-
}
18+
h3 {
19+
margin-top: 40px}
8920

90-
div.admonition.important {
91-
border-color: #0e6654;
92-
background-color: #ecfcf9;
93-
}

conf.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
# The full version, including alpha/beta/rc tags
2525
release = '0.1'
2626

27-
2827
# -- General configuration ---------------------------------------------------
2928

3029
# Add any Sphinx extension module names here, as strings. They can be
@@ -34,7 +33,10 @@
3433
"myst_nb",
3534
"sphinx_design",
3635
"sphinx_copybutton",
37-
"sphinx.ext.intersphinx"
36+
"sphinx.ext.intersphinx",
37+
"sphinx_sitemap",
38+
"sphinxcontrib.gtagjs",
39+
"sphinxext.opengraph",
3840
]
3941

4042
# colon fence for card support in md
@@ -45,16 +47,19 @@
4547
html_theme_options = {
4648
"repository_url": "https://github.com/pyopensci/python-package-guide",
4749
"use_repository_button": True,
48-
"google_analytics_id": "UA-141260825-1",
49-
"show_toc_level": 1,
50-
"toc_title": "On this page",
50+
#"google_analytics_id": "UA-141260825-1",
51+
#"show_toc_level": 1,
52+
#"toc_title": "On this page",
5153
"external_links": [
5254
{"pyOpenSci Website": "link-one-name", "url": "https://www.pyopensci.org"}
5355
],
5456
"announcement": "🚧 UNDER CONSTRUCTION: this guide is under heavy construction right now. 🚧"
5557
}
5658

57-
59+
# Add analytics to furo theme
60+
gtagjs_ids = [
61+
'UA-141260825-1',
62+
]
5863

5964
# Add any paths that contain templates here, relative to this directory.
6065
templates_path = ['_templates']
@@ -71,13 +76,15 @@
7176
"README.md"
7277
]
7378

79+
# For sitemap
80+
html_baseurl = 'https://www.pyopensci.org/package-review-guide/'
7481

7582
# -- Options for HTML output -------------------------------------------------
7683

7784
# The theme to use for HTML and HTML Help pages. See the documentation for
7885
# a list of builtin themes.
7986
#
80-
html_theme = 'sphinx_book_theme'
87+
html_theme = 'furo'
8188
html_static_path = ["_static"]
8289
html_css_files = ["pyos.css"]
8390
html_title = "pyOpenSci Package Guide"

index.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<!-- Github community standards
44
https://github.com/pyOpenSci/python-package-guide/community -->
5+
56
## Welcome, Python open source enthusiast!
67

78
Here you will find guidelines for what we look for in your scientific
@@ -21,19 +22,11 @@ Python package when reviewing. You will also find best practice recommendations
2122
:class: sd-fs-3
2223

2324

24-
<!--
25-
Removing button for the time being
26-
```{button-ref} start/your-first-book
27-
:ref-type: doc
25+
```{button-link} https://www.pyopensci.org/about-peer-review/
2826
:color: primary
2927
:class: sd-rounded-pill float-left
30-
31-
32-
Get Involved (Maybe a link to a get involved page)
33-
34-
% SVG rendering breaks latex builds for the GitHub badge, so only include in HTML
35-
```
36-
-->
28+
Learn about our open peer review process
29+
```
3730

3831
```{only} html
3932
![GitHub release (latest by date)](https://img.shields.io/github/v/release/pyopensci/python-package-guide?color=purple&display_name=tag&style=plastic)
@@ -69,7 +62,7 @@ covered include: README files, tutorials and full docs.
6962
:link-type: doc
7063
:class-header: bg-light
7164

72-
Coming soon...
65+
Package Structure & Code
7366
^^^
7467
<!--
7568
Get a basic overview of our open peer review process for Python scientific open source software. -->
@@ -113,21 +106,34 @@ Good meets the requirements. Going beyond the minimum can make package maintenan
113106
This guide is now a work in progress. If you have ideas of things you'd like
114107
to see here, [we invite you to open an issue on GitHub that details any changes or additions that you'd like to see.](https://github.com/pyOpenSci/python-package-guide/issues).
115108

109+
116110
```{toctree}
117111
:hidden:
118112
:caption: Documentation
119113
120114
Intro to Documentation <documentation/index>
121115
The README File <documentation/create-readme-files.md>
122-
Package docs & tutorials <documentation/package-documentation-tutorials>
116+
README Files <documentation/readme-files>
117+
Package documentation <documentation/package-documentation-sphinx>
123118
Contributing & license files <documentation/contributing>
124119
```
125120

126121
```{toctree}
127122
:hidden:
128-
:caption: Package structure
129-
I don't work <package-structure-code/index.md>
130-
I work <package-structure-code/code-structure-style.md>
123+
:caption: Package structure & code style
124+
125+
Intro <package-structure-code/intro>
126+
package-structure-code/code-structure-style
127+
package-structure-code/release
128+
package-structure-code/overview
129+
package-structure-code/collaboration
130+
```
131+
132+
```{toctree}
133+
:hidden:
134+
:caption: Code Style & Structure
135+
136+
code-style-structure/index
131137
```
132138

133139
```{toctree}
@@ -137,14 +143,7 @@ testing-infrastructure/test-code
137143
testing-infrastructure/continuous-integration
138144
```
139145

140-
<!--
141-
Removing button for the time being
142-
```{button-ref} start/your-first-book
143-
:ref-type: doc
144-
:color: primary
145-
:class: sd-rounded-pill float-left
146-
Get Involved (Maybe a link to a get involved page)
147-
``` -->
146+
148147

149148

150149

requirements.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#ipython
2-
sphinx-book-theme
3-
myst-parser[linkify]
2+
furo
43
myst-nb
54
sphinx
65
sphinx-autobuild
76
sphinx-copybutton
87
sphinx-design
8+
# XML feed for analytics
9+
sphinx-sitemap
10+
# Support for social / adds meta tags
11+
sphinxext-opengraph
12+
sphinx-inline-tabs
13+
# Support for GA
14+
sphinxcontrib-gtagjs

0 commit comments

Comments
 (0)