Update RtD and Sphinx configuration (#38046)

This commit is contained in:
Massimiliano Culpo 2023-06-05 17:39:11 +02:00 committed by GitHub
parent 5840a00000
commit e483762015
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 43 deletions

View file

@ -5,3 +5,8 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: "daily" interval: "daily"
# Requirements to build documentation
- package-ecosystem: "pip"
directory: "/lib/spack/docs"
schedule:
interval: "daily"

View file

@ -1,10 +1,16 @@
version: 2 version: 2
build:
os: "ubuntu-22.04"
apt_packages:
- graphviz
tools:
python: "3.11"
sphinx: sphinx:
configuration: lib/spack/docs/conf.py configuration: lib/spack/docs/conf.py
fail_on_warning: true fail_on_warning: true
python: python:
version: 3.7
install: install:
- requirements: lib/spack/docs/requirements.txt - requirements: lib/spack/docs/requirements.txt

View file

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

View file

@ -149,7 +149,6 @@ def setup(sphinx):
# Get nice vector graphics # Get nice vector graphics
graphviz_output_format = "svg" graphviz_output_format = "svg"
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"] templates_path = ["_templates"]
@ -233,30 +232,8 @@ def setup(sphinx):
# If true, sectionauthor and moduleauthor directives will be shown in the # If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default. # output. They are ignored by default.
# show_authors = False # show_authors = False
sys.path.append("./_pygments")
# The name of the Pygments (syntax highlighting) style to use. pygments_style = "style.SpackStyle"
# We use our own extension of the default style with a few modifications
from pygments.style import Style
from pygments.styles.default import DefaultStyle
from pygments.token import Comment, Generic, Text
class SpackStyle(DefaultStyle):
styles = DefaultStyle.styles.copy()
background_color = "#f4f4f8"
styles[Generic.Output] = "#355"
styles[Generic.Prompt] = "bold #346ec9"
import pkg_resources
dist = pkg_resources.Distribution(__file__)
sys.path.append(".") # make 'conf' module findable
ep = pkg_resources.EntryPoint.parse("spack = conf:SpackStyle", dist=dist)
dist._ep_map = {"pygments.styles": {"plugin1": ep}}
pkg_resources.working_set.add(dist)
pygments_style = "spack"
# A list of ignored prefixes for module index sorting. # A list of ignored prefixes for module index sorting.
# modindex_common_prefix = [] # modindex_common_prefix = []
@ -341,16 +318,15 @@ class SpackStyle(DefaultStyle):
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = "Spackdoc" htmlhelp_basename = "Spackdoc"
# -- Options for LaTeX output -------------------------------------------------- # -- Options for LaTeX output --------------------------------------------------
latex_elements = { latex_elements = {
# The paper size ('letterpaper' or 'a4paper'). # The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper', # 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt'). # The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt', # 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble. # Additional stuff for the LaTeX preamble.
#'preamble': '', # 'preamble': '',
} }
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples

View file

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