Skip to content

Commit 5834466

Browse files
authored
change the docs theme to sphinx_book_theme (#229)
this renders the notebooks better also allows for dark mode and more links back to github
1 parent 91721f7 commit 5834466

File tree

6 files changed

+47
-63
lines changed

6 files changed

+47
-63
lines changed

docs/source/_static/myfile.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
2+
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');
3+
4+
body {
5+
font-family: "Open Sans", sans-serif;
6+
}
7+
8+
.heading-style, h1, h2, h3, h4, h5, h6 {
9+
font-family: "Open Sans", sans-serif;
10+
}

docs/source/_static/theme_overrides.css

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

docs/source/conf.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
'sphinx.ext.graphviz',
4646
'sphinx_copybutton',
4747
'sphinx-prompt',
48-
'sphinx_rtd_theme',
4948
'IPython.sphinxext.ipython_console_highlighting',
5049
'sphinx.ext.githubpages']
5150

@@ -72,10 +71,11 @@
7271

7372
# General information about the project.
7473
project = 'pyro'
75-
copyright = '2023, pyro development team'
74+
copyright = '2024, pyro development team'
7675
author = 'pyro development team'
7776

7877
html_logo = "logo.gif"
78+
html_title = "pyro"
7979

8080
# The version info for the project you're documenting, acts as replacement for
8181
# |version| and |release|, also used in various other places throughout the
@@ -110,32 +110,40 @@
110110
# The theme to use for HTML and HTML Help pages. See the documentation for
111111
# a list of builtin themes.
112112
#
113-
html_theme = 'sphinx_rtd_theme'
113+
html_theme = 'sphinx_book_theme'
114114

115115
# Theme options are theme-specific and customize the look and feel of a theme
116116
# further. For a list of options available for each theme, see the
117117
# documentation.
118118
#
119-
# html_theme_options = {}
119+
html_theme_options = {
120+
"repository_url": "https://github.com/python-hydro/pyro2",
121+
"use_repository_button": True,
122+
"use_issues_button": True,
123+
"use_edit_page_button": True,
124+
"use_source_button": True,
125+
"repository_branch": "main",
126+
"path_to_docs": "docs/source"
127+
}
120128

121129
# Add any paths that contain custom static files (such as style sheets) here,
122130
# relative to this directory. They are copied after the builtin static files,
123131
# so a file named "default.css" will overwrite the builtin "default.css".
124132
html_static_path = ['_static']
125133

126-
html_css_files = ["theme_overrides.css"]
134+
html_css_files = ["myfile.css"]
127135

128136
# Custom sidebar templates, must be a dictionary that maps document names
129137
# to template names.
130138
#
131139
# This is required for the alabaster theme
132140
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
133-
html_sidebars = {
134-
'**': [
135-
'relations.html', # needs 'show_related': True theme option to display
136-
'searchbox.html',
137-
]
138-
}
141+
#html_sidebars = {
142+
# '**': [
143+
# 'relations.html', # needs 'show_related': True theme option to display
144+
# 'searchbox.html',
145+
# ]
146+
#}
139147

140148
linkcheck_ignore = [r"https://ascelibrary.org",
141149
r"https://doi.org/10.1061/(ASCE)0733-9429(1999)125:11(1210)",

docs/source/index.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,17 @@ pyro: a python hydro code
1111

1212
.. image:: pyro_plots.png
1313

14+
About
15+
=====
16+
17+
pyro is a python hydrodynamics code meant to illustrate how the basic methods
18+
used in astrophysical simulations work. It is also used for prototyping
19+
new ideas.
20+
1421
.. toctree::
1522
:maxdepth: 1
1623
:caption: pyro basics
24+
:hidden:
1725

1826
intro
1927
installation
@@ -26,6 +34,7 @@ pyro: a python hydro code
2634
.. toctree::
2735
:maxdepth: 1
2836
:caption: Mesh
37+
:hidden:
2938

3039
mesh_basics
3140
mesh-examples.ipynb
@@ -34,6 +43,7 @@ pyro: a python hydro code
3443
.. toctree::
3544
:maxdepth: 1
3645
:caption: Solvers
46+
:hidden:
3747

3848
advection_basics
3949
burgers_basics
@@ -50,31 +60,36 @@ pyro: a python hydro code
5060
.. toctree::
5161
:maxdepth: 1
5262
:caption: Examples
63+
:hidden:
5364

5465
compressible-convergence.ipynb
5566

5667
.. toctree::
5768
:maxdepth: 1
5869
:caption: Utilities
70+
:hidden:
5971

6072
analysis
6173
testing
6274

6375
.. toctree::
6476
:maxdepth: 1
6577
:caption: Community
78+
:hidden:
6679

6780
help
6881
ack
6982

7083
.. toctree::
7184
:maxdepth: 1
7285
:caption: Software Reference
86+
:hidden:
7387

7488
API <modules>
7589

7690
.. toctree::
7791
:caption: Bibliography
92+
:hidden:
7893

7994
zreferences
8095

@@ -84,4 +99,3 @@ Indices and tables
8499

85100
* :ref:`genindex`
86101
* :ref:`modindex`
87-
* :ref:`search`

docs/source/intro.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Introduction to pyro
33

44
.. image:: pyro_plots.png
55

6+
|
7+
68
pyro is a simple framework for implementing and playing with
79
hydrodynamics solvers. It is designed to provide a tutorial for
810
students in computational astrophysics (and hydrodynamics in general)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ numpy>=1.13.3
22
matplotlib>=2.0.0
33
h5py>=2.7
44
scipy>=0.16
5-
sphinx_rtd_theme
5+
sphinx_book_theme
66
nbsphinx>=0.3.1
77
pytest>=3.6
88
nbval>=0.9.0

0 commit comments

Comments
 (0)