wbzyl-codehighlighter-middleware 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/LICENSE +0 -0
- data/README.markdown +290 -0
- data/Rakefile +39 -0
- data/TODO +22 -0
- data/VERSION.yml +4 -0
- data/codehighlighter-middleware.gemspec +74 -0
- data/examples/app.rb +15 -0
- data/examples/config.ru +14 -0
- data/examples/public/javascripts/lang-css.js +2 -0
- data/examples/public/javascripts/lang-hs.js +2 -0
- data/examples/public/javascripts/lang-lisp.js +3 -0
- data/examples/public/javascripts/lang-lua.js +2 -0
- data/examples/public/javascripts/lang-ml.js +2 -0
- data/examples/public/javascripts/lang-proto.js +1 -0
- data/examples/public/javascripts/lang-sql.js +2 -0
- data/examples/public/javascripts/lang-vb.js +2 -0
- data/examples/public/javascripts/lang-wiki.js +1 -0
- data/examples/public/javascripts/prettify.js +31 -0
- data/examples/public/stylesheets/application.css +29 -0
- data/examples/public/stylesheets/coderay.css +126 -0
- data/examples/public/stylesheets/prettify.css +44 -0
- data/examples/public/stylesheets/syntax.css +79 -0
- data/examples/public/stylesheets/uv/amy.css +147 -0
- data/examples/public/stylesheets/uv/blackboard.css +88 -0
- data/examples/public/stylesheets/uv/cobalt.css +149 -0
- data/examples/public/stylesheets/uv/dawn.css +121 -0
- data/examples/public/stylesheets/uv/espresso_libre.css +109 -0
- data/examples/public/stylesheets/uv/sunburst.css +180 -0
- data/examples/public/stylesheets/uv/twilight.css +137 -0
- data/examples/public/stylesheets/uv/zenburnesque.css +91 -0
- data/examples/public/stylesheets/uv.css +1022 -0
- data/examples/views/index.rdiscount +75 -0
- data/examples/views/layout.rdiscount +36 -0
- data/lib/codehighlighter-middleware.rb +99 -0
- metadata +97 -0
data/.gitignore
ADDED
data/LICENSE
ADDED
File without changes
|
data/README.markdown
ADDED
@@ -0,0 +1,290 @@
|
|
1
|
+
# Rack Middleware for Code Highlighting
|
2
|
+
|
3
|
+
The *Codehighlighter* gem provides a thin interface over a bunch
|
4
|
+
of exisitng code highlighters to make their usage as generic possible.
|
5
|
+
|
6
|
+
To install it, run:
|
7
|
+
|
8
|
+
sudo gem install wbzyl-codehighlighter-middleware -s http://gems.github.com
|
9
|
+
|
10
|
+
Markup your code with:
|
11
|
+
|
12
|
+
<pre><code>:::ruby
|
13
|
+
...
|
14
|
+
</code></pre>
|
15
|
+
|
16
|
+
Example (incomplete html, needs a layout file with link to css):
|
17
|
+
|
18
|
+
# file simple.rb
|
19
|
+
|
20
|
+
require 'rubygems'
|
21
|
+
require 'sinatra'
|
22
|
+
require 'coderay' # use the Coderay highlighter
|
23
|
+
|
24
|
+
gem 'wbzyl-sinatra-rdiscount'
|
25
|
+
require 'wbzyl-codehighlighter-middleware'
|
26
|
+
|
27
|
+
use Rack::Codehighlighter, :coderay
|
28
|
+
|
29
|
+
get "/" do
|
30
|
+
erb :hello
|
31
|
+
end
|
32
|
+
|
33
|
+
__END__
|
34
|
+
|
35
|
+
@@ hello
|
36
|
+
### Fibonacci numbers in Ruby
|
37
|
+
|
38
|
+
<pre><code>:::ruby
|
39
|
+
def fib(n)
|
40
|
+
if n < 2
|
41
|
+
1
|
42
|
+
else
|
43
|
+
fib(n-2) + fib(n-1)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
</code></pre>
|
47
|
+
|
48
|
+
## An example
|
49
|
+
|
50
|
+
The Codehighlighter follows the same syntax as regular Markdown
|
51
|
+
code blocks, with one exception. It needs to know what
|
52
|
+
language to use for the code block.
|
53
|
+
|
54
|
+
If the first line begins with three colons, the text following
|
55
|
+
the colons identifies the language (ruby in the example).
|
56
|
+
The first line is removed from the code block before processing.
|
57
|
+
|
58
|
+
Run the above example with:
|
59
|
+
|
60
|
+
ruby simple.rb
|
61
|
+
|
62
|
+
The directory *examples* contains ready to run, simple Sinatra app. Try
|
63
|
+
|
64
|
+
rackup -p 4567 config.ru
|
65
|
+
|
66
|
+
or better yet (requires the *thin* gem to be installed):
|
67
|
+
|
68
|
+
thin --rackup config.ru -p 4567 start
|
69
|
+
|
70
|
+
|
71
|
+
Finally, visit the following url:
|
72
|
+
|
73
|
+
http://localhost:4567
|
74
|
+
|
75
|
+
and contemplate the sheer beauty of the rendered code.
|
76
|
+
|
77
|
+
|
78
|
+
## Supported Highlighters
|
79
|
+
|
80
|
+
These currently include: *Syntax* (fast), *Coderay* (very fast),
|
81
|
+
*Ultraviolet* (slow).
|
82
|
+
|
83
|
+
### Syntax
|
84
|
+
|
85
|
+
Supported languages:
|
86
|
+
|
87
|
+
* xml
|
88
|
+
* ruby
|
89
|
+
|
90
|
+
I added support for these languages:
|
91
|
+
|
92
|
+
* ansic
|
93
|
+
* javascript
|
94
|
+
* css21
|
95
|
+
* sqlite
|
96
|
+
|
97
|
+
|
98
|
+
### [Coderay](http://coderay.rubychan.de/)
|
99
|
+
|
100
|
+
Supported languages:
|
101
|
+
|
102
|
+
* C
|
103
|
+
* CSS
|
104
|
+
* Delphi
|
105
|
+
* diff
|
106
|
+
* HTML
|
107
|
+
* RHTML (Rails)
|
108
|
+
* Nitro-XHTML
|
109
|
+
* Java
|
110
|
+
* JavaScript
|
111
|
+
* JSON
|
112
|
+
* Ruby
|
113
|
+
* YAML
|
114
|
+
|
115
|
+
### [Google Code Prettify](http://code.google.com/p/google-code-prettify/), pure Javascript
|
116
|
+
|
117
|
+
Supported languages:
|
118
|
+
|
119
|
+
* css, lisp, hs, lua, sql, vb, wiki,
|
120
|
+
* bsh, c, cc, cpp, cs, csh, cyc, cv, htm, html,
|
121
|
+
* java, js, m, mxml, perl, pl, pm, py, rb, sh,
|
122
|
+
* xhtml, xml, xsl
|
123
|
+
|
124
|
+
|
125
|
+
### Ultraviolet
|
126
|
+
|
127
|
+
Needs oniguruma regexp library.
|
128
|
+
Installation instruction for Oniguruma:
|
129
|
+
[Carbonica](http://carboni.ca/projects/harsh/)
|
130
|
+
|
131
|
+
Supported languages:
|
132
|
+
|
133
|
+
* actionscript
|
134
|
+
* active4d
|
135
|
+
* active4d\_html
|
136
|
+
* active4d\_ini
|
137
|
+
* active4d\_library
|
138
|
+
* ada
|
139
|
+
* antlr
|
140
|
+
* apache
|
141
|
+
* applescript
|
142
|
+
* asp
|
143
|
+
* asp\_vb.net
|
144
|
+
* bibtex
|
145
|
+
* blog\_html
|
146
|
+
* blog\_markdown
|
147
|
+
* blog\_text
|
148
|
+
* blog\_textile
|
149
|
+
* build
|
150
|
+
* bulletin\_board
|
151
|
+
* c
|
152
|
+
* c++
|
153
|
+
* cake
|
154
|
+
* camlp4
|
155
|
+
* cm
|
156
|
+
* coldfusion
|
157
|
+
* context\_free
|
158
|
+
* cs
|
159
|
+
* css
|
160
|
+
* css\_experimental
|
161
|
+
* csv
|
162
|
+
* d
|
163
|
+
* diff
|
164
|
+
* dokuwiki
|
165
|
+
* dot
|
166
|
+
* doxygen
|
167
|
+
* dylan
|
168
|
+
* eiffel
|
169
|
+
* erlang
|
170
|
+
* f-script
|
171
|
+
* fortran
|
172
|
+
* fxscript
|
173
|
+
* greasemonkey
|
174
|
+
* gri
|
175
|
+
* groovy
|
176
|
+
* gtd
|
177
|
+
* gtdalt
|
178
|
+
* haml
|
179
|
+
* haskell
|
180
|
+
* html
|
181
|
+
* html-asp
|
182
|
+
* html\_django
|
183
|
+
* html\_for\_asp.net
|
184
|
+
* html\_mason
|
185
|
+
* html\_rails
|
186
|
+
* html\_tcl
|
187
|
+
* icalendar
|
188
|
+
* inform
|
189
|
+
* ini
|
190
|
+
* installer\_distribution\_script
|
191
|
+
* io
|
192
|
+
* java
|
193
|
+
* javaproperties
|
194
|
+
* javascript
|
195
|
+
* javascript\_+\_prototype
|
196
|
+
* javascript\_+\_prototype\_bracketed
|
197
|
+
* jquery\_javascript
|
198
|
+
* json
|
199
|
+
* languagedefinition
|
200
|
+
* latex
|
201
|
+
* latex\_beamer
|
202
|
+
* latex\_log
|
203
|
+
* latex\_memoir
|
204
|
+
* lexflex
|
205
|
+
* lighttpd
|
206
|
+
* lilypond
|
207
|
+
* lisp
|
208
|
+
* literate\_haskell
|
209
|
+
* logo
|
210
|
+
* logtalk
|
211
|
+
* lua
|
212
|
+
* m
|
213
|
+
* macports\_portfile
|
214
|
+
* mail
|
215
|
+
* makefile
|
216
|
+
* man
|
217
|
+
* markdown
|
218
|
+
* mediawiki
|
219
|
+
* mel
|
220
|
+
* mips
|
221
|
+
* mod\_perl
|
222
|
+
* modula-3
|
223
|
+
* moinmoin
|
224
|
+
* mootools
|
225
|
+
* movable\_type
|
226
|
+
* multimarkdown
|
227
|
+
* objective-c
|
228
|
+
* objective-c++
|
229
|
+
* ocaml
|
230
|
+
* ocamllex
|
231
|
+
* ocamlyacc
|
232
|
+
* opengl
|
233
|
+
* pascal
|
234
|
+
* perl
|
235
|
+
* php
|
236
|
+
* plain\_text
|
237
|
+
* pmwiki
|
238
|
+
* postscript
|
239
|
+
* processing
|
240
|
+
* prolog
|
241
|
+
* property\_list
|
242
|
+
* python
|
243
|
+
* python\_django
|
244
|
+
* qmake\_project
|
245
|
+
* qt\_c++
|
246
|
+
* quake3\_config
|
247
|
+
* r
|
248
|
+
* r\_console
|
249
|
+
* ragel
|
250
|
+
* rd\_r\_documentation
|
251
|
+
* regexp
|
252
|
+
* regular\_expressions\_oniguruma
|
253
|
+
* regular\_expressions\_python
|
254
|
+
* release\_notes
|
255
|
+
* remind
|
256
|
+
* restructuredtext
|
257
|
+
* rez
|
258
|
+
* ruby
|
259
|
+
* ruby\_experimental
|
260
|
+
* ruby\_on\_rails
|
261
|
+
* s5
|
262
|
+
* scheme
|
263
|
+
* scilab
|
264
|
+
* setext
|
265
|
+
* shell-unix-generic
|
266
|
+
* slate
|
267
|
+
* smarty
|
268
|
+
* sql
|
269
|
+
* sql\_rails
|
270
|
+
* ssh-config
|
271
|
+
* standard\_ml
|
272
|
+
* strings\_file
|
273
|
+
* subversion\_commit\_message
|
274
|
+
* sweave
|
275
|
+
* swig
|
276
|
+
* tcl
|
277
|
+
* template\_toolkit
|
278
|
+
* tex
|
279
|
+
* tex\_math
|
280
|
+
* textile
|
281
|
+
* tsv
|
282
|
+
* twiki
|
283
|
+
* txt2tags
|
284
|
+
* vectorscript
|
285
|
+
* xhtml\_1.0
|
286
|
+
* xml
|
287
|
+
* xml\_strict
|
288
|
+
* xsl
|
289
|
+
* yaml
|
290
|
+
* yui\_javascript
|
data/Rakefile
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "rake/gempackagetask"
|
3
|
+
require "rake/clean"
|
4
|
+
#require "spec/rake/spectask"
|
5
|
+
|
6
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '/lib')
|
7
|
+
|
8
|
+
begin
|
9
|
+
require 'jeweler'
|
10
|
+
Jeweler::Tasks.new do |s|
|
11
|
+
s.name = "codehighlighter-middleware"
|
12
|
+
s.summary = "Rack Middleware for Code Highlighting."
|
13
|
+
s.email = "matwb@univ.gda.pl"
|
14
|
+
s.homepage = "http://github.com/wbzyl/codehighlighter-middleware"
|
15
|
+
s.authors = ["Wlodek Bzyl"]
|
16
|
+
s.description = s.summary
|
17
|
+
|
18
|
+
# s.add_dependency 'coderay', '>=0.8.312'
|
19
|
+
s.add_dependency 'hpricot', '>=0.8.1'
|
20
|
+
end
|
21
|
+
rescue LoadError
|
22
|
+
puts "Jeweler not available."
|
23
|
+
puts "Install it with:"
|
24
|
+
puts " sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
25
|
+
end
|
26
|
+
|
27
|
+
#Rake::TestTask.new(:test) do |t|
|
28
|
+
# t.libs << 'lib' << 'test'
|
29
|
+
# t.pattern = 'test/**/*_test.rb'
|
30
|
+
# t.verbose = false
|
31
|
+
#end
|
32
|
+
|
33
|
+
desc 'Install the package as a gem.'
|
34
|
+
task :install => [:clean, :build] do
|
35
|
+
gem = Dir['pkg/*.gem'].last
|
36
|
+
sh "sudo gem install --no-rdoc --no-ri --local #{gem}"
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :test
|
data/TODO
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
[1.05.2009, done]
|
3
|
+
Add support for code-prettify:
|
4
|
+
|
5
|
+
* [source code](http://code.google.com/p/google-code-prettify/)
|
6
|
+
[example](http://google-code-prettify.googlecode.com/svn/trunk/README.html)
|
7
|
+
|
8
|
+
|
9
|
+
* see http://tomayko.com/writings/javascript-prettification
|
10
|
+
(support for jQuery, new pallette)
|
11
|
+
|
12
|
+
* example:
|
13
|
+
<pre class="prettyprint lang-html">
|
14
|
+
The lang-* class specifies the language file extensions.
|
15
|
+
File extensions supported by default include
|
16
|
+
"bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
|
17
|
+
"java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
|
18
|
+
"xhtml", "xml", "xsl".
|
19
|
+
</pre>
|
20
|
+
|
21
|
+
[1.05.2009]
|
22
|
+
Add support for unobtrustive Code Highlighter By Dan Webb 11/2005
|
data/VERSION.yml
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{codehighlighter-middleware}
|
5
|
+
s.version = "0.0.7"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Wlodek Bzyl"]
|
9
|
+
s.date = %q{2009-05-22}
|
10
|
+
s.description = %q{Rack Middleware for Code Highlighting.}
|
11
|
+
s.email = %q{matwb@univ.gda.pl}
|
12
|
+
s.extra_rdoc_files = [
|
13
|
+
"LICENSE",
|
14
|
+
"README.markdown"
|
15
|
+
]
|
16
|
+
s.files = [
|
17
|
+
".gitignore",
|
18
|
+
"LICENSE",
|
19
|
+
"README.markdown",
|
20
|
+
"Rakefile",
|
21
|
+
"TODO",
|
22
|
+
"VERSION.yml",
|
23
|
+
"codehighlighter-middleware.gemspec",
|
24
|
+
"examples/app.rb",
|
25
|
+
"examples/config.ru",
|
26
|
+
"examples/public/javascripts/lang-css.js",
|
27
|
+
"examples/public/javascripts/lang-hs.js",
|
28
|
+
"examples/public/javascripts/lang-lisp.js",
|
29
|
+
"examples/public/javascripts/lang-lua.js",
|
30
|
+
"examples/public/javascripts/lang-ml.js",
|
31
|
+
"examples/public/javascripts/lang-proto.js",
|
32
|
+
"examples/public/javascripts/lang-sql.js",
|
33
|
+
"examples/public/javascripts/lang-vb.js",
|
34
|
+
"examples/public/javascripts/lang-wiki.js",
|
35
|
+
"examples/public/javascripts/prettify.js",
|
36
|
+
"examples/public/stylesheets/application.css",
|
37
|
+
"examples/public/stylesheets/coderay.css",
|
38
|
+
"examples/public/stylesheets/prettify.css",
|
39
|
+
"examples/public/stylesheets/syntax.css",
|
40
|
+
"examples/public/stylesheets/uv.css",
|
41
|
+
"examples/public/stylesheets/uv/amy.css",
|
42
|
+
"examples/public/stylesheets/uv/blackboard.css",
|
43
|
+
"examples/public/stylesheets/uv/cobalt.css",
|
44
|
+
"examples/public/stylesheets/uv/dawn.css",
|
45
|
+
"examples/public/stylesheets/uv/espresso_libre.css",
|
46
|
+
"examples/public/stylesheets/uv/sunburst.css",
|
47
|
+
"examples/public/stylesheets/uv/twilight.css",
|
48
|
+
"examples/public/stylesheets/uv/zenburnesque.css",
|
49
|
+
"examples/views/index.rdiscount",
|
50
|
+
"examples/views/layout.rdiscount",
|
51
|
+
"lib/codehighlighter-middleware.rb"
|
52
|
+
]
|
53
|
+
s.homepage = %q{http://github.com/wbzyl/codehighlighter-middleware}
|
54
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
55
|
+
s.require_paths = ["lib"]
|
56
|
+
s.rubygems_version = %q{1.3.3}
|
57
|
+
s.summary = %q{Rack Middleware for Code Highlighting.}
|
58
|
+
s.test_files = [
|
59
|
+
"examples/app.rb"
|
60
|
+
]
|
61
|
+
|
62
|
+
if s.respond_to? :specification_version then
|
63
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
64
|
+
s.specification_version = 3
|
65
|
+
|
66
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
67
|
+
s.add_runtime_dependency(%q<hpricot>, [">= 0.8.1"])
|
68
|
+
else
|
69
|
+
s.add_dependency(%q<hpricot>, [">= 0.8.1"])
|
70
|
+
end
|
71
|
+
else
|
72
|
+
s.add_dependency(%q<hpricot>, [">= 0.8.1"])
|
73
|
+
end
|
74
|
+
end
|
data/examples/app.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'sinatra'
|
5
|
+
require 'rdiscount'
|
6
|
+
require 'sinatra/rdiscount'
|
7
|
+
require 'codehighlighter-middleware'
|
8
|
+
|
9
|
+
require 'coderay' # Coderay
|
10
|
+
#require 'syntax/convertors/html' # Syntax
|
11
|
+
#require 'uv' # Ultraviolet
|
12
|
+
|
13
|
+
get "/" do
|
14
|
+
rdiscount :index
|
15
|
+
end
|
data/examples/config.ru
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# run with: thin --rackup config.ru -p 4567 start
|
2
|
+
|
3
|
+
require 'app'
|
4
|
+
|
5
|
+
use Rack::Lint
|
6
|
+
|
7
|
+
#use Rack::Codehighlighter, :coderay
|
8
|
+
use Rack::Codehighlighter, :prettify
|
9
|
+
#use Rack::Codehighlighter, :syntax
|
10
|
+
#use Rack::Codehighlighter, :ultraviolet, :theme => 'espresso_libre'
|
11
|
+
|
12
|
+
use Rack::Static, :urls => ["/stylesheets"], :root => "public"
|
13
|
+
|
14
|
+
run Sinatra::Application
|
@@ -0,0 +1,2 @@
|
|
1
|
+
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \t\r\n\f]+/,null," \t\r\n\u000c"]],[["str",/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],["str",/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["str",/^\([^\)\"\']*\)/,/\burl/i],["kwd",/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["kwd",/^-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*(?=\s*:)/i],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],["com",/^(?:<!--|--\>)/],
|
2
|
+
["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#(?:[0-9a-f]{3}){1,2}/i],["pln",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],["pun",/^[^\s\w\'\"]+/]]),["css"]);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:(?:--+(?:[^\r\n\x0C_:\"\'\(\),;\[\]`\{\}][^\r\n\x0C_]*)?(?=[\x0C\r\n]|$))|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/,
|
2
|
+
null],["pln",/^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],["pun",/^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]]),["hs"]);
|
@@ -0,0 +1,3 @@
|
|
1
|
+
(function(){var a=null;
|
2
|
+
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(/,a,"("],["clo",/^\)/,a,")"],["com",/^;[^\r\n]*/,a,";"],["pln",/^[\t\n\r \xA0]+/,a,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|cons|defun|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a],["lit",/^[+\-]?(?:\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[eEdD][+\-]?\d+)?)/],["lit",
|
3
|
+
/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["cl","el","lisp","scm"])})()
|
@@ -0,0 +1,2 @@
|
|
1
|
+
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],["str",/^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^[a-z_]\w*/i],
|
2
|
+
["pun",/^[^\w\t\n\r \xA0]+/]]),["lua"]);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/],
|
2
|
+
["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_]\w*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]);
|
@@ -0,0 +1 @@
|
|
1
|
+
PR.registerLangHandler(PR.sourceDecorator({keywords:"bool bytes default double enum extend extensions false fixed32 fixed64 float group import int32 int64 max message option optional package repeated required returns rpc service sfixed32 sfixed64 sint32 sint64 string syntax to true uint32 uint64",cStyleComments:true}),["proto"]);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],["kwd",/^(?:ADD|ALL|ALTER|AND|ANY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|NATIONAL|NOCHECK|NONCLUSTERED|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PERCENT|PLAN|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNION|UNIQUE|UPDATE|UPDATETEXT|USE|USER|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WRITETEXT)(?=[^\w-]|$)/i,
|
2
|
+
null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^[a-z_][\w-]*/i],["pun",/^[^\w\t\n\r \xA0]+/]]),["sql"]);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D][cC]|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/,null,'"\u201c\u201d'],["com",/^[\'\u2018\u2019][^\r\n\u2028\u2029]*/,null,"'\u2018\u2019"]],[["kwd",/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i,
|
2
|
+
null],["com",/^REM[^\r\n\u2028\u2029]*/i],["lit",/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*\])/i],["pun",/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],["pun",/^(?:\[|\])/]]),["vb","vbs"]);
|
@@ -0,0 +1 @@
|
|
1
|
+
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0a-gi-z0-9]+/,null,"\t\n\r \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[=*~\^\[\]]+/,null,"=*~^[]"]],[["kwd",/^#[a-z]+\b/,/(?:^|[\r\n])$/],["lit",/^(?:[A-Z][a-z][a-z0-9]+[A-Z][a-z][a-zA-Z0-9]+)\b/],["lang-",/^\{\{\{([\s\S]+?)\}\}\}/],["lang-",/^`([^\r\n`]+)`/],["str",/^https?:\/\/[^\/?#\s]*(?:\/[^?#\s]*)?(?:\?[^#\s]*)?(?:#\S*)?/i],["pln",/^[\s\S][^#=*~^A-Zh\{`\[]+/]]),["wiki"]);
|
@@ -0,0 +1,31 @@
|
|
1
|
+
(function(){
|
2
|
+
var j=null,n=true;window.PR_SHOULD_USE_CONTINUATION=n;window.PR_TAB_WIDTH=8;window.PR_normalizedHtml=window.PR=window.prettyPrintOne=window.prettyPrint=void 0;window._pr_isIE6=function(){var K=navigator&&navigator.userAgent&&/\bMSIE 6\./.test(navigator.userAgent);window._pr_isIE6=function(){return K};return K};
|
3
|
+
var ba="a",ca="z",da="A",ea="Z",fa="!",ga="!=",ha="!==",ia="#",ja="%",ka="%=",x="&",la="&&",ma="&&=",na="&=",oa="(",pa="*",qa="*=",ra="+=",sa=",",ta="-=",ua="->",va="/",Da="/=",Ea=":",Fa="::",Ga=";",z="<",Ha="<<",Ia="<<=",Ja="<=",Ka="=",La="==",Ma="===",B=">",Na=">=",Oa=">>",Pa=">>=",Qa=">>>",Ra=">>>=",Sa="?",Ta="@",Ua="[",Va="^",Wa="^=",Xa="^^",Ya="^^=",Za="{",$a="|",ab="|=",bb="||",cb="||=",db="~",eb="break",fb="case",gb="continue",hb="delete",ib="do",jb="else",kb="finally",lb="instanceof",mb="return",
|
4
|
+
nb="throw",ob="try",pb="typeof",qb="(?:(?:(?:^|[^0-9.])\\.{1,3})|(?:(?:^|[^\\+])\\+)|(?:(?:^|[^\\-])-)",rb="|\\b",sb="\\$1",tb="|^)\\s*$",ub="&",vb="<",wb=">",xb=""",yb="&#",zb="x",Ab="'",C='"',Bb=" ",Cb="XMP",Db="</",Eb='="',D="PRE",Fb='<!DOCTYPE foo PUBLIC "foo bar">\n<foo />',H="",Gb="\t",Hb="\n",Ib="nocode",Jb=' $1="$2$3$4"',I="pln",L="lang-",M="src",N="default-markup",O="default-code",P="com",Kb="dec",S="pun",Lb="lang-js",Mb="lang-css",T="tag",U="atv",Nb="<>/=",V="atn",Ob=" \t\r\n",
|
5
|
+
W="str",Pb="'\"",Qb="'\"`",Rb="\"'",Sb=" \r\n",X="lit",Tb="123456789",Ub=".",Vb="kwd",Wb="typ",Xb="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename typeof using virtual wchar_t where break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try debugger eval export function get null set undefined var with Infinity NaN caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END break continue do else for if return while case done elif esac eval fi function in local set then until ",
|
6
|
+
Y="</span>",Yb='<span class="',Zb='">',$b="$1 ",ac="<br />",bc="console",cc="cannot override language handler %s",dc="htm",ec="html",fc="mxml",gc="xhtml",hc="xml",ic="xsl",jc="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename typeof using virtual wchar_t where ",
|
7
|
+
kc="c",lc="cc",mc="cpp",nc="cxx",oc="cyc",pc="m",qc="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var ",
|
8
|
+
rc="cs",sc="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient ",tc="java",uc="break continue do else for if return while case done elif esac eval fi function in local set then until ",
|
9
|
+
vc="bsh",wc="csh",xc="sh",yc="break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ",zc="cv",Ac="py",Bc="caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ",Cc="perl",Dc="pl",Ec="pm",Fc="break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ",
|
10
|
+
Gc="rb",Hc="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try debugger eval export function get null set undefined var with Infinity NaN ",Ic="js",Jc="pre",Kc="code",Lc="xmp",Mc="prettyprint",Nc="class",Oc="br",Pc="\r\n";
|
11
|
+
(function(){function K(b){b=b.split(/ /g);var a={};for(var d=b.length;--d>=0;){var c=b[d];if(c)a[c]=j}return a}function Qc(b){return b>=ba&&b<=ca||b>=da&&b<=ea}function Q(b,a,d,c){b.unshift(d,c||0);try{a.splice.apply(a,b)}finally{b.splice(0,2)}}var Rc=(function(){var b=[fa,ga,ha,ia,ja,ka,x,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,Da,Ea,Fa,Ga,z,Ha,Ia,Ja,Ka,La,Ma,B,Na,Oa,Pa,Qa,Ra,Sa,Ta,Ua,Va,Wa,Xa,Ya,Za,$a,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb],a=qb;for(var d=0;d<b.length;++d){var c=b[d];a+=Qc(c.charAt(0))?
|
12
|
+
rb+c:$a+c.replace(/([^=<>:&])/g,sb)}a+=tb;return new RegExp(a)})(),wa=/&/g,xa=/</g,ya=/>/g,Sc=/\"/g;function Tc(b){return b.replace(wa,ub).replace(xa,vb).replace(ya,wb).replace(Sc,xb)}function Z(b){return b.replace(wa,ub).replace(xa,vb).replace(ya,wb)}var Uc=/</g,Vc=/>/g,Wc=/'/g,Xc=/"/g,Yc=/&/g,Zc=/ /g;function $c(b){var a=b.indexOf(x);if(a<0)return b;for(--a;(a=b.indexOf(yb,a+1))>=0;){var d=b.indexOf(Ga,a);if(d>=0){var c=b.substring(a+3,d),g=10;if(c&&c.charAt(0)===zb){c=
|
13
|
+
c.substring(1);g=16}var e=parseInt(c,g);isNaN(e)||(b=b.substring(0,a)+String.fromCharCode(e)+b.substring(d+1))}}return b.replace(Uc,z).replace(Vc,B).replace(Wc,Ab).replace(Xc,C).replace(Yc,x).replace(Zc,Bb)}function za(b){return Cb===b.tagName}function R(b,a){switch(b.nodeType){case 1:var d=b.tagName.toLowerCase();a.push(z,d);for(var c=0;c<b.attributes.length;++c){var g=b.attributes[c];if(!!g.specified){a.push(Bb);R(g,a)}}a.push(B);for(var e=b.firstChild;e;e=e.nextSibling)R(e,a);if(b.firstChild||
|
14
|
+
!/^(?:br|link|img)$/.test(d))a.push(Db,d,B);break;case 2:a.push(b.name.toLowerCase(),Eb,Tc(b.value),C);break;case 3:case 4:a.push(Z(b.nodeValue));break}}var $=j;function ad(b){if(j===$){var a=document.createElement(D);a.appendChild(document.createTextNode(Fb));$=!/</.test(a.innerHTML)}if($){var d=b.innerHTML;if(za(b))d=Z(d);return d}var c=[];for(var g=b.firstChild;g;g=g.nextSibling)R(g,c);return c.join(H)}function bd(b){var a=0;return function(d){var c=j,g=0;for(var e=0,k=d.length;e<k;++e){var f=
|
15
|
+
d.charAt(e);switch(f){case Gb:c||(c=[]);c.push(d.substring(g,e));var h=b-a%b;a+=h;for(;h>=0;h-=" ".length)c.push(" ".substring(0,h));g=e+1;break;case Hb:a=0;break;default:++a}}if(!c)return d;c.push(d.substring(g));return c.join(H)}}var cd=/(?:[^<]+|<!--[\s\S]*?--\>|<!\[CDATA\[([\s\S]*?)\]\]>|<\/?[a-zA-Z][^>]*>|<)/g,dd=/^<!--/,ed=/^<\[CDATA\[/,fd=/^<br\b/i,Aa=/^<(\/?)([a-zA-Z]+)/;function gd(b){var a=b.match(cd),d=[],c=0,g=[];if(a)for(var e=0,k=a.length;e<k;++e){var f=
|
16
|
+
a[e];if(f.length>1&&f.charAt(0)===z){if(!dd.test(f))if(ed.test(f)){d.push(f.substring(9,f.length-3));c+=f.length-12}else if(fd.test(f)){d.push(Hb);++c}else if(f.indexOf(Ib)>=0&&hd(f)){var h=f.match(Aa)[2],q=1,i;a:for(i=e+1;i<k;++i){var o=a[i].match(Aa);if(o&&o[2]===h)if(o[1]===va){if(--q===0)break a}else++q}if(i<k){g.push(c,a.slice(e,i+1).join(H));e=i}else g.push(c,f)}else g.push(c,f)}else{var r=$c(f);d.push(r);c+=r.length}}return{source:d.join(H),tags:g}}function hd(b){return!!b.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,
|
17
|
+
Jb).match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/)}function aa(b,a,d,c){if(!!a){var g=d.call({},a);if(b)for(var e=g.length;(e-=2)>=0;)g[e]+=b;c.push.apply(c,g)}}function J(b,a){var d={};(function(){var k=b.concat(a);for(var f=k.length;--f>=0;){var h=k[f],q=h[3];if(q)for(var i=q.length;--i>=0;)d[q.charAt(i)]=h}})();var c=a.length,g=/\S/,e=function(k,f){f=f||0;var h=[f,I],q=H,i=0,o=k;while(o.length){var r,l=j,m,p=d[o.charAt(0)];if(p){m=o.match(p[1]);l=m[0];r=p[0]}else{for(var s=0;s<c;++s){p=a[s];
|
18
|
+
var u=p[2];if(!(u&&!u.test(q))){if(m=o.match(p[1])){l=m[0];r=p[0];break}}}if(!l){r=I;l=o.substring(0,1)}}var t=L===r.substring(0,5);if(t&&!(m&&m[1])){t=false;r=M}if(t){var A=m[1],v=l.indexOf(A),E=v+A.length,F=r.substring(5);G.hasOwnProperty(F)||(F=/^\s*</.test(A)?N:O);aa(f+i,l.substring(0,v),e,h);aa(f+i+v,l.substring(v,E),G[F],h);aa(f+i+E,l.substring(E),e,h)}else h.push(f+i,r);i+=l.length;o=o.substring(l.length);if(r!==P&&g.test(l))q=l}return h};return e}var id=J([],[[I,/^[^<?]+/,j],[Kb,/^<!\w[^>]*(?:>|$)/,
|
19
|
+
j],[P,/^<!--[\s\S]*?(?:--\>|$)/,j],[L,/^<\?([\s\S]+?)(?:\?>|$)/,j],[L,/^<%([\s\S]+?)(?:%>|$)/,j],[S,/^(?:<[%?]|[%?]>)/,j],[L,/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i,j],[Lb,/^<script\b[^>]*>([\s\S]+?)<\/script\b[^>]*>/i,j],[Mb,/^<style\b[^>]*>([\s\S]+?)<\/style\b[^>]*>/i,j],[T,/^<\/?\w[^<>]*>/,j]]),jd=/^(<[^>]*>)([\s\S]*)(<\/[^>]*>)$/;function kd(b){var a=id(b);for(var d=0;d<a.length;d+=2)if(a[d+1]===M){var c,g;c=a[d];g=d+2<a.length?a[d+2]:b.length;var e=b.substring(c,g),k=e.match(jd);if(k)a.splice(d,
|
20
|
+
2,c,T,c+k[1].length,M,c+k[1].length+(k[2]||H).length,T)}return a}var ld=J([[U,/^\'[^\']*(?:\'|$)/,j,Ab],[U,/^\"[^\"]*(?:\"|$)/,j,C],[S,/^[<>\/=]+/,j,Nb]],[[T,/^[\w:\-]+/,/^</],[U,/^[\w\-]+/,/^=/],[V,/^[\w:\-]+/,j],[I,/^\s+/,j,Ob]]);function md(b,a){for(var d=0;d<a.length;d+=2){var c=a[d+1];if(c===T){var g,e;g=a[d];e=d+2<a.length?a[d+2]:b.length;var k=b.substring(g,e),f=ld(k,g);Q(f,a,d,2);d+=f.length-2}}return a}function y(b){var a=[],d=[];if(b.tripleQuotedStrings)a.push([W,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
|
21
|
+
j,Pb]);else b.multiLineStrings?a.push([W,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,j,Qb]):a.push([W,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,j,Rb]);d.push([I,/^(?:[^\'\"\`\/\#]+)/,j,Sb]);b.hashComments&&a.push([P,/^#[^\r\n]*/,j,ia]);if(b.cStyleComments){d.push([P,/^\/\/[^\r\n]*/,j]);d.push([P,/^\/\*[\s\S]*?(?:\*\/|$)/,j])}b.regexLiterals&&d.push([W,/^\/(?=[^\/*])(?:[^\/\x5B\x5C]|\x5C[\s\S]|\x5B(?:[^\x5C\x5D]|\x5C[\s\S])*(?:\x5D|$))+(?:\/|$)/,
|
22
|
+
Rc]);var c=K(b.keywords),g=J(a,d),e=J([],[[I,/^\s+/,j,Sb],[I,/^[a-z_$@][a-z_$@0-9]*/i,j],[X,/^0x[a-f0-9]+[a-z]/i,j],[X,/^(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?[a-z]*/i,j,Tb],[S,/^[^\s\w\.$@]+/,j]]);function k(f,h){for(var q=0;q<h.length;q+=2){var i=h[q+1];if(i===I){var o,r,l,m;o=h[q];r=q+2<h.length?h[q+2]:f.length;l=f.substring(o,r);m=e(l,o);for(var p=0,s=m.length;p<s;p+=2){var u=m[p+1];if(u===I){var t=m[p],A=p+2<s?m[p+2]:l.length,v=f.substring(t,A);if(v===Ub)m[p+1]=S;else if(v in c)m[p+
|
23
|
+
1]=Vb;else if(/^@?[A-Z][A-Z$]*[a-z][A-Za-z$]*$/.test(v))m[p+1]=v.charAt(0)===Ta?X:Wb}}Q(m,h,q,2);q+=m.length-2}}return h}return function(f){var h=g(f);return h=k(f,h)}}var Ba=y({keywords:Xb,hashComments:n,cStyleComments:n,multiLineStrings:n,regexLiterals:n});function nd(b,a){var d=false;for(var c=0;c<a.length;c+=2){var g=a[c+1],e,k;if(g===V){e=a[c];k=c+2<a.length?a[c+2]:b.length;d=/^on|^style$/i.test(b.substring(e,k))}else if(g===U){if(d){e=a[c];k=c+2<a.length?a[c+2]:b.length;var f=b.substring(e,
|
24
|
+
k),h=f.length,q=h>=2&&/^[\"\']/.test(f)&&f.charAt(0)===f.charAt(h-1),i,o,r;if(q){o=e+1;r=k-1;i=f}else{o=e+1;r=k-1;i=f.substring(1,f.length-1)}var l=Ba(i);for(var m=0,p=l.length;m<p;m+=2)l[m]+=o;if(q){l.push(r,U);Q(l,a,c+2,0)}else Q(l,a,c,2)}d=false}}return a}function od(b){var a=kd(b);a=md(b,a);return a=nd(b,a)}function pd(b,a,d){var c=[],g=0,e=j,k=j,f=0,h=0,q=bd(window.PR_TAB_WIDTH),i=/([\r\n ]) /g,o=/(^| ) /gm,r=/\r\n?|\n/g,l=/[ \r\n]$/,m=n;function p(u){if(u>g){if(e&&e!==k){c.push(Y);e=j}if(!e&&
|
25
|
+
k){e=k;c.push(Yb,e,Zb)}var t=Z(q(b.substring(g,u))).replace(m?o:i,$b);m=l.test(t);c.push(t.replace(r,ac));g=u}}while(n){var s;if(s=f<a.length?h<d.length?a[f]<=d[h]:n:false){p(a[f]);if(e){c.push(Y);e=j}c.push(a[f+1]);f+=2}else if(h<d.length){p(d[h]);k=d[h+1];h+=2}else break}p(b.length);e&&c.push(Y);return c.join(H)}var G={};function w(b,a){for(var d=a.length;--d>=0;){var c=a[d];if(G.hasOwnProperty(c))bc in window&&console.log(cc,c);else G[c]=b}}w(Ba,[O]);w(od,[N,dc,ec,fc,gc,hc,ic]);w(y({keywords:jc,
|
26
|
+
hashComments:n,cStyleComments:n}),[kc,lc,mc,nc,oc,pc]);w(y({keywords:qc,hashComments:n,cStyleComments:n}),[rc]);w(y({keywords:sc,cStyleComments:n}),[tc]);w(y({keywords:uc,hashComments:n,multiLineStrings:n}),[vc,wc,xc]);w(y({keywords:yc,hashComments:n,multiLineStrings:n,tripleQuotedStrings:n}),[zc,Ac]);w(y({keywords:Bc,hashComments:n,multiLineStrings:n,regexLiterals:n}),[Cc,Dc,Ec]);w(y({keywords:Fc,hashComments:n,multiLineStrings:n,regexLiterals:n}),[Gc]);w(y({keywords:Hc,cStyleComments:n,regexLiterals:n}),
|
27
|
+
[Ic]);function Ca(b,a){try{var d=gd(b),c=d.source,g=d.tags;G.hasOwnProperty(a)||(a=/^\s*</.test(c)?N:O);var e=G[a].call({},c);return pd(c,g,e)}catch(k){if(bc in window){console.log(k);console.a()}return b}}function qd(b){var a=window._pr_isIE6(),d=[document.getElementsByTagName(Jc),document.getElementsByTagName(Kc),document.getElementsByTagName(Lc)],c=[];for(var g=0;g<d.length;++g)for(var e=0,k=d[g].length;e<k;++e)c.push(d[g][e]);var f=0;function h(){var q=window.PR_SHOULD_USE_CONTINUATION?(new Date).getTime()+
|
28
|
+
250:Infinity;for(;f<c.length&&(new Date).getTime()<q;f++){var i=c[f];if(i.className&&i.className.indexOf(Mc)>=0){var o=i.className.match(/\blang-(\w+)\b/);if(o)o=o[1];var r=false;for(var l=i.parentNode;l;l=l.parentNode)if((l.tagName===Jc||l.tagName===Kc||l.tagName===Lc)&&l.className&&l.className.indexOf(Mc)>=0){r=n;break}if(!r){var m=ad(i);m=m.replace(/(?:\r\n?|\n)$/,H);var p=Ca(m,o);if(za(i)){var s=document.createElement(D);for(var u=0;u<i.attributes.length;++u){var t=i.attributes[u];if(t.specified){var A=
|
29
|
+
t.name.toLowerCase();if(A===Nc)s.className=t.value;else s.setAttribute(t.name,t.value)}}s.innerHTML=p;i.parentNode.replaceChild(s,i);i=s}else i.innerHTML=p;if(a&&i.tagName===D){var v=i.getElementsByTagName(Oc);for(var E=v.length;--E>=0;){var F=v[E];F.parentNode.replaceChild(document.createTextNode(Pc),F)}}}}}if(f<c.length)setTimeout(h,250);else b&&b()}h()}window.PR_normalizedHtml=R;window.prettyPrintOne=Ca;window.prettyPrint=qd;window.PR={createSimpleLexer:J,registerLangHandler:w,sourceDecorator:y,
|
30
|
+
PR_ATTRIB_NAME:V,PR_ATTRIB_VALUE:U,PR_COMMENT:P,PR_DECLARATION:Kb,PR_KEYWORD:Vb,PR_LITERAL:X,PR_NOCODE:Ib,PR_PLAIN:I,PR_PUNCTUATION:S,PR_SOURCE:M,PR_STRING:W,PR_TAG:T,PR_TYPE:Wb}})();
|
31
|
+
})()
|
@@ -0,0 +1,29 @@
|
|
1
|
+
html {
|
2
|
+
margin: 0;
|
3
|
+
padding: 0;
|
4
|
+
background-color: #0C7D85;
|
5
|
+
line-height: 1.6;
|
6
|
+
}
|
7
|
+
|
8
|
+
body {
|
9
|
+
margin: 1em auto 1em auto;
|
10
|
+
padding: 1em 2em 2em 1em;
|
11
|
+
width: 760px;
|
12
|
+
border: 1px solid black;
|
13
|
+
background-color: #E8DDCB;
|
14
|
+
}
|
15
|
+
|
16
|
+
pre {
|
17
|
+
padding: 0.5em 0 0.5em 2em;
|
18
|
+
background-color: #D7D3C1;
|
19
|
+
}
|
20
|
+
|
21
|
+
h1, h2, h3 {
|
22
|
+
color: #0C7D85;
|
23
|
+
}
|
24
|
+
|
25
|
+
/* rdiscount comments */
|
26
|
+
|
27
|
+
h6 {
|
28
|
+
display: none;
|
29
|
+
}
|