Skip to content

Commit 9cb8d0f

Browse files
committed
Fix: move book to pydata_sphinx_theme
1 parent 86cddc2 commit 9cb8d0f

18 files changed

+155
-136
lines changed

_static/pyos.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ figure {
3636
figcaption {
3737
font-size: .9em;
3838
font-weight: bold;
39-
}
39+
}
40+
4041

4142
.admonition p {
42-
font-size: 1.1em;
43-
font-weight: bold;
44-
}
43+
font-size: 1em;
44+
}

code-style-structure/intro.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

conf.py

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# -- Project information -----------------------------------------------------
1919

2020
project = 'python-package-guide'
21-
copyright = '2022, pyOpenSci'
22-
author = 'Leah Wasser'
21+
copyright = '2023, pyOpenSci'
22+
author = 'pyOpenSci Community'
2323

2424
# The full version, including alpha/beta/rc tags
2525
release = '0.1'
@@ -44,22 +44,57 @@
4444
"colon_fence",
4545
"deflist",
4646
]
47-
#myst_heading_anchors = 3
47+
myst_heading_anchors = 3
48+
49+
# For generating sitemap
50+
html_baseurl = 'https://www.pyopensci.org/software-peer-review/'
4851

4952
# Link to our repo for easy PR/ editing
5053
html_theme_options = {
51-
"source_repository": "https://github.com/pyopensci/python-package-guide",
52-
"source_branch": "main",
53-
"source_directory": ".",
54-
# "repository_url": "https://github.com/pyopensci/python-package-guide",
55-
# "use_repository_button": True,
56-
#"google_analytics_id": "UA-141260825-1",
57-
#"show_toc_level": 1,
58-
#"toc_title": "On this page",
59-
# "external_links": [
60-
# {"pyOpenSci Website": "link-one-name", "url": "https://www.pyopensci.org"}
61-
# ],
62-
"announcement": "🚧 UNDER CONSTRUCTION: this guide is under heavy construction right now. 🚧"
54+
"announcement": "🚧 This guide is currently under heavy construction 🚧 ",
55+
"external_links": [
56+
{
57+
"url": "https://www.pyopensci.org",
58+
"name": "pyOpenSci Website",
59+
},
60+
{
61+
"url": "https://www.pyopensci.org/python-package-guide",
62+
"name": "Python Packaging Guide",
63+
},
64+
{
65+
"url": "https://pyopensci.org/governance",
66+
"name": "Governance",
67+
},
68+
],
69+
"icon_links": [
70+
{
71+
"name": "Mastodon",
72+
"url": "https://fosstodon.org/@pyOpenSci",
73+
"icon": "fa-brands fa-mastodon",
74+
},
75+
],
76+
"logo": {
77+
"text": "Python Package Guide",
78+
"image_dark": "logo.png",
79+
"alt_text": "pyOpenSci Python Package Guide. The pyOpenSci logo is blue and yellow following the Python logo",
80+
},
81+
"header_links_before_dropdown": 4,
82+
"use_edit_page_button": True,
83+
"show_toc_level": 1,
84+
#"navbar_align": "left", # [left, content, right] For testing that the navbar items align properly
85+
"github_url": "https://github.com/pyopensci/python-package-guide",
86+
"twitter_url": "https://twitter.com/pyopensci",
87+
"footer_items": ["copyright"],
88+
}
89+
90+
html_theme_options["analytics"] = {
91+
"google_analytics_id": "UA-141260825-1",
92+
}
93+
94+
html_context = {
95+
"github_user": "pyopensci",
96+
"github_repo": "python-package-guide",
97+
"github_version": "main",
6398
}
6499

65100
# Add analytics to furo theme
@@ -90,7 +125,7 @@
90125
# The theme to use for HTML and HTML Help pages. See the documentation for
91126
# a list of builtin themes.
92127
#
93-
html_theme = 'furo'
128+
html_theme = 'pydata_sphinx_theme'
94129
html_static_path = ["_static"]
95130
html_css_files = ["pyos.css"]
96131
html_title = "pyOpenSci Package Guide"

documentation/hosting-tools/intro.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,3 @@ when writing Sphinx documentation including mySt and rST.
1212
We also talk about ways to publish your
1313
documentation online and Sphinx tools that might help you optimize
1414
your documentation website.
15-
16-
## Documentation build tools outline
17-
18-
```{toctree}
19-
:maxdepth: 2
20-
21-
Intro <self>
22-
Sphinx for Docs <sphinx-python-package-documentation-tools.md>
23-
myST vs Markdown vs rst <myst-markdown-rst-doc-syntax.md>
24-
Publish Your Docs <publish-documentation-online.md>
25-
Website Hosting and Optimization <website-hosting-optimizing-your-docs.md>
26-
```

documentation/hosting-tools/website-hosting-optimizing-your-docs.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ If you are interested in more people finding your package, you may want to
44
add some core Sphinx extensions (and theme settings) that will help search
55
engines such as Google find your documentation.
66

7-
### Google Analytics
7+
## Google Analytics
88

99
```{important}
10+
1011
Google analytics [is not compliant with the European General Data Protection Regulation (GDPR)](https://matomo.org/blog/2022/05/google-analytics-4-gdpr/). While there are many components to this regulation, one of the core elements is that you have to let users know on your site that you are collecting data and they have to consent. WHile it is possible to add infrastructure around Google Analytics to make it close to following GDPR regulations, the community is slowly shifting away from Google using open tools such as [Plausible](https://plausible.io/), [Cloudflare Web Analytics](https://www.cloudflare.com/web-analytics/) and [Matomo](https://matomo.org) for web analytics.
1112
1213
pyOpenSci is currently looking into free options for open source

documentation/index.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
# Documentation for your Open Source Python Package
22

3+
```{toctree}
4+
:hidden:
5+
:caption: Intro
6+
7+
Documentation Overview <self>
8+
```
9+
10+
```{toctree}
11+
:hidden:
12+
:maxdepth: 2
13+
:caption: Write User Documentation
14+
15+
Intro <write-user-documentation/intro.md>
16+
Create Your Docs <write-user-documentation/get-started>
17+
Document Your Code (API) <write-user-documentation/document-your-code-api-docstrings.md>
18+
Create Package Tutorials <write-user-documentation/create-package-tutorials.md>
19+
```
20+
21+
```{toctree}
22+
:hidden:
23+
:caption: Core Repository Files
24+
:maxdepth: 2
25+
26+
Intro <repository-files/intro.md>
27+
README file <repository-files/readme-file-best-practices.md>
28+
Contributing File <repository-files/contributing-file.md>
29+
Code of Conduct File <repository-files/code-of-conduct-file.md>
30+
Development Guide <repository-files/development-guide.md>
31+
LICENSE files <repository-files/license-files.md>
32+
```
33+
34+
```{toctree}
35+
:maxdepth: 2
36+
:hidden:
37+
:caption: Documentation & Hosting Tools
38+
39+
Intro <hosting-tools/intro>
40+
Sphinx for Docs <hosting-tools/sphinx-python-package-documentation-tools>
41+
myST vs Markdown vs rst <hosting-tools/myst-markdown-rst-doc-syntax>
42+
Publish Your Docs <hosting-tools/publish-documentation-online>
43+
Website Hosting and Optimization <hosting-tools/website-hosting-optimizing-your-docs>
44+
```
45+
46+
347
```{important}
448
Please note that the tools discussed here are those that
549
we see commonly used in the community. As tools evolve we
@@ -125,10 +169,9 @@ View pyOpenSci peer review check list
125169

126170
```{figure} ../images/moving-pandas-python-package-github-main-repo.png
127171
---
128-
name: directive-fig
172+
name: moving-pandas-github-repo-image
129173
width: 80%
130-
alt: Image showing the files in the the MovingPandas GitHub repository. Files there include code of conduct.md,
131-
Contributing.md, license.txt, readme.md.
174+
alt: Image showing the files in the the MovingPandas GitHub repository. Files in the image include code of conduct.md contributing.md license.txt and readme.md.
132175
---
133176
An example from the MovingPandas GitHub repository with all of the major files in it including CONTRIBUTING.md, README.md, CODE_OF_CONDUCT.md and a LICENSE.txt file. *(screen shot taken Nov 23 2022)*
134177
```

documentation/repository-files/code-of-conduct-file.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The CODE_OF_CONDUCT.md file In Your Python Open Source Package
22

3-
```{tip}
4-
## Example Code of Conduct files
3+
```{admonition} Example Code of Conduct files
4+
:class: tip
55
66
* [SciPy Code of Conduct file - notice they included theirs in their documentation](https://docs.scipy.org/doc/scipy/dev/conduct/code_of_conduct.html)
77
* [fatiando code of conduct file](https://github.com/fatiando/community/blob/main/CODE_OF_CONDUCT.md)

documentation/repository-files/contributing-file.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## What a CONTRIBUTING.md file should contain
44

5-
```{tip}
6-
## Example contributing files
5+
```{admonition} Example contributing files
6+
:class: tip
77
88
* [pyGMT contributing file](https://github.com/GenericMappingTools/pygmt/blob/main/CONTRIBUTING.md)
99
* [fatiando verde's contributing file](https://github.com/fatiando/verde/blob/main/CONTRIBUTING.md)

documentation/repository-files/development-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ It's also helpful to specify the types of tests you request if a contributor sub
1515

1616
If you have time to document it, it's also helpful to document your maintainer workflow and release processes.
1717

18-
### Why a development guide is important
18+
## Why a development guide is important
1919

2020
It's valuable to have a development guide, in the
2121
case that you wish to:

documentation/repository-files/intro.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ In this section of the Python packaging guide, we review all of the files that
44
you should have in your Python package repository. Your Python package should,
55
at a minimum have the following files:
66

7-
```{toctree}
8-
:maxdepth: 2
9-
10-
Intro <self>
11-
README file <readme-file-best-practices.md>
12-
Contributing File <contributing-file.md>
13-
Code of Conduct File <code-of-conduct-file.md>
14-
Development Guide <development-guide.md>
15-
LICENSE files <license-files.md>
16-
```
17-
187
The files mentions above (README, Code of Conduct, license
198
file, etc) are used as a measure of package community health
209
on many online platforms. Below, you can see an example how Github
@@ -23,7 +12,7 @@ all GitHub repositories.
2312

2413
```{figure} /images/moving-pandas-python-package-github-community-standards.png
2514
---
26-
name: directive-fig
15+
name: moving-pandas-github-community
2716
width: 80%
2817
alt: Image showing that the MovingPandas GitHub repository community health page with green checks next to each file including a description, README, code of conduct, contributing, license and issue templates. Note that Security policy has a yellow circle next to it as that is missing from the repo.
2918
---
@@ -36,7 +25,7 @@ in the Github repo as a measure of community health.
3625

3726
```{figure} /images/moving-pandas-python-package-snyk-health.png
3827
---
39-
name: directive-fig
28+
name: moving-pandas-snyk
4029
width: 80%
4130
alt: Screenshot of the Snyk page for movingpandas. It shows that the repository has a README file, contributing file, code of conduct. It also shows that it has 30 contributors and no funding. The package health score is 78/100.
4231
---

documentation/repository-files/license-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ by the Open Software Initiative (OSI). OSI's website has a
1010

1111
If you choose your license through GitHub, you can also automatically get a copy of the license file to add to your repository.
1212

13-
### Important: make sure that you closely follow the guidelines outlines by the License that you chose
13+
## Important: make sure that you closely follow the guidelines outlines by the License that you chose
1414

1515
Every license has different guidelines in terms of what code
1616
you can use in your package and also how others can (or can not) use the code in your package.

documentation/repository-files/readme-file-best-practices.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ health on sites such as:
1616

1717
```{figure} /images/pandera-python-package-readme-github.png
1818
---
19-
name: directive-fig
19+
name: pandera-readme
2020
width: 80%
21-
alt: README landing page screenshot for the Pandera package. It has the pandera logo at the top - which has two arrows in a chevron pattern pointing downward within a circle. Subtitle: statistical data testing toolkit. A data validation library for scientists, engineering, and analytics seeking correctness.
22-
Below that are a series of badges including CI tests passing, docs passing, version of pandera on pypi (0.13.4), MIT license and that it has been pyOpenSci peer reviewed. There are numerous badges below that.
23-
Finally below the badges the text reads:
24-
Pandera provides a flexible and expressive API for performing data validation on dataframe-like objects to make data processing pipelines more readable and robust.
21+
alt: README landing page screenshot for the Pandera package. It has the Pandera logo at the top - which has two arrows in a chevron pattern pointing downward within a circle. Subtitle is statistical data testing toolkit. A data validation library for scientists, engineering, and analytics seeking correctness. Below that are a series of badges including CI tests passing, docs passing, version of Pandera on pypi (0.13.4), MIT license and that it has been pyOpenSci peer reviewed. There are numerous badges below that. Finally below the badges the text says, Pandera provides a flexible and expressive API for performing data validation on dataframe-like objects to make data processing pipelines more readable and robust.
2522
---
2623
Your GitHub repository landing page highlights the README.md file. Here you can see the README.md file for the pyOpenSci package [Pandera](https://github.com/unionai-oss/pandera). *(screen shot taken Nov 23 2022)*
2724
```
@@ -138,8 +135,8 @@ Include descriptive links to:
138135
* The package's documentation page.
139136
* Short tutorials that demonstrate application of your package.
140137

141-
```{tip}
142-
### Too Much Of A Good Thing
138+
```{admonition} Too Much Of A Good Thing
139+
:class: tip
143140
144141
Try to avoid including several tutorials in the README.md file itself. This too will overwhelm the user with information.
145142
@@ -167,8 +164,8 @@ Finally be sure to include instructions on how to cite your package.
167164
Citation should include the DOI that you want used when citing your package,
168165
and any language that you'd like to see associated with the citation.
169166

170-
```{tip}
171-
### README Resources
167+
```{tip} README Resources
168+
:class: tip
172169
173170
Below are some resources on creating great README.md files that you
174171
might find helpful.

documentation/write-user-documentation/create-package-tutorials.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ to get started using your package. Ideally, those tutorials
88
also can be run from start to finish providing a second set of
99
checks (on top of your test suite) to your package's code base.
1010

11-
In the [documentation tools page](python-package-documentation-tools) we talk about two Sphinx extensions (`sphinx-gallery` and `nbsphinx`)
11+
On this page, we review two Sphinx extensions (`sphinx-gallery` and `nbsphinx`)
1212
that allow you to create reproducible tutorials that are run
1313
when your Sphinx documentation builds.
1414

@@ -43,7 +43,7 @@ your documentation, the gallery extension:
4343

4444
```{figure} /images/sphinx-gallery-overview.png
4545
---
46-
name: directive-fig
46+
name: sphinx-gallery
4747
width: 80%
4848
alt: Image showing the gallery output provided by sphinx-gallery where each tutorial is in a grid and the tutorial thumbnails are created from a graphic in the tutorial.
4949
---
@@ -55,7 +55,7 @@ Below you can see what a tutorial looks like created with sphinx-gallery.
5555

5656
```{figure} /images/sphinx-gallery-tutorial.png
5757
---
58-
name: directive-fig
58+
name: spinx-gallery-tutorial
5959
width: 80%
6060
alt: Image showing ta single tutorial from Sphinx gallery. The tutorial shows a simple matplotlib created plot and associated code.
6161
---

documentation/write-user-documentation/document-your-code-api-docstrings.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def extent_to_json(ext_obj):
147147

148148
```{figure} /images/sphinx-rendering-extent-to-json-earthpy.png
149149
---
150-
name: directive-fig
150+
name: earthpy-json-example
151151
width: 80%
152152
---
153153
Using the above NumPy format docstring in sphinx, the autodoc extension will
@@ -193,15 +193,17 @@ def add_me(aNum, aNum2):
193193
-------
194194
Prints the integer that you provide the function.
195195
196+
Examples
197+
--------
198+
Below you can see how the `print_me` function will print a number that
199+
you provide it.
200+
201+
>>> add_me(1+3)
202+
4
203+
196204
"""
197-
return aNum + aNum2
198205

199-
Examples
200-
--------
201-
Below you can see how the `print_me` function will print a number that
202-
you provide it.
206+
return aNum + aNum2
203207

204-
>>> add_me(1+3)
205-
4
206208

207209
```

documentation/write-user-documentation/get-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ page to the following elements:
5757

5858
```{figure} /images/geopandas-documentation-landing-page.png
5959
---
60-
name: directive-fig
60+
name: geopandas-landing
6161
width: 80%
6262
alt: Image showing the landing page for GeoPandas documentation which has 4 sections including Getting started, Documentation, About GeoPandas, Community.
6363
---

documentation/write-user-documentation/intro.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,3 @@ easier such as:
1313
* autodoc to automagically populate documentation for your code's functions,
1414
classes, methods and attributes (API documentation) and
1515
* sphinx gallery for tutorials.
16-
17-
## User-facing documentation sections
18-
19-
```{toctree}
20-
:maxdepth: 2
21-
22-
Intro <self>
23-
Create Your Docs <get-started>
24-
Document Your Code (API) <document-your-code-api-docstrings.md>
25-
Create Package Tutorials <create-package-tutorials.md>
26-
```

0 commit comments

Comments
 (0)