├── .gitignore ├── LICENSE ├── README.markdown ├── pygments_solarized ├── __init__.py ├── dark.py ├── dark256.py └── light.py └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | eggs/ 15 | lib/ 16 | lib64/ 17 | parts/ 18 | sdist/ 19 | var/ 20 | *.egg-info/ 21 | .installed.cfg 22 | *.egg 23 | 24 | # Installer logs 25 | pip-log.txt 26 | pip-delete-this-directory.txt 27 | 28 | # Unit test / coverage reports 29 | htmlcov/ 30 | .tox/ 31 | .coverage 32 | .cache 33 | nosetests.xml 34 | coverage.xml 35 | 36 | # Translations 37 | *.mo 38 | *.pot 39 | 40 | # Django stuff: 41 | *.log 42 | 43 | # Sphinx documentation 44 | docs/_build/ 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 John Louis Del Rosario, Hank Gay, John Mastro, Brandon Bennett 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # Solarized Pygments Style 2 | 3 | ## What Is It? 4 | 5 | This is a simple style for [Pygments][pygments_home] that is inspired by the 6 | [Solarized project][solarized_home] by Ethan Schoonover. 7 | 8 | This includes both the light and dark versions 9 | 10 | ## How Do I Use It? 11 | Install it as a pygments plugin using the following command 12 | 13 | ./setup.py install 14 | 15 | ## Acknoledgements 16 | 17 | * Light version pygments port - [John Louis Del Rosario (john2x)](/john2x) 18 | * Dark version pygments port - [Hank (gthank)](/gthank) 19 | 20 | ## Resources 21 | [pygments_home]: http://pygments.org/ 22 | [solarized_home]: http://ethanschoonover.com/solarized -------------------------------------------------------------------------------- /pygments_solarized/__init__.py: -------------------------------------------------------------------------------- 1 | from light import SolarizedStyle 2 | from dark import SolarizedDarkStyle 3 | from dark256 import SolarizedDark256Style 4 | -------------------------------------------------------------------------------- /pygments_solarized/dark.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from pygments.style import Style 3 | from pygments.token import Token, Comment, Name, Keyword, Generic, Number, \ 4 | Operator, String 5 | 6 | BASE03 = '#002B36' 7 | BASE02 = '#073642' 8 | BASE01 = '#586E75' 9 | BASE00 = '#657B83' 10 | BASE0 = '#839496' 11 | BASE1 = '#93A1A1' 12 | BASE2 = '#EEE8D5' 13 | BASE3 = '#FDF6E3' 14 | YELLOW = '#B58900' 15 | ORANGE = '#CB4B16' 16 | RED = '#DC322F' 17 | MAGENTA = '#D33682' 18 | VIOLET = '#6C71C4' 19 | BLUE = '#268BD2' 20 | CYAN = '#2AA198' 21 | GREEN = '#719e07' 22 | 23 | 24 | class SolarizedDarkStyle(Style): 25 | 26 | """ Dark version solarized theme (http://ethanschoonover.com/solarized). """ 27 | background_color = BASE03 28 | styles = { 29 | Keyword: GREEN, 30 | Keyword.Constant: ORANGE, 31 | Keyword.Declaration: BLUE, 32 | # Keyword.Namespace 33 | # Keyword.Pseudo 34 | Keyword.Reserved: BLUE, 35 | Keyword.Type: RED, 36 | 37 | # Name 38 | Name.Attribute: BASE1, 39 | Name.Builtin: YELLOW, 40 | Name.Builtin.Pseudo: BLUE, 41 | Name.Class: BLUE, 42 | Name.Constant: ORANGE, 43 | Name.Decorator: BLUE, 44 | Name.Entity: ORANGE, 45 | Name.Exception: ORANGE, 46 | Name.Function: BLUE, 47 | # Name.Label 48 | # Name.Namespace 49 | # Name.Other 50 | Name.Tag: BLUE, 51 | Name.Variable: BLUE, 52 | # Name.Variable.Class 53 | # Name.Variable.Global 54 | # Name.Variable.Instance 55 | 56 | # Literal 57 | # Literal.Date 58 | String: CYAN, 59 | String.Backtick: BASE01, 60 | String.Char: CYAN, 61 | String.Doc: BASE1, 62 | # String.Double 63 | String.Escape: ORANGE, 64 | String.Heredoc: BASE1, 65 | # String.Interpol 66 | # String.Other 67 | String.Regex: RED, 68 | # String.Single 69 | # String.Symbol 70 | Number: CYAN, 71 | # Number.Float 72 | # Number.Hex 73 | # Number.Integer 74 | # Number.Integer.Long 75 | # Number.Oct 76 | 77 | Operator: GREEN, 78 | # Operator.Word 79 | 80 | # Punctuation: ORANGE, 81 | 82 | Comment: BASE01, 83 | # Comment.Multiline 84 | Comment.Preproc: GREEN, 85 | # Comment.Single 86 | Comment.Special: GREEN, 87 | 88 | # Generic 89 | Generic.Deleted: RED, 90 | Generic.Emph: 'italic', 91 | Generic.Error: RED + ' bold', 92 | Generic.Heading: ORANGE, 93 | Generic.Inserted: GREEN, 94 | # Generic.Output 95 | # Generic.Prompt 96 | Generic.Strong: 'bold', 97 | Generic.Subheading: BLUE, 98 | # Generic.Traceback 99 | 100 | Token: BASE1, 101 | Token.Other: ORANGE, 102 | } 103 | -------------------------------------------------------------------------------- /pygments_solarized/dark256.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from pygments.style import Style 3 | from pygments.token import Token, Comment, Name, Keyword, Generic, Number, \ 4 | Operator, String 5 | 6 | BASE03 = "#1c1c1c" 7 | BASE02 = "#262626" 8 | BASE01 = "#4e4e4e" 9 | BASE00 = "#585858" 10 | BASE0 = "#808080" 11 | BASE1 = "#8a8a8a" 12 | BASE2 = "#d7d7af" 13 | BASE3 = "#ffffd7" 14 | YELLOW = "#af8700" 15 | ORANGE = "#d75f00" 16 | RED = "#af0000" 17 | MAGENTA = "#af005f" 18 | VIOLET = "#5f5faf" 19 | BLUE = "#0087ff" 20 | CYAN = "#00afaf" 21 | GREEN = "#5f8700" 22 | 23 | 24 | class SolarizedDark256Style(Style): 25 | 26 | """ Dark 256-color version solarized theme (http://ethanschoonover.com/solarized). """ 27 | background_color = BASE03 28 | styles = { 29 | Keyword: GREEN, 30 | Keyword.Constant: ORANGE, 31 | Keyword.Declaration: BLUE, 32 | Keyword.Namespace: ORANGE, 33 | # Keyword.Pseudo 34 | Keyword.Reserved: BLUE, 35 | Keyword.Type: RED, 36 | 37 | # Name 38 | Name.Attribute: BASE1, 39 | Name.Builtin: BLUE, 40 | Name.Builtin.Pseudo: BLUE, 41 | Name.Class: BLUE, 42 | Name.Constant: ORANGE, 43 | Name.Decorator: BLUE, 44 | Name.Entity: ORANGE, 45 | Name.Exception: YELLOW, 46 | Name.Function: BLUE, 47 | # Name.Label 48 | # Name.Namespace 49 | # Name.Other 50 | Name.Tag: BLUE, 51 | Name.Variable: BLUE, 52 | # Name.Variable.Class 53 | # Name.Variable.Global 54 | # Name.Variable.Instance 55 | 56 | # Literal 57 | # Literal.Date 58 | String: CYAN, 59 | String.Backtick: BASE01, 60 | String.Char: CYAN, 61 | String.Doc: CYAN, 62 | # String.Double 63 | String.Escape: RED, 64 | String.Heredoc: CYAN, 65 | # String.Interpol 66 | # String.Other 67 | String.Regex: RED, 68 | # String.Single 69 | # String.Symbol 70 | Number: CYAN, 71 | # Number.Float 72 | # Number.Hex 73 | # Number.Integer 74 | # Number.Integer.Long 75 | # Number.Oct 76 | 77 | Operator: BASE1, 78 | Operator.Word: GREEN, 79 | 80 | # Punctuation: ORANGE, 81 | 82 | Comment: BASE01, 83 | # Comment.Multiline 84 | Comment.Preproc: GREEN, 85 | # Comment.Single 86 | Comment.Special: GREEN, 87 | 88 | # Generic 89 | Generic.Deleted: RED, 90 | Generic.Emph: 'italic', 91 | Generic.Error: RED + ' bold', 92 | Generic.Heading: ORANGE, 93 | Generic.Inserted: GREEN, 94 | # Generic.Output 95 | # Generic.Prompt 96 | Generic.Strong: 'bold', 97 | Generic.Subheading: BLUE, 98 | # Generic.Traceback 99 | 100 | Token: BASE1, 101 | Token.Other: ORANGE, 102 | } 103 | -------------------------------------------------------------------------------- /pygments_solarized/light.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from pygments.style import Style 3 | from pygments.token import Keyword, Name, Comment, String, Error, \ 4 | Number, Operator, Generic, Whitespace, Punctuation, Other, Literal, Text 5 | 6 | BASE0 = '#839496' 7 | BASE1 = '#93a1a1' 8 | BASE2 = '#eee8d5' 9 | BASE3 = '#fdf6e3' 10 | BASE00 = '#657b83' 11 | BASE01 = '#586e75' 12 | BASE02 = '#073642' 13 | BASE03 = '#002b36' 14 | YELLOW = '#b58900' 15 | ORANGE = '#cb4b16' 16 | RED = '#dc322f' 17 | MAGENTA = '#d33682' 18 | VIOLET = '#6c71c4' 19 | BLUE = '#268bd2' 20 | CYAN = '#2aa198' 21 | GREEN = '#859900' 22 | 23 | 24 | class SolarizedStyle(Style): 25 | 26 | """ Light version solarized theme (http://ethanschoonover.com/solarized). """ 27 | background_color = BASE2 28 | styles = { 29 | Text: 'bg: %s %s' % (BASE2, BASE01), 30 | Keyword: GREEN, 31 | Keyword.Constant: 'bold', 32 | # Keyword.Declaration 33 | Keyword.Namespace: RED + ' bold', 34 | # Keyword.Pseudo 35 | # Keyword.Reserved 36 | Keyword.Type: 'bold', 37 | Name: BLUE, 38 | # Name.Attribute 39 | Name.Builtin: ORANGE, 40 | # Name.Builtin.Pseudo 41 | Name.Class: ORANGE, 42 | Name.Tag: 'bold', 43 | Literal: CYAN, 44 | # String 45 | Number: 'bold', 46 | # Operator 47 | Operator.Word: GREEN, 48 | Comment: BASE1 + ' italic', 49 | Generic: MAGENTA, 50 | } 51 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from setuptools import setup, find_packages 4 | 5 | setup( 6 | name='pygments-solarized', 7 | version='0.2', 8 | description='Pygments version of the solarized theme.', 9 | keywords='pygments style solarized', 10 | license='BSD', 11 | author='John Louis Del Rosario, Hank Gay, John Mastro, Brandon Bennett', 12 | author_email='john2x@gmail.com', 13 | 14 | url='https://github.com/john2x/solarized-pygment', 15 | 16 | packages = find_packages(), 17 | install_requires=['pygments >= 1.4'], 18 | 19 | entry_points=''' 20 | [pygments.styles] 21 | solarized=pygments_solarized:SolarizedStyle 22 | solarized_dark=pygments_solarized:SolarizedDarkStyle 23 | solarized_dark256=pygments_solarized:SolarizedDark256Style 24 | ''', 25 | 26 | classifiers=[ 27 | 'Development Status :: 4 - Beta', 28 | 'Environment :: Plugins', 29 | 'Intended Audience :: Developers', 30 | 'License :: OSI Approved :: BSD License', 31 | 'Operating System :: OS Independent', 32 | 'Programming Language :: Python', 33 | 'Programming Language :: Python :: 2', 34 | 'Programming Language :: Python :: 3', 35 | 'Topic :: Software Development :: Libraries :: Python Modules', 36 | ], 37 | ) 38 | --------------------------------------------------------------------------------