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,49 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.bw
4
+ ~~~~~~~~~~~~~~~~~~
5
+
6
+ Simple black/white only style.
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
+ Operator, Generic
15
+
16
+
17
+ class BlackWhiteStyle(Style):
18
+
19
+ background_color = "#ffffff"
20
+ default_style = ""
21
+
22
+ styles = {
23
+ Comment: "italic",
24
+ Comment.Preproc: "noitalic",
25
+
26
+ Keyword: "bold",
27
+ Keyword.Pseudo: "nobold",
28
+ Keyword.Type: "nobold",
29
+
30
+ Operator.Word: "bold",
31
+
32
+ Name.Class: "bold",
33
+ Name.Namespace: "bold",
34
+ Name.Exception: "bold",
35
+ Name.Entity: "bold",
36
+ Name.Tag: "bold",
37
+
38
+ String: "italic",
39
+ String.Interpol: "bold",
40
+ String.Escape: "bold",
41
+
42
+ Generic.Heading: "bold",
43
+ Generic.Subheading: "bold",
44
+ Generic.Emph: "italic",
45
+ Generic.Strong: "bold",
46
+ Generic.Prompt: "bold",
47
+
48
+ Error: "border:#FF0000"
49
+ }
@@ -0,0 +1,81 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.colorful
4
+ ~~~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ A colorful style, inspired by 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 ColorfulStyle(Style):
18
+ """
19
+ A colorful style, inspired by CodeRay.
20
+ """
21
+
22
+ default_style = ""
23
+
24
+ styles = {
25
+ Whitespace: "#bbbbbb",
26
+
27
+ Comment: "#888",
28
+ Comment.Preproc: "#579",
29
+ Comment.Special: "bold #cc0000",
30
+
31
+ Keyword: "bold #080",
32
+ Keyword.Pseudo: "#038",
33
+ Keyword.Type: "#339",
34
+
35
+ Operator: "#333",
36
+ Operator.Word: "bold #000",
37
+
38
+ Name.Builtin: "#007020",
39
+ Name.Function: "bold #06B",
40
+ Name.Class: "bold #B06",
41
+ Name.Namespace: "bold #0e84b5",
42
+ Name.Exception: "bold #F00",
43
+ Name.Variable: "#963",
44
+ Name.Variable.Instance: "#33B",
45
+ Name.Variable.Class: "#369",
46
+ Name.Variable.Global: "bold #d70",
47
+ Name.Constant: "bold #036",
48
+ Name.Label: "bold #970",
49
+ Name.Entity: "bold #800",
50
+ Name.Attribute: "#00C",
51
+ Name.Tag: "#070",
52
+ Name.Decorator: "bold #555",
53
+
54
+ String: "bg:#fff0f0",
55
+ String.Char: "#04D bg:",
56
+ String.Doc: "#D42 bg:",
57
+ String.Interpol: "bg:#eee",
58
+ String.Escape: "bold #666",
59
+ String.Regex: "bg:#fff0ff #000",
60
+ String.Symbol: "#A60 bg:",
61
+ String.Other: "#D20",
62
+
63
+ Number: "bold #60E",
64
+ Number.Integer: "bold #00D",
65
+ Number.Float: "bold #60E",
66
+ Number.Hex: "bold #058",
67
+ Number.Oct: "bold #40E",
68
+
69
+ Generic.Heading: "bold #000080",
70
+ Generic.Subheading: "bold #800080",
71
+ Generic.Deleted: "#A00000",
72
+ Generic.Inserted: "#00A000",
73
+ Generic.Error: "#FF0000",
74
+ Generic.Emph: "italic",
75
+ Generic.Strong: "bold",
76
+ Generic.Prompt: "bold #c65d09",
77
+ Generic.Output: "#888",
78
+ Generic.Traceback: "#04D",
79
+
80
+ Error: "#F00 bg:#FAA"
81
+ }
@@ -0,0 +1,73 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.default
4
+ ~~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ The default highlighting style.
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 DefaultStyle(Style):
18
+ """
19
+ The default style (inspired by Emacs 22).
20
+ """
21
+
22
+ background_color = "#f8f8f8"
23
+ default_style = ""
24
+
25
+ styles = {
26
+ Whitespace: "#bbbbbb",
27
+ Comment: "italic #408080",
28
+ Comment.Preproc: "noitalic #BC7A00",
29
+
30
+ #Keyword: "bold #AA22FF",
31
+ Keyword: "bold #008000",
32
+ Keyword.Pseudo: "nobold",
33
+ Keyword.Type: "nobold #B00040",
34
+
35
+ Operator: "#666666",
36
+ Operator.Word: "bold #AA22FF",
37
+
38
+ Name.Builtin: "#008000",
39
+ Name.Function: "#0000FF",
40
+ Name.Class: "bold #0000FF",
41
+ Name.Namespace: "bold #0000FF",
42
+ Name.Exception: "bold #D2413A",
43
+ Name.Variable: "#19177C",
44
+ Name.Constant: "#880000",
45
+ Name.Label: "#A0A000",
46
+ Name.Entity: "bold #999999",
47
+ Name.Attribute: "#7D9029",
48
+ Name.Tag: "bold #008000",
49
+ Name.Decorator: "#AA22FF",
50
+
51
+ String: "#BA2121",
52
+ String.Doc: "italic",
53
+ String.Interpol: "bold #BB6688",
54
+ String.Escape: "bold #BB6622",
55
+ String.Regex: "#BB6688",
56
+ #String.Symbol: "#B8860B",
57
+ String.Symbol: "#19177C",
58
+ String.Other: "#008000",
59
+ Number: "#666666",
60
+
61
+ Generic.Heading: "bold #000080",
62
+ Generic.Subheading: "bold #800080",
63
+ Generic.Deleted: "#A00000",
64
+ Generic.Inserted: "#00A000",
65
+ Generic.Error: "#FF0000",
66
+ Generic.Emph: "italic",
67
+ Generic.Strong: "bold",
68
+ Generic.Prompt: "bold #000080",
69
+ Generic.Output: "#888",
70
+ Generic.Traceback: "#04D",
71
+
72
+ Error: "border:#FF0000"
73
+ }
@@ -0,0 +1,72 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.emacs
4
+ ~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ A highlighting style for Pygments, inspired by Emacs.
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 EmacsStyle(Style):
18
+ """
19
+ The default style (inspired by Emacs 22).
20
+ """
21
+
22
+ background_color = "#f8f8f8"
23
+ default_style = ""
24
+
25
+ styles = {
26
+ Whitespace: "#bbbbbb",
27
+ Comment: "italic #008800",
28
+ Comment.Preproc: "noitalic",
29
+ Comment.Special: "noitalic bold",
30
+
31
+ Keyword: "bold #AA22FF",
32
+ Keyword.Pseudo: "nobold",
33
+ Keyword.Type: "bold #00BB00",
34
+
35
+ Operator: "#666666",
36
+ Operator.Word: "bold #AA22FF",
37
+
38
+ Name.Builtin: "#AA22FF",
39
+ Name.Function: "#00A000",
40
+ Name.Class: "#0000FF",
41
+ Name.Namespace: "bold #0000FF",
42
+ Name.Exception: "bold #D2413A",
43
+ Name.Variable: "#B8860B",
44
+ Name.Constant: "#880000",
45
+ Name.Label: "#A0A000",
46
+ Name.Entity: "bold #999999",
47
+ Name.Attribute: "#BB4444",
48
+ Name.Tag: "bold #008000",
49
+ Name.Decorator: "#AA22FF",
50
+
51
+ String: "#BB4444",
52
+ String.Doc: "italic",
53
+ String.Interpol: "bold #BB6688",
54
+ String.Escape: "bold #BB6622",
55
+ String.Regex: "#BB6688",
56
+ String.Symbol: "#B8860B",
57
+ String.Other: "#008000",
58
+ Number: "#666666",
59
+
60
+ Generic.Heading: "bold #000080",
61
+ Generic.Subheading: "bold #800080",
62
+ Generic.Deleted: "#A00000",
63
+ Generic.Inserted: "#00A000",
64
+ Generic.Error: "#FF0000",
65
+ Generic.Emph: "italic",
66
+ Generic.Strong: "bold",
67
+ Generic.Prompt: "bold #000080",
68
+ Generic.Output: "#888",
69
+ Generic.Traceback: "#04D",
70
+
71
+ Error: "border:#FF0000"
72
+ }
@@ -0,0 +1,72 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.friendly
4
+ ~~~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ A modern style based on the VIM pyte 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, Whitespace
15
+
16
+
17
+ class FriendlyStyle(Style):
18
+ """
19
+ A modern style based on the VIM pyte theme.
20
+ """
21
+
22
+ background_color = "#f0f0f0"
23
+ default_style = ""
24
+
25
+ styles = {
26
+ Whitespace: "#bbbbbb",
27
+ Comment: "italic #60a0b0",
28
+ Comment.Preproc: "noitalic #007020",
29
+ Comment.Special: "noitalic bg:#fff0f0",
30
+
31
+ Keyword: "bold #007020",
32
+ Keyword.Pseudo: "nobold",
33
+ Keyword.Type: "nobold #902000",
34
+
35
+ Operator: "#666666",
36
+ Operator.Word: "bold #007020",
37
+
38
+ Name.Builtin: "#007020",
39
+ Name.Function: "#06287e",
40
+ Name.Class: "bold #0e84b5",
41
+ Name.Namespace: "bold #0e84b5",
42
+ Name.Exception: "#007020",
43
+ Name.Variable: "#bb60d5",
44
+ Name.Constant: "#60add5",
45
+ Name.Label: "bold #002070",
46
+ Name.Entity: "bold #d55537",
47
+ Name.Attribute: "#4070a0",
48
+ Name.Tag: "bold #062873",
49
+ Name.Decorator: "bold #555555",
50
+
51
+ String: "#4070a0",
52
+ String.Doc: "italic",
53
+ String.Interpol: "italic #70a0d0",
54
+ String.Escape: "bold #4070a0",
55
+ String.Regex: "#235388",
56
+ String.Symbol: "#517918",
57
+ String.Other: "#c65d09",
58
+ Number: "#40a070",
59
+
60
+ Generic.Heading: "bold #000080",
61
+ Generic.Subheading: "bold #800080",
62
+ Generic.Deleted: "#A00000",
63
+ Generic.Inserted: "#00A000",
64
+ Generic.Error: "#FF0000",
65
+ Generic.Emph: "italic",
66
+ Generic.Strong: "bold",
67
+ Generic.Prompt: "bold #c65d09",
68
+ Generic.Output: "#888",
69
+ Generic.Traceback: "#04D",
70
+
71
+ Error: "border:#FF0000"
72
+ }
@@ -0,0 +1,43 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.fruity
4
+ ~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ pygments version of my "fruity" 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 Token, Comment, Name, Keyword, \
14
+ Generic, Number, String, Whitespace
15
+
16
+ class FruityStyle(Style):
17
+ """
18
+ Pygments version of the "native" vim theme.
19
+ """
20
+
21
+ background_color = '#111111'
22
+ highlight_color = '#333333'
23
+
24
+ styles = {
25
+ Whitespace: '#888888',
26
+ Token: '#ffffff',
27
+ Generic.Output: '#444444 bg:#222222',
28
+ Keyword: '#fb660a bold',
29
+ Keyword.Pseudo: 'nobold',
30
+ Number: '#0086f7 bold',
31
+ Name.Tag: '#fb660a bold',
32
+ Name.Variable: '#fb660a',
33
+ Name.Constant: '#fb660a',
34
+ Comment: '#008800 bg:#0f140f italic',
35
+ Name.Attribute: '#ff0086 bold',
36
+ String: '#0086d2',
37
+ Name.Function: '#ff0086 bold',
38
+ Generic.Heading: '#ffffff bold',
39
+ Keyword.Type: '#cdcaa9 bold',
40
+ Generic.Subheading: '#ffffff bold',
41
+ Name.Constant: '#0086d2',
42
+ Comment.Preproc: '#ff0007 bold'
43
+ }
@@ -0,0 +1,75 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pygments.styles.manni
4
+ ~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ A colorful style, inspired by the terminal highlighting style.
7
+
8
+ This is a port of the style used in the `php port`_ of pygments
9
+ by Manni. The style is called 'default' there.
10
+
11
+ :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
12
+ :license: BSD, see LICENSE for details.
13
+ """
14
+
15
+ from pygments.style import Style
16
+ from pygments.token import Keyword, Name, Comment, String, Error, \
17
+ Number, Operator, Generic, Whitespace
18
+
19
+
20
+ class ManniStyle(Style):
21
+ """
22
+ A colorful style, inspired by the terminal highlighting style.
23
+ """
24
+
25
+ background_color = '#f0f3f3'
26
+
27
+ styles = {
28
+ Whitespace: '#bbbbbb',
29
+ Comment: 'italic #0099FF',
30
+ Comment.Preproc: 'noitalic #009999',
31
+ Comment.Special: 'bold',
32
+
33
+ Keyword: 'bold #006699',
34
+ Keyword.Pseudo: 'nobold',
35
+ Keyword.Type: '#007788',
36
+
37
+ Operator: '#555555',
38
+ Operator.Word: 'bold #000000',
39
+
40
+ Name.Builtin: '#336666',
41
+ Name.Function: '#CC00FF',
42
+ Name.Class: 'bold #00AA88',
43
+ Name.Namespace: 'bold #00CCFF',
44
+ Name.Exception: 'bold #CC0000',
45
+ Name.Variable: '#003333',
46
+ Name.Constant: '#336600',
47
+ Name.Label: '#9999FF',
48
+ Name.Entity: 'bold #999999',
49
+ Name.Attribute: '#330099',
50
+ Name.Tag: 'bold #330099',
51
+ Name.Decorator: '#9999FF',
52
+
53
+ String: '#CC3300',
54
+ String.Doc: 'italic',
55
+ String.Interpol: '#AA0000',
56
+ String.Escape: 'bold #CC3300',
57
+ String.Regex: '#33AAAA',
58
+ String.Symbol: '#FFCC33',
59
+ String.Other: '#CC3300',
60
+
61
+ Number: '#FF6600',
62
+
63
+ Generic.Heading: 'bold #003300',
64
+ Generic.Subheading: 'bold #003300',
65
+ Generic.Deleted: 'border:#CC0000 bg:#FFCCCC',
66
+ Generic.Inserted: 'border:#00CC00 bg:#CCFFCC',
67
+ Generic.Error: '#FF0000',
68
+ Generic.Emph: 'italic',
69
+ Generic.Strong: 'bold',
70
+ Generic.Prompt: 'bold #000099',
71
+ Generic.Output: '#AAAAAA',
72
+ Generic.Traceback: '#99CC66',
73
+
74
+ Error: 'bg:#FFAAAA #AA0000'
75
+ }