pygmentize 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/LICENSE +19 -0
  2. data/lib/pygments.rb +23 -0
  3. data/pygmentize.gemspec +11 -0
  4. data/test/pygments.rb +19 -0
  5. data/vendor/pygmentize.py +7 -0
  6. data/vendor/pygments/AUTHORS +73 -0
  7. data/vendor/pygments/LICENSE +25 -0
  8. data/vendor/pygments/__init__.py +91 -0
  9. data/vendor/pygments/__init__.pyc +0 -0
  10. data/vendor/pygments/cmdline.py +430 -0
  11. data/vendor/pygments/cmdline.pyc +0 -0
  12. data/vendor/pygments/console.py +74 -0
  13. data/vendor/pygments/console.pyc +0 -0
  14. data/vendor/pygments/filter.py +74 -0
  15. data/vendor/pygments/filter.pyc +0 -0
  16. data/vendor/pygments/filters/__init__.py +357 -0
  17. data/vendor/pygments/filters/__init__.pyc +0 -0
  18. data/vendor/pygments/formatter.py +92 -0
  19. data/vendor/pygments/formatter.pyc +0 -0
  20. data/vendor/pygments/formatters/__init__.py +68 -0
  21. data/vendor/pygments/formatters/__init__.pyc +0 -0
  22. data/vendor/pygments/formatters/_mapping.py +92 -0
  23. data/vendor/pygments/formatters/_mapping.pyc +0 -0
  24. data/vendor/pygments/formatters/bbcode.py +109 -0
  25. data/vendor/pygments/formatters/bbcode.pyc +0 -0
  26. data/vendor/pygments/formatters/html.py +723 -0
  27. data/vendor/pygments/formatters/html.pyc +0 -0
  28. data/vendor/pygments/formatters/img.py +553 -0
  29. data/vendor/pygments/formatters/img.pyc +0 -0
  30. data/vendor/pygments/formatters/latex.py +354 -0
  31. data/vendor/pygments/formatters/latex.pyc +0 -0
  32. data/vendor/pygments/formatters/other.py +117 -0
  33. data/vendor/pygments/formatters/other.pyc +0 -0
  34. data/vendor/pygments/formatters/rtf.py +136 -0
  35. data/vendor/pygments/formatters/rtf.pyc +0 -0
  36. data/vendor/pygments/formatters/svg.py +154 -0
  37. data/vendor/pygments/formatters/svg.pyc +0 -0
  38. data/vendor/pygments/formatters/terminal.py +109 -0
  39. data/vendor/pygments/formatters/terminal.pyc +0 -0
  40. data/vendor/pygments/formatters/terminal256.py +219 -0
  41. data/vendor/pygments/formatters/terminal256.pyc +0 -0
  42. data/vendor/pygments/lexer.py +660 -0
  43. data/vendor/pygments/lexer.pyc +0 -0
  44. data/vendor/pygments/lexers/__init__.py +226 -0
  45. data/vendor/pygments/lexers/__init__.pyc +0 -0
  46. data/vendor/pygments/lexers/_asybuiltins.py +1645 -0
  47. data/vendor/pygments/lexers/_clbuiltins.py +232 -0
  48. data/vendor/pygments/lexers/_luabuiltins.py +256 -0
  49. data/vendor/pygments/lexers/_mapping.py +234 -0
  50. data/vendor/pygments/lexers/_mapping.pyc +0 -0
  51. data/vendor/pygments/lexers/_phpbuiltins.py +3389 -0
  52. data/vendor/pygments/lexers/_vimbuiltins.py +3 -0
  53. data/vendor/pygments/lexers/agile.py +1485 -0
  54. data/vendor/pygments/lexers/agile.pyc +0 -0
  55. data/vendor/pygments/lexers/asm.py +353 -0
  56. data/vendor/pygments/lexers/compiled.py +2365 -0
  57. data/vendor/pygments/lexers/dotnet.py +355 -0
  58. data/vendor/pygments/lexers/functional.py +756 -0
  59. data/vendor/pygments/lexers/functional.pyc +0 -0
  60. data/vendor/pygments/lexers/math.py +461 -0
  61. data/vendor/pygments/lexers/other.py +2297 -0
  62. data/vendor/pygments/lexers/parsers.py +695 -0
  63. data/vendor/pygments/lexers/special.py +100 -0
  64. data/vendor/pygments/lexers/special.pyc +0 -0
  65. data/vendor/pygments/lexers/templates.py +1387 -0
  66. data/vendor/pygments/lexers/text.py +1586 -0
  67. data/vendor/pygments/lexers/web.py +1619 -0
  68. data/vendor/pygments/lexers/web.pyc +0 -0
  69. data/vendor/pygments/plugin.py +74 -0
  70. data/vendor/pygments/plugin.pyc +0 -0
  71. data/vendor/pygments/scanner.py +104 -0
  72. data/vendor/pygments/style.py +117 -0
  73. data/vendor/pygments/style.pyc +0 -0
  74. data/vendor/pygments/styles/__init__.py +68 -0
  75. data/vendor/pygments/styles/__init__.pyc +0 -0
  76. data/vendor/pygments/styles/autumn.py +65 -0
  77. data/vendor/pygments/styles/borland.py +51 -0
  78. data/vendor/pygments/styles/bw.py +49 -0
  79. data/vendor/pygments/styles/colorful.py +81 -0
  80. data/vendor/pygments/styles/default.py +73 -0
  81. data/vendor/pygments/styles/default.pyc +0 -0
  82. data/vendor/pygments/styles/emacs.py +72 -0
  83. data/vendor/pygments/styles/friendly.py +72 -0
  84. data/vendor/pygments/styles/fruity.py +43 -0
  85. data/vendor/pygments/styles/manni.py +75 -0
  86. data/vendor/pygments/styles/monokai.py +106 -0
  87. data/vendor/pygments/styles/murphy.py +80 -0
  88. data/vendor/pygments/styles/native.py +65 -0
  89. data/vendor/pygments/styles/pastie.py +75 -0
  90. data/vendor/pygments/styles/perldoc.py +69 -0
  91. data/vendor/pygments/styles/tango.py +141 -0
  92. data/vendor/pygments/styles/trac.py +63 -0
  93. data/vendor/pygments/styles/vim.py +63 -0
  94. data/vendor/pygments/styles/vs.py +38 -0
  95. data/vendor/pygments/token.py +198 -0
  96. data/vendor/pygments/token.pyc +0 -0
  97. data/vendor/pygments/unistring.py +130 -0
  98. data/vendor/pygments/unistring.pyc +0 -0
  99. data/vendor/pygments/util.py +226 -0
  100. data/vendor/pygments/util.pyc +0 -0
  101. metadata +166 -0
@@ -0,0 +1,106 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.monokai
4
+ ~~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ Mimic the Monokai color scheme. Based on tango.py.
7
+
8
+ http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
9
+
10
+ :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
11
+ :license: BSD, see LICENSE for details.
12
+ """
13
+
14
+ from pygments.style import Style
15
+ from pygments.token import Keyword, Name, Comment, String, Error, Text, \
16
+ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
17
+
18
+ class MonokaiStyle(Style):
19
+ """
20
+ This style mimics the Monokai color scheme.
21
+ """
22
+
23
+ background_color = "#272822"
24
+ highlight_color = "#49483e"
25
+
26
+ styles = {
27
+ # No corresponding class for the following:
28
+ Text: "#f8f8f2", # class: ''
29
+ Whitespace: "", # class: 'w'
30
+ Error: "#960050 bg:#1e0010", # class: 'err'
31
+ Other: "", # class 'x'
32
+
33
+ Comment: "#75715e", # class: 'c'
34
+ Comment.Multiline: "", # class: 'cm'
35
+ Comment.Preproc: "", # class: 'cp'
36
+ Comment.Single: "", # class: 'c1'
37
+ Comment.Special: "", # class: 'cs'
38
+
39
+ Keyword: "#66d9ef", # class: 'k'
40
+ Keyword.Constant: "", # class: 'kc'
41
+ Keyword.Declaration: "", # class: 'kd'
42
+ Keyword.Namespace: "#f92672", # class: 'kn'
43
+ Keyword.Pseudo: "", # class: 'kp'
44
+ Keyword.Reserved: "", # class: 'kr'
45
+ Keyword.Type: "", # class: 'kt'
46
+
47
+ Operator: "#f92672", # class: 'o'
48
+ Operator.Word: "", # class: 'ow' - like keywords
49
+
50
+ Punctuation: "#f8f8f2", # class: 'p'
51
+
52
+ Name: "#f8f8f2", # class: 'n'
53
+ Name.Attribute: "#a6e22e", # class: 'na' - to be revised
54
+ Name.Builtin: "", # class: 'nb'
55
+ Name.Builtin.Pseudo: "", # class: 'bp'
56
+ Name.Class: "#a6e22e", # class: 'nc' - to be revised
57
+ Name.Constant: "#66d9ef", # class: 'no' - to be revised
58
+ Name.Decorator: "#a6e22e", # class: 'nd' - to be revised
59
+ Name.Entity: "", # class: 'ni'
60
+ Name.Exception: "#a6e22e", # class: 'ne'
61
+ Name.Function: "#a6e22e", # class: 'nf'
62
+ Name.Property: "", # class: 'py'
63
+ Name.Label: "", # class: 'nl'
64
+ Name.Namespace: "", # class: 'nn' - to be revised
65
+ Name.Other: "#a6e22e", # class: 'nx'
66
+ Name.Tag: "#f92672", # class: 'nt' - like a keyword
67
+ Name.Variable: "", # class: 'nv' - to be revised
68
+ Name.Variable.Class: "", # class: 'vc' - to be revised
69
+ Name.Variable.Global: "", # class: 'vg' - to be revised
70
+ Name.Variable.Instance: "", # class: 'vi' - to be revised
71
+
72
+ Number: "#ae81ff", # class: 'm'
73
+ Number.Float: "", # class: 'mf'
74
+ Number.Hex: "", # class: 'mh'
75
+ Number.Integer: "", # class: 'mi'
76
+ Number.Integer.Long: "", # class: 'il'
77
+ Number.Oct: "", # class: 'mo'
78
+
79
+ Literal: "#ae81ff", # class: 'l'
80
+ Literal.Date: "#e6db74", # class: 'ld'
81
+
82
+ String: "#e6db74", # class: 's'
83
+ String.Backtick: "", # class: 'sb'
84
+ String.Char: "", # class: 'sc'
85
+ String.Doc: "", # class: 'sd' - like a comment
86
+ String.Double: "", # class: 's2'
87
+ String.Escape: "#ae81ff", # class: 'se'
88
+ String.Heredoc: "", # class: 'sh'
89
+ String.Interpol: "", # class: 'si'
90
+ String.Other: "", # class: 'sx'
91
+ String.Regex: "", # class: 'sr'
92
+ String.Single: "", # class: 's1'
93
+ String.Symbol: "", # class: 'ss'
94
+
95
+ Generic: "", # class: 'g'
96
+ Generic.Deleted: "", # class: 'gd',
97
+ Generic.Emph: "italic", # class: 'ge'
98
+ Generic.Error: "", # class: 'gr'
99
+ Generic.Heading: "", # class: 'gh'
100
+ Generic.Inserted: "", # class: 'gi'
101
+ Generic.Output: "", # class: 'go'
102
+ Generic.Prompt: "", # class: 'gp'
103
+ Generic.Strong: "bold", # class: 'gs'
104
+ Generic.Subheading: "", # class: 'gu'
105
+ Generic.Traceback: "", # class: 'gt'
106
+ }
@@ -0,0 +1,80 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.murphy
4
+ ~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ Murphy's style from CodeRay.
7
+
8
+ :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
9
+ :license: BSD, see LICENSE for details.
10
+ """
11
+
12
+ from pygments.style import Style
13
+ from pygments.token import Keyword, Name, Comment, String, Error, \
14
+ Number, Operator, Generic, Whitespace
15
+
16
+
17
+ class MurphyStyle(Style):
18
+ """
19
+ Murphy's style from CodeRay.
20
+ """
21
+
22
+ default_style = ""
23
+
24
+ styles = {
25
+ Whitespace: "#bbbbbb",
26
+ Comment: "#666 italic",
27
+ Comment.Preproc: "#579 noitalic",
28
+ Comment.Special: "#c00 bold",
29
+
30
+ Keyword: "bold #289",
31
+ Keyword.Pseudo: "#08f",
32
+ Keyword.Type: "#66f",
33
+
34
+ Operator: "#333",
35
+ Operator.Word: "bold #000",
36
+
37
+ Name.Builtin: "#072",
38
+ Name.Function: "bold #5ed",
39
+ Name.Class: "bold #e9e",
40
+ Name.Namespace: "bold #0e84b5",
41
+ Name.Exception: "bold #F00",
42
+ Name.Variable: "#036",
43
+ Name.Variable.Instance: "#aaf",
44
+ Name.Variable.Class: "#ccf",
45
+ Name.Variable.Global: "#f84",
46
+ Name.Constant: "bold #5ed",
47
+ Name.Label: "bold #970",
48
+ Name.Entity: "#800",
49
+ Name.Attribute: "#007",
50
+ Name.Tag: "#070",
51
+ Name.Decorator: "bold #555",
52
+
53
+ String: "bg:#e0e0ff",
54
+ String.Char: "#88F bg:",
55
+ String.Doc: "#D42 bg:",
56
+ String.Interpol: "bg:#eee",
57
+ String.Escape: "bold #666",
58
+ String.Regex: "bg:#e0e0ff #000",
59
+ String.Symbol: "#fc8 bg:",
60
+ String.Other: "#f88",
61
+
62
+ Number: "bold #60E",
63
+ Number.Integer: "bold #66f",
64
+ Number.Float: "bold #60E",
65
+ Number.Hex: "bold #058",
66
+ Number.Oct: "bold #40E",
67
+
68
+ Generic.Heading: "bold #000080",
69
+ Generic.Subheading: "bold #800080",
70
+ Generic.Deleted: "#A00000",
71
+ Generic.Inserted: "#00A000",
72
+ Generic.Error: "#FF0000",
73
+ Generic.Emph: "italic",
74
+ Generic.Strong: "bold",
75
+ Generic.Prompt: "bold #c65d09",
76
+ Generic.Output: "#888",
77
+ Generic.Traceback: "#04D",
78
+
79
+ Error: "#F00 bg:#FAA"
80
+ }
@@ -0,0 +1,65 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.native
4
+ ~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ pygments version of my "native" vim theme.
7
+
8
+ :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
9
+ :license: BSD, see LICENSE for details.
10
+ """
11
+
12
+ from pygments.style import Style
13
+ from pygments.token import Keyword, Name, Comment, String, Error, \
14
+ Number, Operator, Generic, Token, Whitespace
15
+
16
+
17
+ class NativeStyle(Style):
18
+ """
19
+ Pygments version of the "native" vim theme.
20
+ """
21
+
22
+ background_color = '#202020'
23
+ highlight_color = '#404040'
24
+
25
+ styles = {
26
+ Token: '#d0d0d0',
27
+ Whitespace: '#666666',
28
+
29
+ Comment: 'italic #999999',
30
+ Comment.Preproc: 'noitalic bold #cd2828',
31
+ Comment.Special: 'noitalic bold #e50808 bg:#520000',
32
+
33
+ Keyword: 'bold #6ab825',
34
+ Keyword.Pseudo: 'nobold',
35
+ Operator.Word: 'bold #6ab825',
36
+
37
+ String: '#ed9d13',
38
+ String.Other: '#ffa500',
39
+
40
+ Number: '#3677a9',
41
+
42
+ Name.Builtin: '#24909d',
43
+ Name.Variable: '#40ffff',
44
+ Name.Constant: '#40ffff',
45
+ Name.Class: 'underline #447fcf',
46
+ Name.Function: '#447fcf',
47
+ Name.Namespace: 'underline #447fcf',
48
+ Name.Exception: '#bbbbbb',
49
+ Name.Tag: 'bold #6ab825',
50
+ Name.Attribute: '#bbbbbb',
51
+ Name.Decorator: '#ffa500',
52
+
53
+ Generic.Heading: 'bold #ffffff',
54
+ Generic.Subheading: 'underline #ffffff',
55
+ Generic.Deleted: '#d22323',
56
+ Generic.Inserted: '#589819',
57
+ Generic.Error: '#d22323',
58
+ Generic.Emph: 'italic',
59
+ Generic.Strong: 'bold',
60
+ Generic.Prompt: '#aaaaaa',
61
+ Generic.Output: '#cccccc',
62
+ Generic.Traceback: '#d22323',
63
+
64
+ Error: 'bg:#e3d2d2 #a61717'
65
+ }
@@ -0,0 +1,75 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.pastie
4
+ ~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ Style similar to the `pastie`_ default style.
7
+
8
+ .. _pastie: http://pastie.caboo.se/
9
+
10
+ :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
11
+ :license: BSD, see LICENSE for details.
12
+ """
13
+
14
+ from pygments.style import Style
15
+ from pygments.token import Keyword, Name, Comment, String, Error, \
16
+ Number, Operator, Generic, Whitespace
17
+
18
+
19
+ class PastieStyle(Style):
20
+ """
21
+ Style similar to the pastie default style.
22
+ """
23
+
24
+ default_style = ''
25
+
26
+ styles = {
27
+ Whitespace: '#bbbbbb',
28
+ Comment: '#888888',
29
+ Comment.Preproc: 'bold #cc0000',
30
+ Comment.Special: 'bg:#fff0f0 bold #cc0000',
31
+
32
+ String: 'bg:#fff0f0 #dd2200',
33
+ String.Regex: 'bg:#fff0ff #008800',
34
+ String.Other: 'bg:#f0fff0 #22bb22',
35
+ String.Symbol: '#aa6600',
36
+ String.Interpol: '#3333bb',
37
+ String.Escape: '#0044dd',
38
+
39
+ Operator.Word: '#008800',
40
+
41
+ Keyword: 'bold #008800',
42
+ Keyword.Pseudo: 'nobold',
43
+ Keyword.Type: '#888888',
44
+
45
+ Name.Class: 'bold #bb0066',
46
+ Name.Exception: 'bold #bb0066',
47
+ Name.Function: 'bold #0066bb',
48
+ Name.Property: 'bold #336699',
49
+ Name.Namespace: 'bold #bb0066',
50
+ Name.Builtin: '#003388',
51
+ Name.Variable: '#336699',
52
+ Name.Variable.Class: '#336699',
53
+ Name.Variable.Instance: '#3333bb',
54
+ Name.Variable.Global: '#dd7700',
55
+ Name.Constant: 'bold #003366',
56
+ Name.Tag: 'bold #bb0066',
57
+ Name.Attribute: '#336699',
58
+ Name.Decorator: '#555555',
59
+ Name.Label: 'italic #336699',
60
+
61
+ Number: 'bold #0000DD',
62
+
63
+ Generic.Heading: '#333',
64
+ Generic.Subheading: '#666',
65
+ Generic.Deleted: 'bg:#ffdddd #000000',
66
+ Generic.Inserted: 'bg:#ddffdd #000000',
67
+ Generic.Error: '#aa0000',
68
+ Generic.Emph: 'italic',
69
+ Generic.Strong: 'bold',
70
+ Generic.Prompt: '#555555',
71
+ Generic.Output: '#888888',
72
+ Generic.Traceback: '#aa0000',
73
+
74
+ Error: 'bg:#e3d2d2 #a61717'
75
+ }
@@ -0,0 +1,69 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.perldoc
4
+ ~~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ Style similar to the style used in the `perldoc`_ code blocks.
7
+
8
+ .. _perldoc: http://perldoc.perl.org/
9
+
10
+ :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
11
+ :license: BSD, see LICENSE for details.
12
+ """
13
+
14
+ from pygments.style import Style
15
+ from pygments.token import Keyword, Name, Comment, String, Error, \
16
+ Number, Operator, Generic, Whitespace
17
+
18
+
19
+ class PerldocStyle(Style):
20
+ """
21
+ Style similar to the style used in the perldoc code blocks.
22
+ """
23
+
24
+ background_color = '#eeeedd'
25
+ default_style = ''
26
+
27
+ styles = {
28
+ Whitespace: '#bbbbbb',
29
+ Comment: '#228B22',
30
+ Comment.Preproc: '#1e889b',
31
+ Comment.Special: '#8B008B bold',
32
+
33
+ String: '#CD5555',
34
+ String.Heredoc: '#1c7e71 italic',
35
+ String.Regex: '#B452CD',
36
+ String.Other: '#cb6c20',
37
+ String.Regex: '#1c7e71',
38
+
39
+ Number: '#B452CD',
40
+
41
+ Operator.Word: '#8B008B',
42
+
43
+ Keyword: '#8B008B bold',
44
+ Keyword.Type: '#a7a7a7',
45
+
46
+ Name.Class: '#008b45 bold',
47
+ Name.Exception: '#008b45 bold',
48
+ Name.Function: '#008b45',
49
+ Name.Namespace: '#008b45 underline',
50
+ Name.Variable: '#00688B',
51
+ Name.Constant: '#00688B',
52
+ Name.Decorator: '#707a7c',
53
+ Name.Tag: '#8B008B bold',
54
+ Name.Attribute: '#658b00',
55
+ Name.Builtin: '#658b00',
56
+
57
+ Generic.Heading: 'bold #000080',
58
+ Generic.Subheading: 'bold #800080',
59
+ Generic.Deleted: '#aa0000',
60
+ Generic.Inserted: '#00aa00',
61
+ Generic.Error: '#aa0000',
62
+ Generic.Emph: 'italic',
63
+ Generic.Strong: 'bold',
64
+ Generic.Prompt: '#555555',
65
+ Generic.Output: '#888888',
66
+ Generic.Traceback: '#aa0000',
67
+
68
+ Error: 'bg:#e3d2d2 #a61717'
69
+ }
@@ -0,0 +1,141 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.tango
4
+ ~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ The Crunchy default Style inspired from the color palette from
7
+ the Tango Icon Theme Guidelines.
8
+
9
+ http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines
10
+
11
+ Butter: #fce94f #edd400 #c4a000
12
+ Orange: #fcaf3e #f57900 #ce5c00
13
+ Chocolate: #e9b96e #c17d11 #8f5902
14
+ Chameleon: #8ae234 #73d216 #4e9a06
15
+ Sky Blue: #729fcf #3465a4 #204a87
16
+ Plum: #ad7fa8 #75507b #5c35cc
17
+ Scarlet Red:#ef2929 #cc0000 #a40000
18
+ Aluminium: #eeeeec #d3d7cf #babdb6
19
+ #888a85 #555753 #2e3436
20
+
21
+ Not all of the above colors are used; other colors added:
22
+ very light grey: #f8f8f8 (for background)
23
+
24
+ This style can be used as a template as it includes all the known
25
+ Token types, unlike most (if not all) of the styles included in the
26
+ Pygments distribution.
27
+
28
+ However, since Crunchy is intended to be used by beginners, we have strived
29
+ to create a style that gloss over subtle distinctions between different
30
+ categories.
31
+
32
+ Taking Python for example, comments (Comment.*) and docstrings (String.Doc)
33
+ have been chosen to have the same style. Similarly, keywords (Keyword.*),
34
+ and Operator.Word (and, or, in) have been assigned the same style.
35
+
36
+ :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
37
+ :license: BSD, see LICENSE for details.
38
+ """
39
+
40
+ from pygments.style import Style
41
+ from pygments.token import Keyword, Name, Comment, String, Error, \
42
+ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
43
+
44
+
45
+ class TangoStyle(Style):
46
+ """
47
+ The Crunchy default Style inspired from the color palette from
48
+ the Tango Icon Theme Guidelines.
49
+ """
50
+
51
+ # work in progress...
52
+
53
+ background_color = "#f8f8f8"
54
+ default_style = ""
55
+
56
+ styles = {
57
+ # No corresponding class for the following:
58
+ #Text: "", # class: ''
59
+ Whitespace: "underline #f8f8f8", # class: 'w'
60
+ Error: "#a40000 border:#ef2929", # class: 'err'
61
+ Other: "#000000", # class 'x'
62
+
63
+ Comment: "italic #8f5902", # class: 'c'
64
+ Comment.Multiline: "italic #8f5902", # class: 'cm'
65
+ Comment.Preproc: "italic #8f5902", # class: 'cp'
66
+ Comment.Single: "italic #8f5902", # class: 'c1'
67
+ Comment.Special: "italic #8f5902", # class: 'cs'
68
+
69
+ Keyword: "bold #204a87", # class: 'k'
70
+ Keyword.Constant: "bold #204a87", # class: 'kc'
71
+ Keyword.Declaration: "bold #204a87", # class: 'kd'
72
+ Keyword.Namespace: "bold #204a87", # class: 'kn'
73
+ Keyword.Pseudo: "bold #204a87", # class: 'kp'
74
+ Keyword.Reserved: "bold #204a87", # class: 'kr'
75
+ Keyword.Type: "bold #204a87", # class: 'kt'
76
+
77
+ Operator: "bold #ce5c00", # class: 'o'
78
+ Operator.Word: "bold #204a87", # class: 'ow' - like keywords
79
+
80
+ Punctuation: "bold #000000", # class: 'p'
81
+
82
+ # because special names such as Name.Class, Name.Function, etc.
83
+ # are not recognized as such later in the parsing, we choose them
84
+ # to look the same as ordinary variables.
85
+ Name: "#000000", # class: 'n'
86
+ Name.Attribute: "#c4a000", # class: 'na' - to be revised
87
+ Name.Builtin: "#204a87", # class: 'nb'
88
+ Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
89
+ Name.Class: "#000000", # class: 'nc' - to be revised
90
+ Name.Constant: "#000000", # class: 'no' - to be revised
91
+ Name.Decorator: "bold #5c35cc", # class: 'nd' - to be revised
92
+ Name.Entity: "#ce5c00", # class: 'ni'
93
+ Name.Exception: "bold #cc0000", # class: 'ne'
94
+ Name.Function: "#000000", # class: 'nf'
95
+ Name.Property: "#000000", # class: 'py'
96
+ Name.Label: "#f57900", # class: 'nl'
97
+ Name.Namespace: "#000000", # class: 'nn' - to be revised
98
+ Name.Other: "#000000", # class: 'nx'
99
+ Name.Tag: "bold #204a87", # class: 'nt' - like a keyword
100
+ Name.Variable: "#000000", # class: 'nv' - to be revised
101
+ Name.Variable.Class: "#000000", # class: 'vc' - to be revised
102
+ Name.Variable.Global: "#000000", # class: 'vg' - to be revised
103
+ Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
104
+
105
+ # since the tango light blue does not show up well in text, we choose
106
+ # a pure blue instead.
107
+ Number: "bold #0000cf", # class: 'm'
108
+ Number.Float: "bold #0000cf", # class: 'mf'
109
+ Number.Hex: "bold #0000cf", # class: 'mh'
110
+ Number.Integer: "bold #0000cf", # class: 'mi'
111
+ Number.Integer.Long: "bold #0000cf", # class: 'il'
112
+ Number.Oct: "bold #0000cf", # class: 'mo'
113
+
114
+ Literal: "#000000", # class: 'l'
115
+ Literal.Date: "#000000", # class: 'ld'
116
+
117
+ String: "#4e9a06", # class: 's'
118
+ String.Backtick: "#4e9a06", # class: 'sb'
119
+ String.Char: "#4e9a06", # class: 'sc'
120
+ String.Doc: "italic #8f5902", # class: 'sd' - like a comment
121
+ String.Double: "#4e9a06", # class: 's2'
122
+ String.Escape: "#4e9a06", # class: 'se'
123
+ String.Heredoc: "#4e9a06", # class: 'sh'
124
+ String.Interpol: "#4e9a06", # class: 'si'
125
+ String.Other: "#4e9a06", # class: 'sx'
126
+ String.Regex: "#4e9a06", # class: 'sr'
127
+ String.Single: "#4e9a06", # class: 's1'
128
+ String.Symbol: "#4e9a06", # class: 'ss'
129
+
130
+ Generic: "#000000", # class: 'g'
131
+ Generic.Deleted: "#a40000", # class: 'gd'
132
+ Generic.Emph: "italic #000000", # class: 'ge'
133
+ Generic.Error: "#ef2929", # class: 'gr'
134
+ Generic.Heading: "bold #000080", # class: 'gh'
135
+ Generic.Inserted: "#00A000", # class: 'gi'
136
+ Generic.Output: "italic #000000", # class: 'go'
137
+ Generic.Prompt: "#8f5902", # class: 'gp'
138
+ Generic.Strong: "bold #000000", # class: 'gs'
139
+ Generic.Subheading: "bold #800080", # class: 'gu'
140
+ Generic.Traceback: "bold #a40000", # class: 'gt'
141
+ }