wbzyl-rack-codehighlighter 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. data/.gitignore +4 -0
  2. data/LICENSE +0 -0
  3. data/README.markdown +301 -0
  4. data/Rakefile +39 -0
  5. data/TODO +22 -0
  6. data/VERSION.yml +4 -0
  7. data/examples/app.rb +21 -0
  8. data/examples/config.ru +13 -0
  9. data/examples/public/javascripts/lang-css.js +2 -0
  10. data/examples/public/javascripts/lang-hs.js +2 -0
  11. data/examples/public/javascripts/lang-lisp.js +3 -0
  12. data/examples/public/javascripts/lang-lua.js +2 -0
  13. data/examples/public/javascripts/lang-ml.js +2 -0
  14. data/examples/public/javascripts/lang-proto.js +1 -0
  15. data/examples/public/javascripts/lang-sql.js +2 -0
  16. data/examples/public/javascripts/lang-vb.js +2 -0
  17. data/examples/public/javascripts/lang-wiki.js +1 -0
  18. data/examples/public/javascripts/prettify.js +31 -0
  19. data/examples/public/stylesheets/application.css +29 -0
  20. data/examples/public/stylesheets/coderay.css +126 -0
  21. data/examples/public/stylesheets/prettify.css +44 -0
  22. data/examples/public/stylesheets/syntax.css +79 -0
  23. data/examples/public/stylesheets/uv.css +1022 -0
  24. data/examples/public/stylesheets/uv/amy.css +147 -0
  25. data/examples/public/stylesheets/uv/blackboard.css +88 -0
  26. data/examples/public/stylesheets/uv/cobalt.css +149 -0
  27. data/examples/public/stylesheets/uv/dawn.css +121 -0
  28. data/examples/public/stylesheets/uv/espresso_libre.css +109 -0
  29. data/examples/public/stylesheets/uv/sunburst.css +180 -0
  30. data/examples/public/stylesheets/uv/twilight.css +137 -0
  31. data/examples/public/stylesheets/uv/zenburnesque.css +91 -0
  32. data/examples/views/index.rdiscount +75 -0
  33. data/examples/views/layout.rdiscount +36 -0
  34. metadata +95 -0
@@ -0,0 +1,75 @@
1
+ ### C
2
+
3
+ :::c
4
+ int a, b;
5
+ int main(int argc, char *argv[]) {
6
+ hello();
7
+ return 0;
8
+ }
9
+ void hello(void) {
10
+ printf("hello world\n");
11
+ }
12
+
13
+ ### html
14
+
15
+ :::html
16
+ <html>
17
+ <head>
18
+ <title>hello world</title>
19
+ </head>
20
+ <body>
21
+ <h1>hello world</h1>
22
+ </body>
23
+ </html>
24
+
25
+ ### ruby
26
+
27
+ :::ruby
28
+ def hello
29
+ puts 'hello world'
30
+ end
31
+
32
+ ### css21
33
+
34
+ :::css
35
+ html {
36
+ margin: 0;
37
+ padding: 0;
38
+ background-color: #0C7D85;
39
+ line-height: 1.6;
40
+ }
41
+ body {
42
+ margin: 1em auto 1em auto;
43
+ padding: 1em 2em 2em 1em;
44
+ width: 760px;
45
+ border: 1px solid black;
46
+ background-color: #E8DDCB;
47
+ }
48
+
49
+ ### sqlite
50
+
51
+ :::sql
52
+ drop table if exists exams;
53
+ create table exams (
54
+ id integer primary key autoincrement,
55
+ student_id integer not null, -- foreign key
56
+ result integer default 0 collate nocase,
57
+ when datetime
58
+ );
59
+
60
+ ### javascript
61
+
62
+ :::javascript
63
+ for (var i = 0, length = properties.length; i < length; i++) {
64
+ var property = properties[i], value = source[property];
65
+ if (ancestor && Object.isFunction(value) &&
66
+ value.argumentNames().first() == "$super") {
67
+ var method = value, value = Object.extend((function(m) {
68
+ return function() { return ancestor[m].apply(this, arguments) };
69
+ })(property).wrap(method), {
70
+ valueOf: function() { return method },
71
+ toString: function() { return method.toString() }
72
+ });
73
+ }
74
+ this.prototype[property] = value;
75
+ }
@@ -0,0 +1,36 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
5
+ <link rel="stylesheet" href="/stylesheets/application.css"
6
+ type="text/css" media="screen" charset="utf-8">
7
+ <link rel="stylesheet" href="/stylesheets/syntax.css"
8
+ type="text/css" media="screen" charset="utf-8">
9
+ <link rel="stylesheet" href="/stylesheets/coderay.css"
10
+ type="text/css" media="screen" charset="utf-8">
11
+ <link rel="stylesheet" href="/stylesheets/uv.css"
12
+ type="text/css" media="screen" charset="utf-8">
13
+
14
+ <link rel="stylesheet" href="/stylesheets/prettify.css"
15
+ type="text/css" media="screen" charset="utf-8"/>
16
+
17
+ <script src="/javascripts/prettify.js"
18
+ type="text/javascript" charset="utf-8"></script>
19
+
20
+ <script src="http://www.google.com/jsapi"></script>
21
+ <script>
22
+ // on page load complete, fire off a prettyPrint
23
+ google.setOnLoadCallback(function() {
24
+ prettyPrint();
25
+ });
26
+ </script>
27
+
28
+ <title><%= "Code Highlighting Middleware" %></title>
29
+ </head>
30
+
31
+ <body>
32
+
33
+ <%= yield %>
34
+
35
+ </body>
36
+ </html>
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wbzyl-rack-codehighlighter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Wlodek Bzyl
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-31 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hpricot
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.8.1
24
+ version:
25
+ description: Rack Middleware for Code Highlighting.
26
+ email: matwb@univ.gda.pl
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - LICENSE
33
+ - README.markdown
34
+ files:
35
+ - .gitignore
36
+ - LICENSE
37
+ - README.markdown
38
+ - Rakefile
39
+ - TODO
40
+ - VERSION.yml
41
+ - examples/app.rb
42
+ - examples/config.ru
43
+ - examples/public/javascripts/lang-css.js
44
+ - examples/public/javascripts/lang-hs.js
45
+ - examples/public/javascripts/lang-lisp.js
46
+ - examples/public/javascripts/lang-lua.js
47
+ - examples/public/javascripts/lang-ml.js
48
+ - examples/public/javascripts/lang-proto.js
49
+ - examples/public/javascripts/lang-sql.js
50
+ - examples/public/javascripts/lang-vb.js
51
+ - examples/public/javascripts/lang-wiki.js
52
+ - examples/public/javascripts/prettify.js
53
+ - examples/public/stylesheets/application.css
54
+ - examples/public/stylesheets/coderay.css
55
+ - examples/public/stylesheets/prettify.css
56
+ - examples/public/stylesheets/syntax.css
57
+ - examples/public/stylesheets/uv.css
58
+ - examples/public/stylesheets/uv/amy.css
59
+ - examples/public/stylesheets/uv/blackboard.css
60
+ - examples/public/stylesheets/uv/cobalt.css
61
+ - examples/public/stylesheets/uv/dawn.css
62
+ - examples/public/stylesheets/uv/espresso_libre.css
63
+ - examples/public/stylesheets/uv/sunburst.css
64
+ - examples/public/stylesheets/uv/twilight.css
65
+ - examples/public/stylesheets/uv/zenburnesque.css
66
+ - examples/views/index.rdiscount
67
+ - examples/views/layout.rdiscount
68
+ has_rdoc: false
69
+ homepage: http://github.com/wbzyl/rack-codehighlighter
70
+ post_install_message:
71
+ rdoc_options:
72
+ - --charset=UTF-8
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
+ version:
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: "0"
86
+ version:
87
+ requirements: []
88
+
89
+ rubyforge_project:
90
+ rubygems_version: 1.2.0
91
+ signing_key:
92
+ specification_version: 3
93
+ summary: Rack Middleware for Code Highlighting.
94
+ test_files:
95
+ - examples/app.rb