Skip to content

Commit

Permalink
readthedoc: migrate to build.os (cea-hpc#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiell committed Sep 18, 2023
1 parent 1b96fdc commit 3da6008
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
8 changes: 8 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
version: 2
build:
os: "ubuntu-22.04"
tools:
python: "3.11"

sphinx:
configuration: doc/sphinx/conf.py
fail_on_warning: true

python:
install:
Expand Down
18 changes: 6 additions & 12 deletions doc/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc']
extensions = ['sphinx.ext.autodoc', 'sphinx_rtd_theme']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -86,20 +86,13 @@
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []

os_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if os_rtd:
html_theme = 'default'
else:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]


# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#html_theme = 'default'
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 All @@ -118,7 +111,7 @@

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = 'clustershell-nautilus-logo200.png'
html_logo = '_static/clustershell-nautilus-logo200.png'

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand All @@ -131,8 +124,9 @@
html_static_path = ['_static']

def setup(app):
# RTD does not line wrap CSV tables, so we override this behavior.
app.add_stylesheet("theme_overrides.css")
if 'READTHEDOCS' in os.environ:
# RTD does not line wrap CSV tables, so we override this behavior.
app.add_stylesheet("theme_overrides.css")

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down

0 comments on commit 3da6008

Please sign in to comment.