From c64cc8e43ca41ef1e9eae71073f0b696538e3dc3 Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Tue, 21 Aug 2018 20:49:16 -0700 Subject: [PATCH] Use witchhazel pygments theme --- docs/conf.py | 4 +- docs/config.rst | 2 +- docs/witchhazel.py | 99 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 docs/witchhazel.py diff --git a/docs/conf.py b/docs/conf.py index 87b4dc96..ab3d6ac1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,6 +23,7 @@ # possibility it's installed as a bytecode-compiled binary (.egg). So, # include the source anyway. sys.path.insert(0, os.path.abspath('..')) +sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ @@ -98,7 +99,7 @@ #show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'witchhazel.WitchHazelStyle' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] @@ -132,6 +133,7 @@ 'font_family': "'Roboto', Georgia, sans", 'head_font_family': "'Roboto', Georgia, serif", 'code_font_family': "'Roboto Mono', 'Consolas', monospace", + 'pre_bg': '#433e56' } # Add any paths that contain custom themes here, relative to this directory. diff --git a/docs/config.rst b/docs/config.rst index a96ea048..355e59b3 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -63,7 +63,7 @@ Will produce these sessions:: Note that this expansion happens *before* parameterization occurs, so you can still parametrize sessions with multiple interpreters. -If you want to disable virtualenv creation altogether, you can set ``python`` to ``False``: +If you want to disable virtualenv creation altogether, you can set ``python`` to ``False``:: @nox.session(python=False) def tests(session): diff --git a/docs/witchhazel.py b/docs/witchhazel.py new file mode 100644 index 00000000..2fc44f69 --- /dev/null +++ b/docs/witchhazel.py @@ -0,0 +1,99 @@ +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, Text, \ + Number, Operator, Generic, Whitespace, Punctuation, Other, Literal + + +LILAC = '#ceb1ff' +TORQUOISE = '#1bc5e0' + + +class WitchHazelStyle(Style): + """ + This style is a witchy theme based on sailorhg's fairyfloss + https://github.com/sailorhg/fairyfloss/blob/gh-pages/fairyfloss.tmTheme + """ + + background_color = "#433e56" + highlight_color = "#716799" + + styles = { + # No corresponding class for the following: + Text: "#F8F8F2", # class: '' + Whitespace: "#A8757B", # class: 'w' + Error: "#960050 bg:#1e0010", # class: 'err' + Other: "", # class 'x' + + Comment: "#b0bec5", # class: 'c' + Comment.Multiline: "", # class: 'cm' + Comment.Preproc: "", # class: 'cp' + Comment.Single: "", # class: 'c1' + Comment.Special: "", # class: 'cs' + + Keyword: "#C2FFDF", # class: 'k' italic? + Keyword.Constant: "", # class: 'kc' + Keyword.Declaration: "", # class: 'kd' italic? + Keyword.Namespace: "#FFB8D1", # class: 'kn' + Keyword.Pseudo: "", # class: 'kp' + Keyword.Reserved: "", # class: 'kr' + Keyword.Type: "", # class: 'kt' italic? + + Operator: "#FFB8D1", # class: 'o' + Operator.Word: "", # class: 'ow' - like keywords + + Punctuation: "#F8F8F2", # class: 'p' + + Name: "#F8F8F2", # class: 'n' + Name.Attribute: LILAC, # class: 'na' + Name.Builtin: "", # class: 'nb' + Name.Builtin.Pseudo: "#80cbc4", # class: 'bp' + Name.Class: LILAC, # class: 'nc' italic underline? + Name.Constant: "#C5A3FF", # class: 'no' + Name.Decorator: LILAC, # class: 'nd' underline? + Name.Entity: "", # class: 'ni' + Name.Exception: LILAC, # class: 'ne' underline? + Name.Function: LILAC, # class: 'nf' + Name.Property: "#F8F8F2", # class: 'py' + Name.Label: "", # class: 'nl' + Name.Namespace: "", # class: 'nn' - to be revised + Name.Other: "", # class: 'nx' + Name.Tag: "#FFB8D1", # class: 'nt' - like a keyword + Name.Variable: "#F8F8F2", # class: 'nv' - to be revised + Name.Variable.Class: "", # class: 'vc' - to be revised + Name.Variable.Global: "", # class: 'vg' - to be revised + Name.Variable.Instance: "", # class: 'vi' - to be revised + + Number: "#C5A3FF", # class: 'm' + Number.Float: "", # class: 'mf' + Number.Hex: "", # class: 'mh' + Number.Integer: "", # class: 'mi' + Number.Integer.Long: "", # class: 'il' + Number.Oct: "", # class: 'mo' + + Literal: "#ae81ff", # class: 'l' + Literal.Date: "#e6db74", # class: 'ld' + + String: TORQUOISE, # class: 's' + String.Backtick: "", # class: 'sb' + String.Char: "", # class: 'sc' + String.Doc: "", # class: 'sd' - like a comment + String.Double: "", # class: 's2' + String.Escape: "", # class: 'se' + String.Heredoc: "", # class: 'sh' + String.Interpol: "", # class: 'si' + String.Other: "", # class: 'sx' + String.Regex: "", # class: 'sr' + String.Single: "", # class: 's1' + String.Symbol: "", # class: 'ss' + + Generic: "", # class: 'g' + Generic.Deleted: "#f92672", # class: 'gd', + Generic.Emph: "italic", # class: 'ge' + Generic.Error: "", # class: 'gr' + Generic.Heading: "", # class: 'gh' + Generic.Inserted: "#a6e22e", # class: 'gi' + Generic.Output: "", # class: 'go' + Generic.Prompt: "", # class: 'gp' + Generic.Strong: "bold", # class: 'gs' + Generic.Subheading: "#75715e", # class: 'gu' + Generic.Traceback: "", # class: 'gt' + }