From be1c7913b78568b2750854168e84f1de35149c39 Mon Sep 17 00:00:00 2001 From: David Meyer Date: Thu, 18 Jan 2024 20:39:29 -0500 Subject: [PATCH] Modernize RTD build --- docs/source/conf.py | 22 +++------------------- readthedocs.yaml | 10 +++++++--- setup.cfg | 8 +++----- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 93b69f8..403ebbf 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,8 +13,6 @@ import copy 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) ------------------------------------- @@ -47,7 +45,7 @@ "sphinx.ext.todo", "sphinx.ext.viewcode", "sphinx_rtd_theme", - "recommonmark", + "myst_parser", ] autodoc_typehints = 'description' @@ -73,6 +71,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'] @@ -211,23 +210,8 @@ # Customize the html_theme html_theme_options = {'navigation_depth': 3} -# 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 diff --git a/readthedocs.yaml b/readthedocs.yaml index 35084d6..4f8b68e 100644 --- a/readthedocs.yaml +++ b/readthedocs.yaml @@ -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 @@ -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 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 399299e..920ba4d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,11 +41,9 @@ 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 [options.package_data] labscript_profile = ../labscript-suite.pth pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy