Skip to content

Commit 1c5302b

Browse files
committed
Fix conf.py and add requirements.txt for Read the Docs
1 parent def673f commit 1c5302b

3 files changed

Lines changed: 30 additions & 102 deletions

File tree

.readthedocs.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ build:
1414
sphinx:
1515
configuration: docs/conf.py
1616

17-
# Optionally, but recommended,
18-
# declare the Python requirements required to build your documentation
19-
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20-
# python:
21-
# install:
22-
# - requirements: docs/requirements.txt
23-
17+
# Declare the Python requirements required to build your documentation
18+
python:
19+
install:
20+
- requirements: docs/requirements.txt

docs/conf.py

Lines changed: 23 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -4,121 +4,49 @@
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
55

66
# -- Project information -----------------------------------------------------
7-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8-
9-
project = 'learning-python'
10-
copyright = '2025, v.skolan'
11-
author = 'v.skolan'
12-
13-
# -- General configuration ---------------------------------------------------
14-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15-
16-
import recommonmark
17-
from recommonmark.transform import AutoStructify
18-
19-
extensions = [
20-
'recommonmark',
21-
]
22-
# Configuration file for the Sphinx documentation builder.
23-
#
24-
# For the full list of built-in configuration values, see the documentation:
25-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
26-
27-
# -- Project information -----------------------------------------------------
28-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
29-
307
project = 'learning-python'
318
copyright = '2025, v.skolan'
329
author = 'v.skolan'
3310

3411
# -- General configuration ---------------------------------------------------
35-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
36-
37-
extensions = [
38-
'recommonmark',
39-
]
40-
html_theme = 'sphinx_rtd_theme'
41-
html_theme_path = ["_themes"]
42-
# Configuration file for the Sphinx documentation builder.
43-
#
44-
# For the full list of built-in configuration values, see the documentation:
45-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
46-
47-
# -- Project information -----------------------------------------------------
48-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
49-
50-
project = 'learning-python'
51-
copyright = '2025, v.skolan'
52-
author = 'v.skolan'
12+
import sys
13+
import os
5314

54-
# -- General configuration ---------------------------------------------------
55-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15+
# Add path to extensions
16+
sys.path.append(os.path.abspath('.'))
5617

5718
extensions = [
5819
'recommonmark',
5920
'sphinx_rtd_theme',
6021
]
61-
html_theme = 'sphinx_rtd_theme'
62-
html_theme_path = ["_themes"]
63-
# Configuration file for the Sphinx documentation builder.
64-
#
65-
# For the full list of built-in configuration values, see the documentation:
66-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6722

68-
# -- Project information -----------------------------------------------------
69-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
23+
# Add source file types
24+
source_suffix = {
25+
'.rst': 'restructuredtext',
26+
'.md': 'markdown',
27+
}
7028

71-
project = 'learning-python'
72-
copyright = '2025, v.skolan'
73-
author = 'v.skolan'
74-
75-
# -- General configuration ---------------------------------------------------
76-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
77-
78-
extensions = [
79-
'recommonmark',
80-
'sphinx_rtd_theme',
81-
]
82-
html_theme = 'sphinx_rtd_theme'
83-
html_theme_path = ["_themes"]
84-
source_suffix = ['.rst', '.md']
85-
# Configuration file for the Sphinx documentation builder.
86-
#
87-
# For the full list of built-in configuration values, see the documentation:
88-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
29+
# The master toctree document
30+
master_doc = 'index'
8931

90-
# -- Project information -----------------------------------------------------
91-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
92-
93-
project = 'learning-python'
94-
copyright = '2025, v.skolan'
95-
author = 'v.skolan'
32+
templates_path = ['_templates']
33+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
9634

97-
# -- General configuration ---------------------------------------------------
98-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
35+
# Language settings
36+
language = 'de'
9937

100-
extensions = [
101-
'recommonmark',
102-
'sphinx_rtd_theme',
103-
]
38+
# -- Options for HTML output -------------------------------------------------
10439
html_theme = 'sphinx_rtd_theme'
105-
html_theme_path = ["_themes"]
106-
source_suffix = ['.rst', '.md']
40+
html_static_path = ['_static']
10741

42+
# -- Extension configuration -------------------------------------------------
10843
def setup(app):
44+
from recommonmark.transform import AutoStructify
10945
app.add_config_value('recommonmark_config', {
11046
'enable_eval_rst': True,
111-
'auto_toc_tree_depth': 2,
47+
'auto_toc_tree_section': 'Contents',
48+
'enable_math': True,
49+
'enable_inline_math': True,
50+
'enable_auto_doc_ref': True,
11251
}, True)
11352
app.add_transform(AutoStructify)
114-
115-
templates_path = ['_templates']
116-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
117-
118-
language = 'de'
119-
120-
# -- Options for HTML output -------------------------------------------------
121-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
122-
123-
html_theme = 'alabaster'
124-
html_static_path = ['_static']

docs/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sphinx>=4.0,<8.0
2+
recommonmark>=0.5.0
3+
sphinx-rtd-theme>=1.0.0

0 commit comments

Comments
 (0)