diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-11-25 10:01:04 +1100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2019-11-25 12:12:21 +0100 |
commit | fdbe9c57ce3cc1f5d31a9fc74e7e94314d69773b (patch) | |
tree | 2684fc42f5d4c6515c7ce90dd9ce9b04867c9c77 | |
parent | 36860f10fc7993be03a3ee35fb6bb1304411092a (diff) | |
download | pygments-git-fdbe9c57ce3cc1f5d31a9fc74e7e94314d69773b.tar.gz |
Add New Style: Inkpot
Based on the Vim theme: http://www.vim.org/scripts/script.php?script_id=1143
Example output: http://members.iinet.net.au/~ideasman42/dotemacs/init.html
The theme is also bundled with qt-creator and available from emacs package manager.
Also, there aren't many nice dark themes for Pygments at the moment.
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | pygments/styles/__init__.py | 1 | ||||
-rw-r--r-- | pygments/styles/inkpot.py | 68 |
3 files changed, 73 insertions, 0 deletions
@@ -23,6 +23,10 @@ Version 2.5.0 * Python3 (PR#1255) * YAML (#1528) +- Added styles: + + * Inkpot (#1276) + - The ``PythonLexer`` class is now an alias for the former ``Python3Lexer``. The old ``PythonLexer`` is available as ``Python2Lexer``. Same change has been done for the ``PythonTracebackLexer``. The ``python3`` option for diff --git a/pygments/styles/__init__.py b/pygments/styles/__init__.py index 8de9e43b..c0614718 100644 --- a/pygments/styles/__init__.py +++ b/pygments/styles/__init__.py @@ -50,6 +50,7 @@ STYLE_MAP = { 'stata': 'stata_light::StataLightStyle', 'stata-light': 'stata_light::StataLightStyle', 'stata-dark': 'stata_dark::StataDarkStyle', + 'inkpot': 'inkpot::InkPotStyle', } diff --git a/pygments/styles/inkpot.py b/pygments/styles/inkpot.py new file mode 100644 index 00000000..a030b8b1 --- /dev/null +++ b/pygments/styles/inkpot.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +""" + pygments.styles.inkpot + ~~~~~~~~~~~~~~~~~~~~~~ + + A highlighting style for Pygments, inspired by the Inkpot theme for VIM. + + :copyright: Copyright 2018 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Text, Other, \ + Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace, Punctuation + + +class InkPotStyle(Style): + background_color = "#1e1e27" + default_style = "" + styles = { + Text: "#cfbfad", + Other: "#cfbfad", + Whitespace: "#434357", + Comment: "#cd8b00", + Comment.Preproc: "#409090", + Comment.PreprocFile: "bg:#404040 #ffcd8b", + Comment.Special: "#808bed", + + Keyword: "#808bed", + Keyword.Pseudo: "nobold", + Keyword.Type: "#ff8bff", + + Operator: "#666666", + + Punctuation: "#cfbfad", + + Name: "#cfbfad", + Name.Attribute: "#cfbfad", + Name.Builtin.Pseudo: '#ffff00', + Name.Builtin: "#808bed", + Name.Class: "#ff8bff", + Name.Constant: "#409090", + Name.Decorator: "#409090", + Name.Exception: "#ff0000", + Name.Function: "#c080d0", + Name.Label: "#808bed", + Name.Namespace: "#ff0000", + Name.Variable: "#cfbfad", + + String: "bg:#404040 #ffcd8b", + String.Doc: "#808bed", + + Number: "#f0ad6d", + + Generic.Heading: "bold #000080", + Generic.Subheading: "bold #800080", + Generic.Deleted: "#A00000", + Generic.Inserted: "#00A000", + Generic.Error: "#FF0000", + Generic.Emph: "italic", + Generic.Strong: "bold", + Generic.Prompt: "bold #000080", + Generic.Output: "#888", + Generic.Traceback: "#04D", + + Error: "bg:#6e2e2e #ffffff" + } |