From adc6706a88d31f16e6983ce7d25114deeb2d0089 Mon Sep 17 00:00:00 2001 From: Artem Pelenitsyn Date: Fri, 3 Jun 2022 21:33:39 -0400 Subject: [PATCH 1/2] docs: allow TOC items uncollapse without jump between pages --- doc/conf.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index cbdfbbc850c..b99d78e251c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -57,9 +57,13 @@ # on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' -if not on_rtd: # only import and set the theme if we're building docs locally +html_theme = 'sphinx_rtd_theme' +# only import the theme if we're building docs locally +if on_rtd: + html_style = None + using_rtd_theme = True +else: import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # The name for this set of Sphinx documents. If None, it defaults to @@ -81,6 +85,9 @@ "conf_py_path": "doc/", "source_suffix": '.rst', } +html_theme_options = { + 'collapse_navigation': False, +} # If true, an OpenSearch description file will be output, and all pages will From 3de4b62aaf353ff5d915b763dea12c3c1da24895 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Tue, 7 Jun 2022 17:04:19 +0200 Subject: [PATCH 2/2] upgrade Sphinx >= 5 fix warnings: update extlinks format to Sphinx 5 --- doc/conf.py | 8 ++++---- doc/requirements.in | 4 ++-- doc/requirements.txt | 9 +++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index b99d78e251c..186612170dc 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -28,12 +28,12 @@ # extlinks -- see http://www.sphinx-doc.org/en/stable/ext/extlinks.html extlinks = { - 'issue': ('https://github.com/haskell/cabal/issues/%s', '#'), + 'issue': ('https://github.com/haskell/cabal/issues/%s', 'issue #%s'), - 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/-/wikis/%s', ''), - 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/-/issues/%s', 'GHC #'), + 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/-/wikis/%s', '%s'), + 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/-/issues/%s', 'GHC issue #%s'), - 'hackage-pkg': ('http://hackage.haskell.org/package/%s', ''), + 'hackage-pkg': ('http://hackage.haskell.org/package/%s', '%s'), } # General information about the project. diff --git a/doc/requirements.in b/doc/requirements.in index 585618166d3..e82fb9f1f0e 100644 --- a/doc/requirements.in +++ b/doc/requirements.in @@ -1,5 +1,5 @@ -sphinx >= 3.1 -sphinx_rtd_theme +sphinx >= 5 +sphinx_rtd_theme >= 1 sphinx-jsonschema # Pygments>=2.7.4 suggested by CVE-2021-20270 CVE-2021-27291 Pygments >= 2.7.4 diff --git a/doc/requirements.txt b/doc/requirements.txt index f399f4c10c6..42a40844c61 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -21,6 +21,8 @@ idna==2.10 # via requests imagesize==1.2.0 # via sphinx +importlib-metadata==4.11.4 + # via sphinx jinja2==2.11.3 # via sphinx jsonpointer==2.1 @@ -45,7 +47,7 @@ requests==2.26.0 # sphinx-jsonschema snowballstemmer==2.1.0 # via sphinx -sphinx==4.2.0 +sphinx==5.0.1 # via # -r requirements.in # sphinx-rtd-theme @@ -67,6 +69,5 @@ sphinxcontrib-serializinghtml==1.1.5 # via sphinx urllib3==1.26.7 # via requests - -# The following packages are considered to be unsafe in a requirements file: -# setuptools +zipp==3.8.0 + # via importlib-metadata