Skip to content

Commit 41fa152

Browse files
authored
Migrate docs to read-the-docs theme (hypre-space#803)
This switches the Sphinx documentation style to improve rendering of the "API" pages.
1 parent b9d3ecc commit 41fa152

24 files changed

+932
-634
lines changed

.readthedocs.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
# Required
1111
version: 2
1212

13+
# Set the version of Python and other tools you might need
14+
build:
15+
os: ubuntu-22.04
16+
tools:
17+
python: "3.11"
18+
1319
# Build documentation in the docs/ directory with Sphinx
1420
sphinx:
1521
configuration: src/docs/usr-manual/conf.py
@@ -19,6 +25,5 @@ formats: all
1925

2026
# Optionally set the version of Python and requirements required to build your docs
2127
python:
22-
version: 3.7
2328
install:
2429
- requirements: src/docs/usr-manual/requirements.txt

src/IJ_mv/HYPRE_IJ_mv.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ extern "C" {
2121
/**
2222
* @defgroup IJSystemInterface IJ System Interface
2323
*
24-
* This interface represents a linear-algebraic conceptual view of a
25-
* linear system. The 'I' and 'J' in the name are meant to be
26-
* mnemonic for the traditional matrix notation A(I,J).
27-
*
28-
* @memo A linear-algebraic conceptual interface
24+
* A linear-algebraic conceptual interface. This interface represents a
25+
* linear-algebraic conceptual view of a linear system. The 'I' and 'J' in the
26+
* name are meant to be mnemonic for the traditional matrix notation A(I,J).
2927
*
3028
* @{
3129
**/

src/docs/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,9 @@ Breathe:
102102

103103
- https://breathe.readthedocs.io/en/latest/index.html
104104

105+
## Some notes on customization
106+
107+
After compilation, the CSS style files that control the HTML formatting will be
108+
in the folder `usr-manual-html/_static`. To override any of these settings, add
109+
the appropriate lines to the file `usr-manual/_static/custom.css`. Use the web
110+
to get information on CSS.

src/docs/ref-manual/conf.doxygen

+727-337
Large diffs are not rendered by default.
+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
/* This file intentionally left blank. */
21

3-
/* Move Georgia first to get better rendering on Windows platforms */
2+
/* Classic theme customizations: left justify text alignment */
3+
/*
4+
div.body p, div.body dd, div.body li, div.body blockquote {
5+
text-align: left;
6+
}
7+
*/
8+
9+
/* Alabaster theme customizations: move Georgia first to get better rendering on
10+
Windows platforms */
11+
/*
412
body {
513
font-family: Georgia, 'goudy old style', 'minion pro', 'bell mt', 'Hiragino Mincho Pro', serif;
614
font-size: 17px;
@@ -9,3 +17,4 @@ body {
917
margin: 0;
1018
padding: 0;
1119
}
20+
*/
20.1 KB
Loading

src/docs/usr-manual/ch-api.rst

+16
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,19 @@ API
2121
api-sol-parcsr
2222
api-sol-krylov
2323
api-sol-eigen
24+
25+
.. Add blank lines to help with navigation pane formatting
26+
|
27+
|
28+
|
29+
|
30+
|
31+
|
32+
|
33+
|
34+
|
35+
|
36+
|
37+
|
38+
|
39+
|

src/docs/usr-manual/conf.py

+57-39
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,18 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
import os
15+
import sys
16+
import subprocess
1517

1618
# Alabaster
17-
import alabaster
19+
#import alabaster
1820

1921
# Read the docs
20-
#import sphinx_rtd_theme
21-
22-
import subprocess
23-
24-
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
25-
26-
if read_the_docs_build:
22+
import sphinx_rtd_theme
2723

24+
# Run doxygen if building on Read the Docs
25+
if os.environ.get('READTHEDOCS'):
2826
subprocess.call('cd ../ref-manual; doxygen conf.doxygen', shell=True)
2927

3028
# If extensions (or modules to document with autodoc) are in another directory,
@@ -40,7 +38,15 @@
4038
# Add any Sphinx extension module names here, as strings. They can be extensions
4139
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
4240
#extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath']
43-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.mathjax', 'breathe']
41+
extensions = [
42+
'sphinx.ext.intersphinx',
43+
'sphinx.ext.autodoc',
44+
'sphinx.ext.autosummary',
45+
'sphinx.ext.mathjax',
46+
'sphinx.ext.viewcode',
47+
'breathe',
48+
'sphinx_rtd_theme',
49+
]
4450
breathe_projects = { 'hypre': '../ref-manual/xml' }
4551

4652
# Add any paths that contain templates here, relative to this directory.
@@ -80,7 +86,7 @@
8086

8187
# List of patterns, relative to source directory, that match files and
8288
# directories to ignore when looking for source files.
83-
exclude_patterns = ['_build']
89+
exclude_patterns = []
8490

8591
# The reST default role (used for this markup: `text`) to use for all documents.
8692
#default_role = None
@@ -107,39 +113,42 @@
107113

108114
# The theme to use for HTML and HTML Help pages. See the documentation for
109115
# a list of builtin themes.
110-
#html_theme = 'default'
116+
117+
# Classic
118+
#html_theme = 'classic'
111119

112120
# Alabaster
113-
html_theme = 'alabaster'
121+
#html_theme = 'alabaster'
114122

115123
# Read the docs
116-
#html_theme = 'sphinx_rtd_theme'
124+
html_theme = 'sphinx_rtd_theme'
117125

118126
# Theme options are theme-specific and customize the look and feel of a theme
119127
# further. For a list of options available for each theme, see the
120128
# documentation.
121-
#html_theme_options = {}
122129

123-
# Alabaster
124-
html_theme_options = {
125-
'page_width': '1200px',
126-
'sidebar_width': '300px',
127-
'fixed_sidebar': 'true',
128-
}
130+
# Classic
131+
#html_theme_options = {
132+
# 'body_min_width': '900px',
133+
# 'sidebarwidth': '300px',
134+
# 'stickysidebar': 'true',
135+
#}
129136

130-
# Read the docs
137+
# Alabaster
131138
#html_theme_options = {
132-
# 'typekit_id': 'hiw1hhg',
139+
# 'page_width': '1200px',
140+
# 'sidebar_width': '300px',
141+
# 'fixed_sidebar': 'true',
133142
#}
134143

144+
# Read the docs
145+
html_theme_options = {
146+
}
147+
135148
# Add any paths that contain custom themes here, relative to this directory.
136-
#html_theme_path = []
137149

138150
# Alabaster
139-
html_theme_path = [alabaster.get_path()]
140-
141-
# Read the docs
142-
#html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
151+
#html_theme_path = [alabaster.get_path()]
143152

144153
# The name for this set of Sphinx documents. If None, it defaults to
145154
# "<project> v<release> documentation".
@@ -150,7 +159,8 @@
150159

151160
# The name of an image file (relative to this directory) to place at the top
152161
# of the sidebar.
153-
#html_logo = None
162+
#html_logo = 'hypre-nwords.512.png'
163+
html_logo = 'bw-hypre-nwords.512.png' # Black/white looks better with rtd theme
154164

155165
# The name of an image file (within the static path) to use as favicon of the
156166
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
@@ -161,6 +171,7 @@
161171
# relative to this directory. They are copied after the builtin static files,
162172
# so a file named "default.css" will overwrite the builtin "default.css".
163173
html_static_path = ['_static']
174+
html_css_files = ["custom.css"]
164175

165176
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
166177
# using the given strftime format.
@@ -171,18 +182,25 @@
171182
#html_use_smartypants = True
172183

173184
# Custom sidebar templates, maps document names to template names.
174-
#html_sidebars = {}
185+
186+
# Classic
187+
#html_sidebars = {
188+
# '**': [
189+
# 'globaltoc.html',
190+
# 'relations.html',
191+
# 'searchbox.html',
192+
# ]
193+
#}
175194

176195
# Alabaster
177-
html_sidebars = {
178-
'**': [
179-
'about.html',
180-
'navigation.html',
181-
'relations.html',
182-
'searchbox.html',
183-
'donate.html',
184-
]
185-
}
196+
#html_sidebars = {
197+
# '**': [
198+
# 'about.html',
199+
# 'navigation.html',
200+
# 'relations.html',
201+
# 'searchbox.html',
202+
# ]
203+
#}
186204

187205
# Additional templates that should be rendered to pages, maps page names to
188206
# template names.
18.1 KB
Loading

0 commit comments

Comments
 (0)