Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f3c1dc0

Browse files
authored
Create flask_theme_support.py
1 parent e47e902 commit f3c1dc0

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# flake8: noqa
2+
# flasky extensions. flasky pygments style based on tango style
3+
from pygments.style import Style
4+
from pygments.token import Keyword, Name, Comment, String, Error, \
5+
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
6+
7+
8+
class FlaskyStyle(Style):
9+
background_color = "#f8f8f8"
10+
default_style = ""
11+
12+
styles = {
13+
# No corresponding class for the following:
14+
#Text: "", # class: ''
15+
Whitespace: "underline #f8f8f8", # class: 'w'
16+
Error: "#a40000 border:#ef2929", # class: 'err'
17+
Other: "#000000", # class 'x'
18+
19+
Comment: "italic #8f5902", # class: 'c'
20+
Comment.Preproc: "noitalic", # class: 'cp'
21+
22+
Keyword: "bold #004461", # class: 'k'
23+
Keyword.Constant: "bold #004461", # class: 'kc'
24+
Keyword.Declaration: "bold #004461", # class: 'kd'
25+
Keyword.Namespace: "bold #004461", # class: 'kn'
26+
Keyword.Pseudo: "bold #004461", # class: 'kp'
27+
Keyword.Reserved: "bold #004461", # class: 'kr'
28+
Keyword.Type: "bold #004461", # class: 'kt'
29+
30+
Operator: "#582800", # class: 'o'
31+
Operator.Word: "bold #004461", # class: 'ow' - like keywords
32+
33+
Punctuation: "bold #000000", # class: 'p'
34+
35+
# because special names such as Name.Class, Name.Function, etc.
36+
# are not recognized as such later in the parsing, we choose them
37+
# to look the same as ordinary variables.
38+
Name: "#000000", # class: 'n'
39+
Name.Attribute: "#c4a000", # class: 'na' - to be revised
40+
Name.Builtin: "#004461", # class: 'nb'
41+
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
42+
Name.Class: "#000000", # class: 'nc' - to be revised
43+
Name.Constant: "#000000", # class: 'no' - to be revised
44+
Name.Decorator: "#888", # class: 'nd' - to be revised
45+
Name.Entity: "#ce5c00", # class: 'ni'
46+
Name.Exception: "bold #cc0000", # class: 'ne'
47+
Name.Function: "#000000", # class: 'nf'
48+
Name.Property: "#000000", # class: 'py'
49+
Name.Label: "#f57900", # class: 'nl'
50+
Name.Namespace: "#000000", # class: 'nn' - to be revised
51+
Name.Other: "#000000", # class: 'nx'
52+
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
53+
Name.Variable: "#000000", # class: 'nv' - to be revised
54+
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
55+
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
56+
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
57+
58+
Number: "#990000", # class: 'm'
59+
60+
Literal: "#000000", # class: 'l'
61+
Literal.Date: "#000000", # class: 'ld'
62+
63+
String: "#4e9a06", # class: 's'
64+
String.Backtick: "#4e9a06", # class: 'sb'
65+
String.Char: "#4e9a06", # class: 'sc'
66+
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
67+
String.Double: "#4e9a06", # class: 's2'
68+
String.Escape: "#4e9a06", # class: 'se'
69+
String.Heredoc: "#4e9a06", # class: 'sh'
70+
String.Interpol: "#4e9a06", # class: 'si'
71+
String.Other: "#4e9a06", # class: 'sx'
72+
String.Regex: "#4e9a06", # class: 'sr'
73+
String.Single: "#4e9a06", # class: 's1'
74+
String.Symbol: "#4e9a06", # class: 'ss'
75+
76+
Generic: "#000000", # class: 'g'
77+
Generic.Deleted: "#a40000", # class: 'gd'
78+
Generic.Emph: "italic #000000", # class: 'ge'
79+
Generic.Error: "#ef2929", # class: 'gr'
80+
Generic.Heading: "bold #000080", # class: 'gh'
81+
Generic.Inserted: "#00A000", # class: 'gi'
82+
Generic.Output: "#888", # class: 'go'
83+
Generic.Prompt: "#745334", # class: 'gp'
84+
Generic.Strong: "bold #000000", # class: 'gs'
85+
Generic.Subheading: "bold #800080", # class: 'gu'
86+
Generic.Traceback: "bold #a40000", # class: 'gt'
87+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /