summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2019-11-12 18:18:41 -0800
committerAxel Huebl <axel.huebl@plasma.ninja>2019-11-12 18:18:41 -0800
commitda386b560a322e5ba9ca38e9b40b7044ceea8354 (patch)
tree0d452434af2e55c68ab30d1f786fbfe4b55a417c /lib
parentd0de9f8d9de623e76f545d1d6f7dedd46571a232 (diff)
downloadspack-da386b560a322e5ba9ca38e9b40b7044ceea8354.tar.gz
spack-da386b560a322e5ba9ca38e9b40b7044ceea8354.tar.bz2
spack-da386b560a322e5ba9ca38e9b40b7044ceea8354.tar.xz
spack-da386b560a322e5ba9ca38e9b40b7044ceea8354.zip
docs: use nicer looking code blocks in docs (#13708)
- [x] Use higher contrast terminal output font - [x] Use higher contrast code block background color than default - [x] Use a noticeable prompt character See also https://github.com/spack/spack-tutorial/pull/10.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/docs/conf.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py
index e5305a9317..06b993efb5 100644
--- a/lib/spack/docs/conf.py
+++ b/lib/spack/docs/conf.py
@@ -176,7 +176,25 @@ exclude_patterns = ['_build', '_spack_root', '.spack-env']
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
+# 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 Generic, Comment, 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.
#modindex_common_prefix = []