Skip to content

Commit

Permalink
Fix RTD (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven authored Nov 17, 2023
1 parent a6d36ea commit 044ff2e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 27 deletions.
3 changes: 1 addition & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ sphinx:
# we need mpi-sppy for automodule
python:
install:
- method: setuptools
path: .
- requirements: requirements-doc.txt
28 changes: 4 additions & 24 deletions doc/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -97,29 +97,9 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'alabaster'
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Override default css to get a larger width for local build
def setup(app):
app.add_css_file('theme_overrides.css')
html_context = {
'css_files': [
'_static/theme_overrides.css',
],
}
else:
html_context = {
'css_files': [
'https://media.readthedocs.org/css/sphinx_rtd_theme.css',
'https://media.readthedocs.org/css/readthedocs-doc-embed.css',
'_static/theme_overrides.css',
],
}
html_theme = 'sphinx_rtd_theme'



# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
1 change: 1 addition & 0 deletions doc/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ MPI is used.
output_solutions.rst
access_solutions.rst
extensions.rst
aph.rst
zhat.rst
confidence_intervals.rst
seqsamp.rst
Expand Down
2 changes: 2 additions & 0 deletions requirements-doc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# use setup.py
.[doc]
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,11 @@
'numpy',
'scipy',
'pyomo>=6.4',
]
],
extras_require={
'doc': [
'sphinx_rtd_theme',
'sphinx',
]
},
)

0 comments on commit 044ff2e

Please sign in to comment.