Skip to content

Commit b9164fb

Browse files
authored
Merge pull request #111 from dihm/rtd_build
Modernize RTD build
2 parents 418d78a + 3363c05 commit b9164fb

File tree

3 files changed

+13
-26
lines changed

3 files changed

+13
-26
lines changed

docs/source/conf.py

+3-19
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
try:
2018
import importlib.metadata as importlib_metadata
@@ -51,7 +49,7 @@
5149
"sphinx.ext.todo",
5250
"sphinx.ext.viewcode",
5351
"sphinx_rtd_theme",
54-
"recommonmark",
52+
"myst_parser",
5553
]
5654

5755
autodoc_typehints = 'description'
@@ -108,6 +106,7 @@ def set_process_name(self,*args,**kwargs):
108106

109107
# Prefix each autosectionlabel with the name of the document it is in and a colon
110108
autosectionlabel_prefix_document = True
109+
myst_heading_anchors = 2
111110

112111
# Add any paths that contain templates here, relative to this directory.
113112
templates_path = ['_templates']
@@ -246,23 +245,8 @@ def set_process_name(self,*args,**kwargs):
246245
# Customize the html_theme
247246
html_theme_options = {'navigation_depth': 3}
248247

249-
# Use m2r only for mdinclude and recommonmark for everything else
250-
# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992
251248
def setup(app):
252-
config = {
253-
# 'url_resolver': lambda url: github_doc_root + url,
254-
'auto_toc_tree_section': 'Contents',
255-
'enable_eval_rst': True,
256-
}
257-
app.add_config_value('recommonmark_config', config, True)
258-
app.add_transform(AutoStructify)
259-
260-
# from m2r to make `mdinclude` work
261-
app.add_config_value('no_underscore_emphasis', False, 'env')
262-
app.add_config_value('m2r_parse_relative_links', False, 'env')
263-
app.add_config_value('m2r_anonymous_references', False, 'env')
264-
app.add_config_value('m2r_disable_inline_math', False, 'env')
265-
app.add_directive('mdinclude', MdInclude)
249+
266250
app.add_css_file('custom.css')
267251

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

readthedocs.yaml

+7-2
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,9 +21,8 @@ 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: .

setup.cfg

+3-5
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ gui_scripts =
4646
pyqt = PyQt5
4747
docs =
4848
PyQt5
49-
Sphinx==4.4.0
50-
sphinx-rtd-theme==0.5.2
51-
recommonmark==0.6.0
52-
m2r==0.2.1
53-
mistune<2.0.0
49+
Sphinx==7.2.6
50+
sphinx-rtd-theme==2.0.0
51+
myst_parser==2.0.0

0 commit comments

Comments
 (0)