Created
September 17, 2015 02:24
-
-
Save triti/2ae2bd8b4666dd8e8b90 to your computer and use it in GitHub Desktop.
Pygments style that mimics the GitHub syntax highlighting color scheme.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
pygments.styles.github | |
~~~~~~~~~~~~~~~~~~~~~ | |
Mimics the GitHub color scheme. | |
:copyright: Copyright 2015 by Tyler Riti. | |
""" | |
from pygments.style import Style | |
from pygments.token import Keyword, Name, Comment, String, Error, \ | |
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal | |
class GitHubStyle(Style): | |
""" | |
This style mimics the GitHub color scheme. | |
""" | |
background_color = "#f8f8f8" | |
default_style = "" | |
styles = { | |
# No corresponding class for the following: | |
#Text: "", # class: '' | |
Whitespace: "#bbbbbb", # class: 'w' | |
Error: "#a61717 bg:#e3d2d2", # class: 'err' | |
#Other: "", # class 'x' | |
Comment: "italic #999988", # class: 'c' | |
Comment.Multiline: "", # class: 'cm' | |
Comment.Preproc: "bold #999999", # class: 'cp' | |
Comment.Single: "", # class: 'c1' | |
Comment.Special: "bold #999999", # class: 'cs' | |
Keyword: "bold #000000", # class: 'k' | |
Keyword.Constant: "", # class: 'kc' | |
Keyword.Declaration: "", # class: 'kd' | |
Keyword.Namespace: "", # class: 'kn' | |
Keyword.Pseudo: "", # class: 'kp' | |
Keyword.Reserved: "", # class: 'kr' | |
Keyword.Type: "#445588", # class: 'kt' | |
Operator: "bold #000000", # class: 'o' | |
Operator.Word: "", # class: 'ow' - like keywords | |
#Punctuation: "", # class: 'p' | |
#Name: "#008080", # class: 'n' | |
Name.Attribute: "#008080", # class: 'na' - to be revised | |
Name.Builtin: "#0086B3", # class: 'nb' | |
Name.Builtin.Pseudo: "#999999", # class: 'bp' | |
Name.Class: "bold #445588", # class: 'nc' - to be revised | |
Name.Constant: "#008080", # class: 'no' - to be revised | |
Name.Decorator: "bold #3c5d5d", # class: 'nd' - to be revised | |
Name.Entity: "#800080", # class: 'ni' | |
Name.Exception: "bold #990000", # class: 'ne' | |
Name.Function: "#990000", # class: 'nf' | |
#Name.Property: "", # class: 'py' | |
Name.Label: "bold #990000", # class: 'nl' | |
Name.Namespace: "#555555", # class: 'nn' - to be revised | |
#Name.Other: "", # class: 'nx' | |
Name.Tag: "#000080", # class: 'nt' - like a keyword | |
Name.Variable: "#008080", # 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: "#009999", # class: 'm' | |
Number.Float: "", # class: 'mf' | |
Number.Hex: "", # class: 'mh' | |
Number.Integer: "", # class: 'mi' | |
Number.Integer.Long: "", # class: 'il' | |
Number.Oct: "", # class: 'mo' | |
#Literal: "#000000", # class: 'l' | |
#Literal.Date: "#000000", # class: 'ld' | |
String: "#d01040", # 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: "#009926", # class: 'sr' | |
String.Single: "", # class: 's1' | |
String.Symbol: "#990073", # class: 'ss' | |
#Generic: "#000000", # class: 'g' | |
Generic.Deleted: "#000000 bg:#ffdddd", # class: 'gd' | |
Generic.Emph: "italic #000000", # class: 'ge' | |
Generic.Error: "#aa0000", # class: 'gr' | |
Generic.Heading: "#999999", # class: 'gh' | |
Generic.Inserted: "#000000 bg:#ddffdd", # class: 'gi' | |
Generic.Output: "#888888", # class: 'go' | |
Generic.Prompt: "#555555", # class: 'gp' | |
Generic.Strong: "bold #000000", # class: 'gs' | |
Generic.Subheading: "#aaaaaa", # class: 'gu' | |
Generic.Traceback: "#aa0000", # class: 'gt' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment