Skip to content

Commit

Permalink
Merge pull request #111 from dihm/update_RTD
Browse files Browse the repository at this point in the history
Fix deprecated config for RTD builds.
  • Loading branch information
dihm committed Jan 16, 2024
2 parents e1f3d32 + 86c8566 commit 019dc2d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
20 changes: 3 additions & 17 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#
import os
from pathlib import Path
from m2r import MdInclude
from recommonmark.transform import AutoStructify
from jinja2 import FileSystemLoader, Environment

# -- Project information (unique to each project) -------------------------------------
Expand Down Expand Up @@ -46,7 +44,7 @@
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx_rtd_theme",
"recommonmark",
"myst_parser",
]

autodoc_typehints = 'description'
Expand All @@ -55,6 +53,7 @@

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

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -203,20 +202,7 @@
# Use m2r only for mdinclude and recommonmark for everything else
# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992
def setup(app):
config = {
# 'url_resolver': lambda url: github_doc_root + url,
'auto_toc_tree_section': 'Contents',
'enable_eval_rst': True,
}
app.add_config_value('recommonmark_config', config, True)
app.add_transform(AutoStructify)

# from m2r to make `mdinclude` work
app.add_config_value('no_underscore_emphasis', False, 'env')
app.add_config_value('m2r_parse_relative_links', False, 'env')
app.add_config_value('m2r_anonymous_references', False, 'env')
app.add_config_value('m2r_disable_inline_math', False, 'env')
app.add_directive('mdinclude', MdInclude)

app.add_css_file('custom.css')

# generate the components.rst file dynamically so it points to stable/latest
Expand Down
10 changes: 7 additions & 3 deletions readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
# Required
version: 2

# Set build environment options
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: dirhtml
Expand All @@ -15,13 +21,11 @@ formats:
- pdf
- epub

# Optionally set the version of Python and requirements required to build your docs
# Optionally set the requirements required to build your docs
python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- docs
system_packages: true

8 changes: 3 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ install_requires =
[options.extras_require]
docs =
PyQt5
Sphinx==4.4.0
sphinx-rtd-theme==0.5.2
recommonmark==0.6.0
m2r==0.2.1
mistune<2.0.0
Sphinx==7.2.6
sphinx-rtd-theme==2.0.0
myst_parser==2.0.0

0 comments on commit 019dc2d

Please sign in to comment.