ultraviolet 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +216 -0
- data/README.txt +52 -0
- data/Rakefile +51 -0
- data/bin/theme2render +104 -0
- data/bin/uv +162 -0
- data/lib/uv.rb +84 -0
- data/lib/uv/html_processor.rb +89 -0
- data/render/old/txt2tags.render +131 -0
- data/render/xhtml/active4d.render +105 -0
- data/render/xhtml/all_hallows_eve.render +69 -0
- data/render/xhtml/amy.render +144 -0
- data/render/xhtml/blackboard.render +84 -0
- data/render/xhtml/brilliance_black.render +575 -0
- data/render/xhtml/brilliance_dull.render +534 -0
- data/render/xhtml/cobalt.render +135 -0
- data/render/xhtml/dawn.render +99 -0
- data/render/xhtml/eiffel.render +105 -0
- data/render/xhtml/espresso_libre.render +96 -0
- data/render/xhtml/files/css/active4d.css +114 -0
- data/render/xhtml/files/css/all_hallows_eve.css +72 -0
- data/render/xhtml/files/css/amy.css +144 -0
- data/render/xhtml/files/css/blackboard.css +88 -0
- data/render/xhtml/files/css/brilliance_black.css +632 -0
- data/render/xhtml/files/css/brilliance_dull.css +579 -0
- data/render/xhtml/files/css/cobalt.css +149 -0
- data/render/xhtml/files/css/dawn.css +121 -0
- data/render/xhtml/files/css/eiffel.css +121 -0
- data/render/xhtml/files/css/espresso_libre.css +109 -0
- data/render/xhtml/files/css/idle.css +62 -0
- data/render/xhtml/files/css/iplastic.css +80 -0
- data/render/xhtml/files/css/lazy.css +73 -0
- data/render/xhtml/files/css/mac_classic.css +123 -0
- data/render/xhtml/files/css/magicwb_amiga.css +101 -0
- data/render/xhtml/files/css/pastels_on_dark.css +188 -0
- data/render/xhtml/files/css/slush_poppies.css +85 -0
- data/render/xhtml/files/css/spacecadet.css +51 -0
- data/render/xhtml/files/css/sunburst.css +180 -0
- data/render/xhtml/files/css/twilight.css +137 -0
- data/render/xhtml/files/css/zenburnesque.css +88 -0
- data/render/xhtml/idle.render +66 -0
- data/render/xhtml/iplastic.render +72 -0
- data/render/xhtml/lazy.render +69 -0
- data/render/xhtml/mac_classic.render +108 -0
- data/render/xhtml/magicwb_amiga.render +90 -0
- data/render/xhtml/pastels_on_dark.render +177 -0
- data/render/xhtml/slush_poppies.render +96 -0
- data/render/xhtml/spacecadet.render +54 -0
- data/render/xhtml/sunburst.render +159 -0
- data/render/xhtml/twilight.render +126 -0
- data/render/xhtml/zenburnesque.render +99 -0
- data/syntax/actionscript.syntax +97 -0
- data/syntax/active4d.syntax +276 -0
- data/syntax/active4d_html.syntax +311 -0
- data/syntax/active4d_ini.syntax +50 -0
- data/syntax/active4d_library.syntax +21 -0
- data/syntax/ada.syntax +33 -0
- data/syntax/antlr.syntax +128 -0
- data/syntax/apache.syntax +176 -0
- data/syntax/applescript.syntax +384 -0
- data/syntax/asp.syntax +70 -0
- data/syntax/asp_vb.net.syntax +129 -0
- data/syntax/bibtex.syntax +151 -0
- data/syntax/blog_html.syntax +41 -0
- data/syntax/blog_markdown.syntax +42 -0
- data/syntax/blog_text.syntax +27 -0
- data/syntax/blog_textile.syntax +27 -0
- data/syntax/buggy/nemerle.yaml +74 -0
- data/syntax/build.syntax +53 -0
- data/syntax/bulletin_board.syntax +287 -0
- data/syntax/c++.syntax +109 -0
- data/syntax/c.syntax +326 -0
- data/syntax/cake.syntax +55 -0
- data/syntax/camlp4.syntax +36 -0
- data/syntax/coldfusion.syntax +118 -0
- data/syntax/context_free.syntax +176 -0
- data/syntax/cs.syntax +59 -0
- data/syntax/css.syntax +190 -0
- data/syntax/css_experimental.syntax +1925 -0
- data/syntax/csv.syntax +68 -0
- data/syntax/d.syntax +138 -0
- data/syntax/diff.syntax +81 -0
- data/syntax/dokuwiki.syntax +204 -0
- data/syntax/dot.syntax +47 -0
- data/syntax/doxygen.syntax +43 -0
- data/syntax/dylan.syntax +62 -0
- data/syntax/eiffel.syntax +78 -0
- data/syntax/erlang.syntax +922 -0
- data/syntax/f-script.syntax +80 -0
- data/syntax/fortran.syntax +141 -0
- data/syntax/fxscript.syntax +142 -0
- data/syntax/greasemonkey.syntax +34 -0
- data/syntax/gri.syntax +83 -0
- data/syntax/groovy.syntax +189 -0
- data/syntax/gtd2_text.syntax +31 -0
- data/syntax/gtdalt.syntax +143 -0
- data/syntax/haml.syntax +88 -0
- data/syntax/haskell.syntax +88 -0
- data/syntax/html-asp.syntax +27 -0
- data/syntax/html.syntax +362 -0
- data/syntax/html_django.syntax +36 -0
- data/syntax/html_for_asp.net.syntax +424 -0
- data/syntax/html_mason.syntax +119 -0
- data/syntax/html_rails.syntax +40 -0
- data/syntax/html_tcl.syntax +26 -0
- data/syntax/icalendar.syntax +32 -0
- data/syntax/inform.syntax +48 -0
- data/syntax/ini.syntax +54 -0
- data/syntax/installer_distribution_script.syntax +77 -0
- data/syntax/io.syntax +81 -0
- data/syntax/java.syntax +211 -0
- data/syntax/javaproperties.syntax +20 -0
- data/syntax/javascript.syntax +255 -0
- data/syntax/javascript_+_prototype.syntax +72 -0
- data/syntax/javascript_+_prototype_bracketed.syntax +140 -0
- data/syntax/jquery_javascript.syntax +114 -0
- data/syntax/json.syntax +136 -0
- data/syntax/languagedefinition.syntax +697 -0
- data/syntax/latex.syntax +566 -0
- data/syntax/latex_beamer.syntax +41 -0
- data/syntax/latex_log.syntax +50 -0
- data/syntax/latex_memoir.syntax +64 -0
- data/syntax/lexflex.syntax +219 -0
- data/syntax/lighttpd.syntax +54 -0
- data/syntax/lilypond.syntax +492 -0
- data/syntax/lisp.syntax +61 -0
- data/syntax/literate_haskell.syntax +24 -0
- data/syntax/logo.syntax +29 -0
- data/syntax/logtalk.syntax +152 -0
- data/syntax/lua.syntax +86 -0
- data/syntax/m.syntax +142 -0
- data/syntax/macports_portfile.syntax +143 -0
- data/syntax/mail.syntax +118 -0
- data/syntax/makefile.syntax +35 -0
- data/syntax/man.syntax +17 -0
- data/syntax/markdown.syntax +543 -0
- data/syntax/mediawiki.syntax +567 -0
- data/syntax/mel.syntax +92 -0
- data/syntax/mips.syntax +66 -0
- data/syntax/mod_perl.syntax +50 -0
- data/syntax/modula-3.syntax +47 -0
- data/syntax/moinmoin.syntax +189 -0
- data/syntax/mootools.syntax +572 -0
- data/syntax/movable_type.syntax +162 -0
- data/syntax/multimarkdown.syntax +39 -0
- data/syntax/objective-c++.syntax +18 -0
- data/syntax/objective-c.syntax +226 -0
- data/syntax/ocaml.syntax +764 -0
- data/syntax/ocamllex.syntax +167 -0
- data/syntax/ocamlyacc.syntax +184 -0
- data/syntax/old/YAML.yaml +160 -0
- data/syntax/old/txt2tags.yaml +139 -0
- data/syntax/opengl.syntax +14 -0
- data/syntax/pascal.syntax +77 -0
- data/syntax/perl.syntax +1075 -0
- data/syntax/php.syntax +678 -0
- data/syntax/plain_text.syntax +32 -0
- data/syntax/postscript.syntax +114 -0
- data/syntax/processing.syntax +106 -0
- data/syntax/prolog.syntax +40 -0
- data/syntax/property_list.syntax +645 -0
- data/syntax/python.syntax +865 -0
- data/syntax/python_django.syntax +21 -0
- data/syntax/qmake_project.syntax +114 -0
- data/syntax/qt_c++.syntax +26 -0
- data/syntax/quake3_config.syntax +32 -0
- data/syntax/r.syntax +81 -0
- data/syntax/r_console.syntax +16 -0
- data/syntax/ragel.syntax +201 -0
- data/syntax/rd_r_documentation.syntax +91 -0
- data/syntax/regexp.syntax +50 -0
- data/syntax/regular_expressions_oniguruma.syntax +107 -0
- data/syntax/regular_expressions_python.syntax +109 -0
- data/syntax/release_notes.syntax +37 -0
- data/syntax/remind.syntax +253 -0
- data/syntax/restructuredtext.syntax +250 -0
- data/syntax/rez.syntax +80 -0
- data/syntax/ruby.syntax +1035 -0
- data/syntax/ruby_experimental.syntax +145 -0
- data/syntax/ruby_on_rails.syntax +88 -0
- data/syntax/s5.syntax +69 -0
- data/syntax/scheme.syntax +347 -0
- data/syntax/scilab.syntax +41 -0
- data/syntax/setext.syntax +147 -0
- data/syntax/shell-unix-generic.syntax +384 -0
- data/syntax/slate.syntax +149 -0
- data/syntax/smarty.syntax +63 -0
- data/syntax/sql.syntax +237 -0
- data/syntax/sql_rails.syntax +18 -0
- data/syntax/ssh-config.syntax +33 -0
- data/syntax/standard_ml.syntax +45 -0
- data/syntax/strings_file.syntax +39 -0
- data/syntax/subversion_commit_message.syntax +36 -0
- data/syntax/sweave.syntax +84 -0
- data/syntax/swig.syntax +57 -0
- data/syntax/tcl.syntax +152 -0
- data/syntax/template_toolkit.syntax +121 -0
- data/syntax/tex.syntax +86 -0
- data/syntax/tex_math.syntax +49 -0
- data/syntax/textile.syntax +215 -0
- data/syntax/tsv.syntax +50 -0
- data/syntax/twiki.syntax +241 -0
- data/syntax/txt2tags.syntax +79 -0
- data/syntax/vectorscript.syntax +57 -0
- data/syntax/xhtml_1.0.syntax +4027 -0
- data/syntax/xml.syntax +179 -0
- data/syntax/xml_strict.syntax +92 -0
- data/syntax/xsl.syntax +60 -0
- data/syntax/yaml.syntax +160 -0
- data/syntax/yui_javascript.syntax +176 -0
- data/test/test_uv.rb +0 -0
- metadata +270 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,216 @@
|
|
1
|
+
render/old/txt2tags.render
|
2
|
+
render/xhtml
|
3
|
+
render/xhtml/active4d.render
|
4
|
+
render/xhtml/all_hallows_eve.render
|
5
|
+
render/xhtml/amy.render
|
6
|
+
render/xhtml/brilliance_black.render
|
7
|
+
render/xhtml/brilliance_dull.render
|
8
|
+
render/xhtml/cobalt.render
|
9
|
+
render/xhtml/eiffel.render
|
10
|
+
render/xhtml/espresso_libre.render
|
11
|
+
render/xhtml/idle.render
|
12
|
+
render/xhtml/iplastic.render
|
13
|
+
render/xhtml/lazy.render
|
14
|
+
render/xhtml/mac_classic.render
|
15
|
+
render/xhtml/magicwb_amiga.render
|
16
|
+
render/xhtml/pastels_on_dark.render
|
17
|
+
render/xhtml/slush_poppies.render
|
18
|
+
render/xhtml/spacecadet.render
|
19
|
+
render/xhtml/sunburst.render
|
20
|
+
render/xhtml/twilight.render
|
21
|
+
render/xhtml/blackboard.render
|
22
|
+
render/xhtml/dawn.render
|
23
|
+
render/xhtml/zenburnesque.render
|
24
|
+
render/xhtml/files
|
25
|
+
render/xhtml/files/css
|
26
|
+
render/xhtml/files/css/active4d.css
|
27
|
+
render/xhtml/files/css/all_hallows_eve.css
|
28
|
+
render/xhtml/files/css/amy.css
|
29
|
+
render/xhtml/files/css/blackboard.css
|
30
|
+
render/xhtml/files/css/brilliance_black.css
|
31
|
+
render/xhtml/files/css/brilliance_dull.css
|
32
|
+
render/xhtml/files/css/cobalt.css
|
33
|
+
render/xhtml/files/css/dawn.css
|
34
|
+
render/xhtml/files/css/eiffel.css
|
35
|
+
render/xhtml/files/css/espresso_libre.css
|
36
|
+
render/xhtml/files/css/idle.css
|
37
|
+
render/xhtml/files/css/iplastic.css
|
38
|
+
render/xhtml/files/css/lazy.css
|
39
|
+
render/xhtml/files/css/mac_classic.css
|
40
|
+
render/xhtml/files/css/magicwb_amiga.css
|
41
|
+
render/xhtml/files/css/pastels_on_dark.css
|
42
|
+
render/xhtml/files/css/slush_poppies.css
|
43
|
+
render/xhtml/files/css/spacecadet.css
|
44
|
+
render/xhtml/files/css/sunburst.css
|
45
|
+
render/xhtml/files/css/twilight.css
|
46
|
+
render/xhtml/files/css/zenburnesque.css
|
47
|
+
test/test_uv.rb
|
48
|
+
lib/uv/html_processor.rb
|
49
|
+
lib/uv.rb
|
50
|
+
syntax/old
|
51
|
+
syntax/old/txt2tags.yaml
|
52
|
+
syntax/old/YAML.yaml
|
53
|
+
syntax/buggy
|
54
|
+
syntax/buggy/nemerle.yaml
|
55
|
+
syntax/gtd2_text.syntax
|
56
|
+
syntax/multimarkdown.syntax
|
57
|
+
syntax/asp.syntax
|
58
|
+
syntax/active4d_ini.syntax
|
59
|
+
syntax/sweave.syntax
|
60
|
+
syntax/xsl.syntax
|
61
|
+
syntax/ocaml.syntax
|
62
|
+
syntax/d.syntax
|
63
|
+
syntax/ruby_on_rails.syntax
|
64
|
+
syntax/standard_ml.syntax
|
65
|
+
syntax/r.syntax
|
66
|
+
syntax/gri.syntax
|
67
|
+
syntax/mel.syntax
|
68
|
+
syntax/javascript_+_prototype_bracketed.syntax
|
69
|
+
syntax/lighttpd.syntax
|
70
|
+
syntax/blog_text.syntax
|
71
|
+
syntax/m.syntax
|
72
|
+
syntax/tcl.syntax
|
73
|
+
syntax/textile.syntax
|
74
|
+
syntax/build.syntax
|
75
|
+
syntax/xhtml_1.0.syntax
|
76
|
+
syntax/xml.syntax
|
77
|
+
syntax/latex_log.syntax
|
78
|
+
syntax/lisp.syntax
|
79
|
+
syntax/rez.syntax
|
80
|
+
syntax/logo.syntax
|
81
|
+
syntax/ocamllex.syntax
|
82
|
+
syntax/slate.syntax
|
83
|
+
syntax/ruby.syntax
|
84
|
+
syntax/s5.syntax
|
85
|
+
syntax/php.syntax
|
86
|
+
syntax/qmake_project.syntax
|
87
|
+
syntax/ocamlyacc.syntax
|
88
|
+
syntax/csv.syntax
|
89
|
+
syntax/yaml.syntax
|
90
|
+
syntax/scheme.syntax
|
91
|
+
syntax/python.syntax
|
92
|
+
syntax/ragel.syntax
|
93
|
+
syntax/haml.syntax
|
94
|
+
syntax/objective-c.syntax
|
95
|
+
syntax/cs.syntax
|
96
|
+
syntax/moinmoin.syntax
|
97
|
+
syntax/mootools.syntax
|
98
|
+
syntax/css.syntax
|
99
|
+
syntax/dot.syntax
|
100
|
+
syntax/c++.syntax
|
101
|
+
syntax/strings_file.syntax
|
102
|
+
syntax/objective-c++.syntax
|
103
|
+
syntax/javascript.syntax
|
104
|
+
syntax/jquery_javascript.syntax
|
105
|
+
syntax/json.syntax
|
106
|
+
syntax/latex.syntax
|
107
|
+
syntax/prolog.syntax
|
108
|
+
syntax/regexp.syntax
|
109
|
+
syntax/remind.syntax
|
110
|
+
syntax/sql.syntax
|
111
|
+
syntax/mediawiki.syntax
|
112
|
+
syntax/inform.syntax
|
113
|
+
syntax/pascal.syntax
|
114
|
+
syntax/c.syntax
|
115
|
+
syntax/blog_textile.syntax
|
116
|
+
syntax/html.syntax
|
117
|
+
syntax/ini.syntax
|
118
|
+
syntax/ada.syntax
|
119
|
+
syntax/context_free.syntax
|
120
|
+
syntax/lexflex.syntax
|
121
|
+
syntax/cake.syntax
|
122
|
+
syntax/swig.syntax
|
123
|
+
syntax/tex.syntax
|
124
|
+
syntax/bulletin_board.syntax
|
125
|
+
syntax/rd_r_documentation.syntax
|
126
|
+
syntax/html-asp.syntax
|
127
|
+
syntax/html_for_asp.net.syntax
|
128
|
+
syntax/txt2tags.syntax
|
129
|
+
syntax/tex_math.syntax
|
130
|
+
syntax/latex_beamer.syntax
|
131
|
+
syntax/html_tcl.syntax
|
132
|
+
syntax/bibtex.syntax
|
133
|
+
syntax/lua.syntax
|
134
|
+
syntax/smarty.syntax
|
135
|
+
syntax/perl.syntax
|
136
|
+
syntax/io.syntax
|
137
|
+
syntax/latex_memoir.syntax
|
138
|
+
syntax/mod_perl.syntax
|
139
|
+
syntax/sql_rails.syntax
|
140
|
+
syntax/java.syntax
|
141
|
+
syntax/tsv.syntax
|
142
|
+
syntax/qt_c++.syntax
|
143
|
+
syntax/man.syntax
|
144
|
+
syntax/scilab.syntax
|
145
|
+
syntax/lilypond.syntax
|
146
|
+
syntax/template_toolkit.syntax
|
147
|
+
syntax/html_django.syntax
|
148
|
+
syntax/antlr.syntax
|
149
|
+
syntax/fortran.syntax
|
150
|
+
syntax/restructuredtext.syntax
|
151
|
+
syntax/mail.syntax
|
152
|
+
syntax/makefile.syntax
|
153
|
+
syntax/twiki.syntax
|
154
|
+
syntax/active4d.syntax
|
155
|
+
syntax/html_mason.syntax
|
156
|
+
syntax/release_notes.syntax
|
157
|
+
syntax/mips.syntax
|
158
|
+
syntax/vectorscript.syntax
|
159
|
+
syntax/logtalk.syntax
|
160
|
+
syntax/r_console.syntax
|
161
|
+
syntax/literate_haskell.syntax
|
162
|
+
syntax/macports_portfile.syntax
|
163
|
+
syntax/markdown.syntax
|
164
|
+
syntax/regular_expressions_python.syntax
|
165
|
+
syntax/groovy.syntax
|
166
|
+
syntax/setext.syntax
|
167
|
+
syntax/opengl.syntax
|
168
|
+
syntax/diff.syntax
|
169
|
+
syntax/modula-3.syntax
|
170
|
+
syntax/icalendar.syntax
|
171
|
+
syntax/apache.syntax
|
172
|
+
syntax/gtdalt.syntax
|
173
|
+
syntax/dylan.syntax
|
174
|
+
syntax/xml_strict.syntax
|
175
|
+
syntax/yui_javascript.syntax
|
176
|
+
syntax/javaproperties.syntax
|
177
|
+
syntax/python_django.syntax
|
178
|
+
syntax/movable_type.syntax
|
179
|
+
syntax/quake3_config.syntax
|
180
|
+
syntax/ruby_experimental.syntax
|
181
|
+
syntax/shell-unix-generic.syntax
|
182
|
+
syntax/postscript.syntax
|
183
|
+
syntax/plain_text.syntax
|
184
|
+
syntax/ssh-config.syntax
|
185
|
+
syntax/processing.syntax
|
186
|
+
syntax/property_list.syntax
|
187
|
+
syntax/actionscript.syntax
|
188
|
+
syntax/active4d_html.syntax
|
189
|
+
syntax/active4d_library.syntax
|
190
|
+
syntax/applescript.syntax
|
191
|
+
syntax/asp_vb.net.syntax
|
192
|
+
syntax/blog_html.syntax
|
193
|
+
syntax/blog_markdown.syntax
|
194
|
+
syntax/camlp4.syntax
|
195
|
+
syntax/coldfusion.syntax
|
196
|
+
syntax/css_experimental.syntax
|
197
|
+
syntax/dokuwiki.syntax
|
198
|
+
syntax/doxygen.syntax
|
199
|
+
syntax/eiffel.syntax
|
200
|
+
syntax/erlang.syntax
|
201
|
+
syntax/f-script.syntax
|
202
|
+
syntax/fxscript.syntax
|
203
|
+
syntax/greasemonkey.syntax
|
204
|
+
syntax/haskell.syntax
|
205
|
+
syntax/html_rails.syntax
|
206
|
+
syntax/installer_distribution_script.syntax
|
207
|
+
syntax/javascript_+_prototype.syntax
|
208
|
+
syntax/languagedefinition.syntax
|
209
|
+
syntax/regular_expressions_oniguruma.syntax
|
210
|
+
syntax/subversion_commit_message.syntax
|
211
|
+
bin/theme2render
|
212
|
+
bin/uv
|
213
|
+
History.txt
|
214
|
+
Rakefile
|
215
|
+
Manifest.txt
|
216
|
+
README.txt
|
data/README.txt
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
== Ultraviolet
|
2
|
+
|
3
|
+
Ultraviolet is a syntax highlighting library and engine. It
|
4
|
+
uses TextMate[http://macromates.com/] syntax files and parses
|
5
|
+
them using the Textpow[http://textpow.rubyforge.org] library. It
|
6
|
+
supports more than 60 programming languages out of the box.
|
7
|
+
|
8
|
+
== SYNTAX
|
9
|
+
|
10
|
+
|
11
|
+
== REQUIREMENTS:
|
12
|
+
|
13
|
+
* Oniguruma for Ruby[http://oniguruma.rubyforge.org] v1.1.0 or higher.
|
14
|
+
* Textpow[http://textpow.rubyforge.org] v0.9.0 or higher.
|
15
|
+
|
16
|
+
== INSTALL:
|
17
|
+
|
18
|
+
sudo gem install -r markray
|
19
|
+
|
20
|
+
== BUGS/PROBLEMS/INCOMPATIBILITIES:
|
21
|
+
|
22
|
+
|
23
|
+
== TODO:
|
24
|
+
|
25
|
+
|
26
|
+
== CREDITS:
|
27
|
+
|
28
|
+
|
29
|
+
== LICENSE:
|
30
|
+
|
31
|
+
(The MIT License)
|
32
|
+
|
33
|
+
Copyright (c) 2007 FIX
|
34
|
+
|
35
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
36
|
+
a copy of this software and associated documentation files (the
|
37
|
+
'Software'), to deal in the Software without restriction, including
|
38
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
39
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
40
|
+
permit persons to whom the Software is furnished to do so, subject to
|
41
|
+
the following conditions:
|
42
|
+
|
43
|
+
The above copyright notice and this permission notice shall be
|
44
|
+
included in all copies or substantial portions of the Software.
|
45
|
+
|
46
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
47
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
48
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
49
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
50
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
51
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
52
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
rubyforge_name = "ultraviolet"
|
5
|
+
|
6
|
+
begin
|
7
|
+
require 'hoe'
|
8
|
+
|
9
|
+
class Hoe
|
10
|
+
# Dirty hack to eliminate Hoe from gem dependencies
|
11
|
+
def extra_deps
|
12
|
+
@extra_deps.delete_if{ |x| x.first == 'hoe' }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
version = /^== *(\d+\.\d+\.\d+)/.match( File.read( 'History.txt' ) )[1]
|
17
|
+
|
18
|
+
h = Hoe.new('ultraviolet', version) do |p|
|
19
|
+
p.rubyforge_name = 'ultraviolet'
|
20
|
+
p.author = ['Dizan Vasquez']
|
21
|
+
p.email = ['dichodaemon@gmail.com']
|
22
|
+
p.email = 'dichodaemon@gmail.com'
|
23
|
+
p.summary = 'Syntax highlighting engine'
|
24
|
+
p.description = p.paragraphs_of('README.txt', 1 ).join('\n\n')
|
25
|
+
p.url = 'http://ultraviolet.rubyforge.org'
|
26
|
+
p.rdoc_pattern = /^(lib|bin|ext)|txt$/
|
27
|
+
p.changes = p.paragraphs_of('History.txt', 0).join("\n\n")
|
28
|
+
p.extra_deps << ['textpow', '>= 0.9.0']
|
29
|
+
p.clean_globs = ["manual/*"]
|
30
|
+
end
|
31
|
+
|
32
|
+
desc 'Create MaMa documentation'
|
33
|
+
task :mama => :clean do
|
34
|
+
system "mm -c -t refresh -o manual mm/manual.mm"
|
35
|
+
end
|
36
|
+
|
37
|
+
desc 'Publish MaMa documentation to RubyForge'
|
38
|
+
task :mama_publish => [:clean, :mama] do
|
39
|
+
config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
|
40
|
+
host = "#{config["username"]}@rubyforge.org"
|
41
|
+
remote_dir = "/var/www/gforge-projects/#{h.rubyforge_name}"
|
42
|
+
local_dir = 'manual'
|
43
|
+
system "rsync -av --delete #{local_dir}/ #{host}:#{remote_dir}"
|
44
|
+
end
|
45
|
+
|
46
|
+
rescue LoadError => e
|
47
|
+
desc 'Run the test suite.'
|
48
|
+
task :test do
|
49
|
+
system "ruby -Ibin:lib:test test_#{rubyforge_name}.rb"
|
50
|
+
end
|
51
|
+
end
|
data/bin/theme2render
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
begin
|
3
|
+
require 'plist'
|
4
|
+
rescue LoadError
|
5
|
+
require 'rubygems'
|
6
|
+
require 'plist'
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
def settings
|
12
|
+
unless @settings
|
13
|
+
@settings = @theme["settings"].find { |s| ! s["name"] }["settings"]
|
14
|
+
end
|
15
|
+
@settings
|
16
|
+
end
|
17
|
+
|
18
|
+
def normalize_color color
|
19
|
+
if color =~ /^#/ && color.size == 9
|
20
|
+
div0 = (settings["background"] ? settings["background"][1..-1].hex : 0xFFFFFF )
|
21
|
+
div1, alpha = color[1..-1].hex.divmod( 0x100 )
|
22
|
+
result = ""
|
23
|
+
3.times {
|
24
|
+
div0, mod0 = div0.divmod( 0x100 )
|
25
|
+
div1, mod1 = div1.divmod( 0x100 )
|
26
|
+
result = ((mod1 * alpha + mod0 * ( 0x100 - alpha ) ) / 0x100).to_s(16).upcase.rjust(2, '0') + result
|
27
|
+
}
|
28
|
+
result = "#" + result
|
29
|
+
#result = "##{ big, small = ; ((big * (0xFF - small)) / 0xFF).to_s(16).upcase}"
|
30
|
+
#result = "##{ big, small = "0xFFFFFF10".hex.divmod( "0x100".hex); ((big * small) / 0xFF).to_s(16).upcase}"
|
31
|
+
#result = color[0...-2]
|
32
|
+
result
|
33
|
+
else
|
34
|
+
color
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
@theme = Plist::parse_xml( ARGV[0] )
|
39
|
+
render = {"name" => @theme["name"]}
|
40
|
+
css = {}
|
41
|
+
|
42
|
+
standard_name = File.basename( ARGV[0] ).downcase.gsub(/\s+/, '_').gsub('.tmtheme', '').gsub(/\W/, '').gsub(/_+/, '_')
|
43
|
+
code_name = "pre.#{standard_name}"
|
44
|
+
|
45
|
+
render["tags"] = []
|
46
|
+
@theme["settings"].each do |t|
|
47
|
+
if t["scope"]
|
48
|
+
tag = {}
|
49
|
+
tag["selector"] = t["scope"]
|
50
|
+
class_name = t["name"].downcase.gsub(/\W/, ' ').gsub('.tmtheme', '').split(' ').collect{|s| s.capitalize}.join
|
51
|
+
if class_name == ""
|
52
|
+
class_name = "x" * t["name"].size
|
53
|
+
end
|
54
|
+
tag["begin"] = "<span class=\"#{class_name}\">"
|
55
|
+
tag["end"] = "</span>"
|
56
|
+
render["tags"] << tag
|
57
|
+
|
58
|
+
|
59
|
+
if s = t["settings"]
|
60
|
+
style = {}
|
61
|
+
style["color"] = normalize_color(s["foreground"])
|
62
|
+
style["background-color"] = normalize_color(s["background"])
|
63
|
+
case s["fontStyle"]
|
64
|
+
when /bold/ then style["font-weight"] = "bold"
|
65
|
+
when /italic/ then style["font-style"] = "italic"
|
66
|
+
when /underline/ then style["text-decoration"] = "underline"
|
67
|
+
end
|
68
|
+
css[".#{class_name}"] = style
|
69
|
+
end
|
70
|
+
elsif ! t["name"]
|
71
|
+
if s = t["settings"]
|
72
|
+
style = {}
|
73
|
+
style["color"] = normalize_color(s["foreground"])
|
74
|
+
style["background-color"] = normalize_color(s["background"])
|
75
|
+
css[code_name] = style
|
76
|
+
@style = style
|
77
|
+
style = {}
|
78
|
+
style["color"] = normalize_color(s["foreground"])
|
79
|
+
style["background-color"] = normalize_color(s["selection"])
|
80
|
+
css[".line-numbers"] = style
|
81
|
+
tag = {}
|
82
|
+
tag["begin"] = "<span class=\"line-numbers\">"
|
83
|
+
tag["end"] = "</span>"
|
84
|
+
render["line-numbers"] = tag
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
File.open( "#{standard_name}.render", "w" ) {|f| YAML.dump( render, f ) }
|
90
|
+
|
91
|
+
File.open( "#{standard_name}.css", "w" ) do |f|
|
92
|
+
css.each do |key, values|
|
93
|
+
if key == code_name
|
94
|
+
f.puts "#{code_name} {"
|
95
|
+
#puts @style
|
96
|
+
else
|
97
|
+
f.puts "#{code_name} #{key} {"
|
98
|
+
end
|
99
|
+
values.each do |style, value|
|
100
|
+
f.puts " #{style}: #{value};" if value
|
101
|
+
end
|
102
|
+
f.puts "}"
|
103
|
+
end
|
104
|
+
end
|
data/bin/uv
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'rubygems'
|
5
|
+
require 'uv'
|
6
|
+
rescue LoadError
|
7
|
+
$:.unshift File.join( File.dirname(__FILE__), '..', 'lib' )
|
8
|
+
require 'uv'
|
9
|
+
end
|
10
|
+
|
11
|
+
require 'optparse'
|
12
|
+
require 'ostruct'
|
13
|
+
|
14
|
+
o = OpenStruct.new
|
15
|
+
|
16
|
+
options = OptionParser.new
|
17
|
+
|
18
|
+
options.banner =<<END
|
19
|
+
|
20
|
+
Usage: uv [options] input_file
|
21
|
+
|
22
|
+
Parses input_file and outputs the coresponding HTML to stdout.
|
23
|
+
If no syntax is specified, it tries to guess the best one.
|
24
|
+
If no theme is specified, defaults to espresso_libre.
|
25
|
+
|
26
|
+
Example:
|
27
|
+
|
28
|
+
uv -t amy -h ~/.bashrc > bashrc.html
|
29
|
+
|
30
|
+
Renders the contents of ~/.bashrc to file bashrc.html
|
31
|
+
as a standalone web page.
|
32
|
+
|
33
|
+
All options are non-mandatory
|
34
|
+
|
35
|
+
Options:
|
36
|
+
|
37
|
+
END
|
38
|
+
|
39
|
+
options.on( "-s SYNTAX", "--syntax SYNTAX", <<DESCRIPTION, Uv.syntaxes) {|val| o.syntax = val}
|
40
|
+
The file's syntax (e.g. ruby, c++, etc.)
|
41
|
+
DESCRIPTION
|
42
|
+
|
43
|
+
options.on( "-t THEME", "--theme THEME", <<DESCRIPTION, Uv.themes) {|val| o.theme = val}
|
44
|
+
The theme to be used (e.g. amy, espresso_libre, etc.)
|
45
|
+
DESCRIPTION
|
46
|
+
|
47
|
+
options.on( "-n", "--no-lines", <<DESCRIPTION ) {|val| o.no_lines = !val}
|
48
|
+
Produces output without line numbers
|
49
|
+
DESCRIPTION
|
50
|
+
|
51
|
+
|
52
|
+
options.on( "-h", "--headers", <<DESCRIPTION ) {|val| o.headers = val}
|
53
|
+
Include headers, outputs a self-contained web page
|
54
|
+
DESCRIPTION
|
55
|
+
|
56
|
+
options.on( "-d", "--debug", <<DESCRIPTION ) {|val| o.debug = val}
|
57
|
+
Outputs debug information instead of normal page rendering
|
58
|
+
DESCRIPTION
|
59
|
+
|
60
|
+
options.on( "-l [syntaxes|themes]", "--list [syntaxes|themes]", ['syntaxes', 'themes'], <<DESCRIPTION ) {|val| o.list = val}
|
61
|
+
Lists all the available syntaxes/themes
|
62
|
+
DESCRIPTION
|
63
|
+
|
64
|
+
|
65
|
+
options.on( "-?", "--help", <<DESCRIPTION ) {|val| o.help = val}
|
66
|
+
Show this message
|
67
|
+
DESCRIPTION
|
68
|
+
|
69
|
+
rest = options.parse( ARGV )
|
70
|
+
|
71
|
+
|
72
|
+
if o.help
|
73
|
+
puts options
|
74
|
+
exit
|
75
|
+
elsif o.list
|
76
|
+
if o.list == 'syntaxes'
|
77
|
+
puts "Available syntaxes:\n"
|
78
|
+
Uv.syntaxes.sort.each{ |s| puts " - #{s}"}
|
79
|
+
elsif o.list == 'themes'
|
80
|
+
puts "Available themes:\n"
|
81
|
+
Uv.themes.sort.each{ |t| puts " - #{t}"}
|
82
|
+
else
|
83
|
+
STDERR.puts "Option #{o.list} is not valid should be one of [syntaxes, themes]"
|
84
|
+
end
|
85
|
+
exit
|
86
|
+
end
|
87
|
+
|
88
|
+
o.filename = rest[0]
|
89
|
+
|
90
|
+
if o.filename && ! o.syntax
|
91
|
+
candidates = Uv.syntax_for_file o.filename
|
92
|
+
if candidates.size > 1
|
93
|
+
STDERR.puts "Many syntaxes match, please specify"
|
94
|
+
STDERR.puts "\nMatching syntaxes:"
|
95
|
+
candidates.sort.each { |name, syntax| STDERR.puts "\t - " + name}
|
96
|
+
exit -1
|
97
|
+
end
|
98
|
+
o.syntax = candidates.first.first
|
99
|
+
end
|
100
|
+
|
101
|
+
unless o.syntax
|
102
|
+
STDERR.puts "No default syntax found, please specify"
|
103
|
+
exit -1
|
104
|
+
end
|
105
|
+
|
106
|
+
if o.filename
|
107
|
+
o.text = File.read(o.filename)
|
108
|
+
else
|
109
|
+
o.text = STDIN
|
110
|
+
end
|
111
|
+
|
112
|
+
if o.debug
|
113
|
+
Uv.debug( o.text, o.syntax )
|
114
|
+
exit
|
115
|
+
end
|
116
|
+
|
117
|
+
o.theme ||= "espresso_libre"
|
118
|
+
o.stylesheet = "#{o.theme}.css"
|
119
|
+
|
120
|
+
puts <<END
|
121
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
122
|
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
123
|
+
|
124
|
+
<head>
|
125
|
+
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
|
126
|
+
<meta http-equiv="cache-control" content="no-cache" />
|
127
|
+
<meta http-equiv="expires" content="3600" />
|
128
|
+
<meta name="revisit-after" content="2 days" />
|
129
|
+
<meta name="robots" content="index,follow" />
|
130
|
+
<meta name="publisher" content="Dichodaemon" />
|
131
|
+
<meta name="copyright" content="Dichodaemon" />
|
132
|
+
|
133
|
+
<meta name="author" content="Dichodaemon" />
|
134
|
+
<meta name="distribution" content="global" />
|
135
|
+
<meta name="description" content="Ocatarinetabellachithchix" />
|
136
|
+
<meta name="keywords" content="arzaversperia flexilimosos toves" />
|
137
|
+
<link rel="stylesheet" type="text/css" media="screen,projection,print" href="css/#{o.stylesheet}" />
|
138
|
+
<title>#{o.theme}</title>
|
139
|
+
|
140
|
+
</head>
|
141
|
+
|
142
|
+
<body>
|
143
|
+
END
|
144
|
+
|
145
|
+
puts Uv.parse( o.text, "xhtml", o.syntax, ! o.lines, o.theme )
|
146
|
+
|
147
|
+
puts <<END
|
148
|
+
<p>
|
149
|
+
<a href="http://validator.w3.org/check?uri=referer">
|
150
|
+
<img style="border:0"
|
151
|
+
src="http://www.w3.org/Icons/valid-xhtml10"
|
152
|
+
alt="Valid XHTML 1.0 Strict" height="31" width="88" />
|
153
|
+
</a>
|
154
|
+
<a href="http://jigsaw.w3.org/css-validator/check?uri=referer">
|
155
|
+
<img style="border:0;width:88px;height:31px"
|
156
|
+
src="http://jigsaw.w3.org/css-validator/images/vcss"
|
157
|
+
alt="Valid CSS!" />
|
158
|
+
</a>
|
159
|
+
</p>
|
160
|
+
</body>
|
161
|
+
</html>
|
162
|
+
END
|