Skip to content

Commit e483762

Browse files
authored
Update RtD and Sphinx configuration (spack#38046)
1 parent 5840a00 commit e483762

File tree

5 files changed

+41
-43
lines changed

5 files changed

+41
-43
lines changed

.github/dependabot.yml

+5
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "daily"
8+
# Requirements to build documentation
9+
- package-ecosystem: "pip"
10+
directory: "/lib/spack/docs"
11+
schedule:
12+
interval: "daily"

.readthedocs.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
version: 2
22

3+
build:
4+
os: "ubuntu-22.04"
5+
apt_packages:
6+
- graphviz
7+
tools:
8+
python: "3.11"
9+
310
sphinx:
411
configuration: lib/spack/docs/conf.py
512
fail_on_warning: true
613

714
python:
8-
version: 3.7
915
install:
1016
- requirements: lib/spack/docs/requirements.txt

lib/spack/docs/_pygments/style.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
2+
# Spack Project Developers. See the top-level COPYRIGHT file for details.
3+
#
4+
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
5+
6+
# The name of the Pygments (syntax highlighting) style to use.
7+
# We use our own extension of the default style with a few modifications
8+
from pygments.styles.default import DefaultStyle
9+
from pygments.token import Generic
10+
11+
12+
class SpackStyle(DefaultStyle):
13+
styles = DefaultStyle.styles.copy()
14+
background_color = "#f4f4f8"
15+
styles[Generic.Output] = "#355"
16+
styles[Generic.Prompt] = "bold #346ec9"

lib/spack/docs/conf.py

+5-29
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ def setup(sphinx):
149149
# Get nice vector graphics
150150
graphviz_output_format = "svg"
151151

152-
153152
# Add any paths that contain templates here, relative to this directory.
154153
templates_path = ["_templates"]
155154

@@ -233,30 +232,8 @@ def setup(sphinx):
233232
# If true, sectionauthor and moduleauthor directives will be shown in the
234233
# output. They are ignored by default.
235234
# show_authors = False
236-
237-
# The name of the Pygments (syntax highlighting) style to use.
238-
# We use our own extension of the default style with a few modifications
239-
from pygments.style import Style
240-
from pygments.styles.default import DefaultStyle
241-
from pygments.token import Comment, Generic, Text
242-
243-
244-
class SpackStyle(DefaultStyle):
245-
styles = DefaultStyle.styles.copy()
246-
background_color = "#f4f4f8"
247-
styles[Generic.Output] = "#355"
248-
styles[Generic.Prompt] = "bold #346ec9"
249-
250-
251-
import pkg_resources
252-
253-
dist = pkg_resources.Distribution(__file__)
254-
sys.path.append(".") # make 'conf' module findable
255-
ep = pkg_resources.EntryPoint.parse("spack = conf:SpackStyle", dist=dist)
256-
dist._ep_map = {"pygments.styles": {"plugin1": ep}}
257-
pkg_resources.working_set.add(dist)
258-
259-
pygments_style = "spack"
235+
sys.path.append("./_pygments")
236+
pygments_style = "style.SpackStyle"
260237

261238
# A list of ignored prefixes for module index sorting.
262239
# modindex_common_prefix = []
@@ -341,16 +318,15 @@ class SpackStyle(DefaultStyle):
341318
# Output file base name for HTML help builder.
342319
htmlhelp_basename = "Spackdoc"
343320

344-
345321
# -- Options for LaTeX output --------------------------------------------------
346322

347323
latex_elements = {
348324
# The paper size ('letterpaper' or 'a4paper').
349-
#'papersize': 'letterpaper',
325+
# 'papersize': 'letterpaper',
350326
# The font size ('10pt', '11pt' or '12pt').
351-
#'pointsize': '10pt',
327+
# 'pointsize': '10pt',
352328
# Additional stuff for the LaTeX preamble.
353-
#'preamble': '',
329+
# 'preamble': '',
354330
}
355331

356332
# Grouping the document tree into LaTeX files. List of tuples

lib/spack/docs/requirements.txt

+8-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
# These dependencies should be installed using pip in order
2-
# to build the documentation.
3-
4-
sphinx>=3.4,!=4.1.2,!=5.1.0
5-
sphinxcontrib-programoutput
6-
sphinx-design
7-
sphinx-rtd-theme
8-
python-levenshtein
9-
# Restrict to docutils <0.17 to workaround a list rendering issue in sphinx.
10-
# https://stackoverflow.com/questions/67542699
11-
docutils <0.17
12-
pygments <2.13
13-
urllib3 <2
1+
sphinx==6.2.1
2+
sphinxcontrib-programoutput==0.17
3+
sphinx_design==0.4.1
4+
sphinx-rtd-theme==1.2.1
5+
python-levenshtein==0.21.0
6+
docutils==0.18.1
7+
pygments==2.15.1
8+
urllib3==2.0.2

0 commit comments

Comments
 (0)