Skip to content

Commit

Permalink
Merge pull request #7423 from Obihoernchen/readthedocs
Browse files Browse the repository at this point in the history
Fix and improve readthedocs docu
  • Loading branch information
Obihoernchen committed Feb 13, 2024
2 parents 65b5c72 + c120fd9 commit a5929c9
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 20 deletions.
29 changes: 29 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
13 changes: 2 additions & 11 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,9 @@ The xCAT docs are hosted here: https://xcat-docs.readthedocs.io/ and are written

* Clone this project

* Install or update sphinx (See: https://pip.readthedocs.io/)
* Install dependencies (See: https://pip.readthedocs.io/)
```
pip install sphinx
```
or
```
pip install sphinx --upgrade
```

* Install ReadTheDocs theme
```
pip install sphinx_rtd_theme
pip install --user -r requirements.txt
```

* Build the Docs
Expand Down
5 changes: 4 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
docutils==0.17
sphinx==7.2.6
sphinx_rtd_theme==2.0.0
docutils==0.20.1
readthedocs-sphinx-search==0.3.2
12 changes: 4 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx_search.extension',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -66,7 +67,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'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -144,13 +145,8 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
html_theme = 'default'
else:
# some of the popular themes: alabaster, sphinx_rtd_theme, classic, nature
html_theme = 'sphinx_rtd_theme'
# some of the popular themes: alabaster, sphinx_rtd_theme, classic, nature
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

0 comments on commit a5929c9

Please sign in to comment.