Skip to content

Commit 0a70fa8

Browse files
authored
Fix the documentation setup for readthedocs (#88)
2 parents 63dd072 + db4f149 commit 0a70fa8

9 files changed

+46
-21
lines changed

.readthedocs.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
version: 2
3+
4+
# Set the OS, Python version and other tools you might need
5+
build:
6+
os: ubuntu-22.04
7+
tools:
8+
python: "3.12"
9+
10+
# Build documentation in the "doc/" directory with Sphinx
11+
sphinx:
12+
configuration: doc/conf.py
13+
14+
# Define the requirements required to build the documentation
15+
python:
16+
install:
17+
- requirements: doc/requirements.txt

cmake/FindFFTW.cmake

+12-9
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,20 @@
2222
# Search procedure
2323
# ----------------
2424
#
25-
# 1) FFTW_LIBRARIES and FFTW_INCLUDE_DIRS set by user
26-
# --> Nothing is searched and these variables are used instead
25+
# * FFTW_LIBRARIES and FFTW_INCLUDE_DIRS set by user
26+
#
27+
# * Nothing is searched and these variables are used instead
2728
#
28-
# 2) Find MKL implementation via FFTW_ENABLE_MKL
29-
# --> If FFTW_ENABLE_MKL is explicitely set to ON, only MKL is considered
30-
# If FFTW_ENABLE_MKL is explictely set to OFF, MKL will not be considered
31-
# If FFTW_ENABLE_MKL is undefined, MKL is preferred unless ENABLE_MKL is explicitely set to OFF
32-
# --> MKLROOT environment variable helps to detect MKL (See FindMKL.cmake)
29+
# * Find MKL implementation via FFTW_ENABLE_MKL
3330
#
34-
# 3) Find official FFTW impelementation
35-
# --> FFTW_ROOT variable / environment variable helps to detect FFTW
31+
# * If FFTW_ENABLE_MKL is explicitely set to ON, only MKL is considered
32+
# * If FFTW_ENABLE_MKL is explictely set to OFF, MKL will not be considered
33+
# * If FFTW_ENABLE_MKL is undefined, MKL is preferred unless ENABLE_MKL is explicitely set to OFF
34+
# * Note: MKLROOT environment variable helps to detect MKL (See FindMKL.cmake)
35+
#
36+
# * Find official FFTW impelementation
37+
#
38+
# * FFTW_ROOT variable / environment variable helps to detect FFTW
3639
#
3740
# Components
3841
# ----------

cmake/ecbuild_add_lang_flags.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#.rst:
1111
#
1212
# ecbuild_add_lang_flags
13-
# =====================
13+
# ======================
1414
#
1515
# This is mostly an internal function of ecbuild, wrapped by the macros ecbuild_add_c_flags,
1616
# ecbuild_add_cxx_flags and ecbuild_add_fortran_flags.

cmake/ecbuild_compiler_flags.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ endmacro()
7676
#.rst:
7777
#
7878
# ecbuild_purge_compiler_flags
79-
# ======================
79+
# ============================
8080
#
8181
# Purge compiler flags for a given language ::
8282
#
@@ -156,7 +156,7 @@ endmacro()
156156
#.rst:
157157
#
158158
# ecbuild_override_compiler_flags
159-
# ======================
159+
# ===============================
160160
#
161161
# Purge existing CMAKE_<lang>_FLAGS flags and trigger the use of per source
162162
# file overrideable flags (see ``Using custom compilation flags`` for an

cmake/ecbuild_find_package.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@
111111
# - ``ENV{<name>_DIR}``
112112
# - ``ENV{CMAKE_PREFIX_PATH}``
113113
# - ``system paths``
114-
# See CMake documentation of ``find_package()`` for details on search
114+
#
115+
# See CMake documentation of ``find_package()`` for details.
115116
#
116117
# 4. Fail if the package was not found and is REQUIRED.
117118
#

cmake/ecbuild_find_package_search_hints.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
# If CMake version < 3.12:
4242
# If <name>_DIR not defined in scope or environment, but <name>_ROOT IS defined in scope or environment
4343
# Try setting <name>_DIR to a valid cmake-dir deduced from <name>_ROOT.
44+
#
4445
# Warning: Deduction is not feature-complete (it could be improved, but should now cover 99% of cases)
4546
# It is advised to use CMake 3.12 instead.
4647
#

doc/cmake.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
CMakeLexer.tokens["args"].append(('(\\$<)(.+?)(>)',
2222
bygroups(Operator, Name.Variable, Operator)))
2323

24+
2425
# Monkey patch for sphinx generating invalid content for qcollectiongenerator
2526
# https://bitbucket.org/birkenfeld/sphinx/issue/1435/qthelp-builder-should-htmlescape-keywords
26-
from sphinx.util.pycompat import htmlescape
27-
from sphinx.builders.qthelp import QtHelpBuilder
27+
import html
28+
from sphinxcontrib.qthelp import QtHelpBuilder
2829
old_build_keywords = QtHelpBuilder.build_keywords
2930

3031

@@ -35,7 +36,7 @@ def new_build_keywords(self, title, refs, subitems):
3536
before, rest = item.split("ref=\"", 1)
3637
ref, after = rest.split("\"")
3738
if ("<" in ref and ">" in ref):
38-
new_items.append(before + 'ref="' + htmlescape(ref) + '"' + after)
39+
new_items.append(before + 'ref="' + html.escape(ref) + '"' + after)
3940
else:
4041
new_items.append(item)
4142
return new_items

doc/conf.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,11 @@ def parse_version(ver_str):
4242

4343
html_show_sourcelink = True
4444
html_static_path = [os.path.join(here, 'static')]
45-
html_theme = 'default'
45+
html_theme = 'sphinx_rtd_theme'
4646
html_title = 'ecBuild %s Documentation' % release
4747
html_short_title = '%s Documentation' % release
4848
html_favicon = os.path.join(here, 'static', 'ecbuild.ico')
49-
# Not supported yet by sphinx:
50-
# https://bitbucket.org/birkenfeld/sphinx/issue/1448/make-qthelp-more-configurable
51-
# qthelp_namespace = "org.cmake"
52-
# qthelp_qch_name = "CMake-300.qch"
49+
5350

5451
# Extract the docs from the .cmake files
5552
from generate import generate

doc/requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These are the requirements for readthedoc
2+
docutils
3+
Sphinx>=4.4.0
4+
setuptools>=51.0.0
5+
sphinx-rtd-theme>=0.5.0

0 commit comments

Comments
 (0)