summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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 = []