Skip to content

Commit 047c214

Browse files
authored
Merge pull request #101 from dihm/rtd_builds
Modernize RTD build
2 parents 5186769 + 29f0fea commit 047c214

File tree

3 files changed

+13
-27
lines changed

3 files changed

+13
-27
lines changed

docs/source/conf.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
import copy
1414
import os
1515
from pathlib import Path
16-
from m2r import MdInclude
17-
from recommonmark.transform import AutoStructify
1816
from jinja2 import FileSystemLoader, Environment
1917

2018
# -- Project information (unique to each project) -------------------------------------
@@ -47,7 +45,7 @@
4745
"sphinx.ext.todo",
4846
"sphinx.ext.viewcode",
4947
"sphinx_rtd_theme",
50-
"recommonmark",
48+
"myst_parser",
5149
]
5250

5351
autodoc_typehints = 'description'
@@ -74,6 +72,7 @@
7472

7573
# Prefix each autosectionlabel with the name of the document it is in and a colon
7674
autosectionlabel_prefix_document = True
75+
myst_heading_anchors = 2
7776

7877
# Add any paths that contain templates here, relative to this directory.
7978
templates_path = ['_templates']
@@ -212,23 +211,8 @@
212211
# Customize the html_theme
213212
html_theme_options = {'navigation_depth': 3}
214213

215-
# Use m2r only for mdinclude and recommonmark for everything else
216-
# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992
217214
def setup(app):
218-
config = {
219-
# 'url_resolver': lambda url: github_doc_root + url,
220-
'auto_toc_tree_section': 'Contents',
221-
'enable_eval_rst': True,
222-
}
223-
app.add_config_value('recommonmark_config', config, True)
224-
app.add_transform(AutoStructify)
225-
226-
# from m2r to make `mdinclude` work
227-
app.add_config_value('no_underscore_emphasis', False, 'env')
228-
app.add_config_value('m2r_parse_relative_links', False, 'env')
229-
app.add_config_value('m2r_anonymous_references', False, 'env')
230-
app.add_config_value('m2r_disable_inline_math', False, 'env')
231-
app.add_directive('mdinclude', MdInclude)
215+
232216
app.add_css_file('custom.css')
233217

234218
# generate the components.rst file dynamically so it points to stable/latest

readthedocs.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
# Required
55
version: 2
66

7+
# Set build environment options
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.11"
12+
713
# Build documentation in the docs/ directory with Sphinx
814
sphinx:
915
builder: dirhtml
@@ -15,13 +21,11 @@ formats:
1521
- pdf
1622
- epub
1723

18-
# Optionally set the version of Python and requirements required to build your docs
24+
# Optionally set the requirements required to build your docs
1925
python:
20-
version: 3.7
2126
install:
2227
- method: pip
2328
path: .
2429
extra_requirements:
2530
- docs
26-
system_packages: true
2731

setup.cfg

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ gui_scripts =
4545
pyqt = PyQt5
4646
docs =
4747
PyQt5
48-
Sphinx==4.4.0
49-
sphinx-rtd-theme==0.5.2
50-
recommonmark==0.6.0
51-
m2r==0.2.1
52-
mistune<2.0.0
48+
Sphinx==7.2.6
49+
sphinx-rtd-theme==2.0.0
50+
myst_parser==2.0.0

0 commit comments

Comments
 (0)