drnic-codex 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. data/History.txt +4 -0
  2. data/LICENSE.txt +29 -0
  3. data/Manifest.txt +95 -0
  4. data/PostInstall.txt +5 -0
  5. data/README.txt +31 -0
  6. data/Rakefile +4 -0
  7. data/app_generators/codex/USAGE +5 -0
  8. data/app_generators/codex/codex_generator.rb +106 -0
  9. data/app_generators/codex/templates/Rakefile +54 -0
  10. data/app_generators/codex/templates/bin/build_all.rb +47 -0
  11. data/app_generators/codex/templates/bin/postprocess_all.rb +5 -0
  12. data/app_generators/codex/templates/bin/pressie.rb +8 -0
  13. data/app_generators/codex/templates/code/control/basic_continuation.rb +11 -0
  14. data/app_generators/codex/templates/code/control/cc_throw_catch.rb +59 -0
  15. data/app_generators/codex/templates/code/control/closure_continuation.rb +8 -0
  16. data/app_generators/codex/templates/code/control/closure_continuation_2.rb +12 -0
  17. data/app_generators/codex/templates/dp.SyntaxHighlighter/CSS.html +115 -0
  18. data/app_generators/codex/templates/dp.SyntaxHighlighter/CSharp.html +134 -0
  19. data/app_generators/codex/templates/dp.SyntaxHighlighter/CollapseCode.html +90 -0
  20. data/app_generators/codex/templates/dp.SyntaxHighlighter/Cpp.html +190 -0
  21. data/app_generators/codex/templates/dp.SyntaxHighlighter/CrashTest.html +108 -0
  22. data/app_generators/codex/templates/dp.SyntaxHighlighter/Delphi.html +112 -0
  23. data/app_generators/codex/templates/dp.SyntaxHighlighter/FirstLine.html +90 -0
  24. data/app_generators/codex/templates/dp.SyntaxHighlighter/Index.html +80 -0
  25. data/app_generators/codex/templates/dp.SyntaxHighlighter/Java.html +122 -0
  26. data/app_generators/codex/templates/dp.SyntaxHighlighter/JavaScript.html +112 -0
  27. data/app_generators/codex/templates/dp.SyntaxHighlighter/NoControls.html +89 -0
  28. data/app_generators/codex/templates/dp.SyntaxHighlighter/NoGutter.html +89 -0
  29. data/app_generators/codex/templates/dp.SyntaxHighlighter/PHP.html +102 -0
  30. data/app_generators/codex/templates/dp.SyntaxHighlighter/Python.html +121 -0
  31. data/app_generators/codex/templates/dp.SyntaxHighlighter/Ruby.html +131 -0
  32. data/app_generators/codex/templates/dp.SyntaxHighlighter/SQL.html +98 -0
  33. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/clipboard.swf +0 -0
  34. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCSharp.js +32 -0
  35. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCpp.js +73 -0
  36. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCss.js +52 -0
  37. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushDelphi.js +34 -0
  38. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJScript.js +22 -0
  39. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJava.js +28 -0
  40. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPhp.js +60 -0
  41. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPython.js +30 -0
  42. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushRuby.js +28 -0
  43. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushSql.js +42 -0
  44. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushVb.js +29 -0
  45. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushXml.js +70 -0
  46. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.js +414 -0
  47. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.uncompressed.js +674 -0
  48. data/app_generators/codex/templates/dp.SyntaxHighlighter/ShowColumns.html +89 -0
  49. data/app_generators/codex/templates/dp.SyntaxHighlighter/SmartTabs.html +88 -0
  50. data/app_generators/codex/templates/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css +158 -0
  51. data/app_generators/codex/templates/dp.SyntaxHighlighter/Styles/TestPages.css +63 -0
  52. data/app_generators/codex/templates/dp.SyntaxHighlighter/Templates/Test.dwt +80 -0
  53. data/app_generators/codex/templates/dp.SyntaxHighlighter/VB.html +115 -0
  54. data/app_generators/codex/templates/dp.SyntaxHighlighter/XML.html +136 -0
  55. data/app_generators/codex/templates/html/all.html +0 -0
  56. data/app_generators/codex/templates/readme.txt +4 -0
  57. data/app_generators/codex/templates/slides/basics.slides +37 -0
  58. data/app_generators/codex/templates/slides/building.slides +27 -0
  59. data/app_generators/codex/templates/slides/example.slides +80 -0
  60. data/app_generators/codex/templates/slides/including_code.slides +80 -0
  61. data/app_generators/codex/templates/slides/metadata.yml +4 -0
  62. data/app_generators/codex/templates/slides/table_of_contents.slides +14 -0
  63. data/app_generators/codex/templates/ui/default/blank.gif +0 -0
  64. data/app_generators/codex/templates/ui/default/bodybg.gif +0 -0
  65. data/app_generators/codex/templates/ui/default/framing.css +23 -0
  66. data/app_generators/codex/templates/ui/default/iepngfix.htc +42 -0
  67. data/app_generators/codex/templates/ui/default/opera.css +7 -0
  68. data/app_generators/codex/templates/ui/default/outline.css +15 -0
  69. data/app_generators/codex/templates/ui/default/pretty.css +86 -0
  70. data/app_generators/codex/templates/ui/default/print.css +1 -0
  71. data/app_generators/codex/templates/ui/default/s5-core.css +9 -0
  72. data/app_generators/codex/templates/ui/default/slides.css +3 -0
  73. data/app_generators/codex/templates/ui/default/slides.js +553 -0
  74. data/bin/codex +17 -0
  75. data/codex.gemspec +30 -0
  76. data/config/hoe.rb +74 -0
  77. data/config/requirements.rb +15 -0
  78. data/lib/codex/content.rb +160 -0
  79. data/lib/codex/pressie.rb +107 -0
  80. data/lib/codex/version.rb +9 -0
  81. data/lib/codex.rb +7 -0
  82. data/lib/stylesheets/pressie.css +196 -0
  83. data/lib/stylesheets/print.css +149 -0
  84. data/lib/stylesheets/ruby.png +0 -0
  85. data/script/console +10 -0
  86. data/script/destroy +14 -0
  87. data/script/generate +14 -0
  88. data/setup.rb +1585 -0
  89. data/tasks/deployment.rake +34 -0
  90. data/tasks/environment.rake +7 -0
  91. data/tasks/website.rake +9 -0
  92. data/test/test_codex.rb +11 -0
  93. data/test/test_codex_generator.rb +78 -0
  94. data/test/test_generator_helper.rb +29 -0
  95. data/test/test_helper.rb +2 -0
  96. metadata +163 -0
@@ -0,0 +1,15 @@
1
+ require 'fileutils'
2
+ include FileUtils
3
+
4
+ require 'rubygems'
5
+ %w[rake hoe newgem rubigen].each do |req_gem|
6
+ begin
7
+ require req_gem
8
+ rescue LoadError
9
+ puts "This Rakefile requires the '#{req_gem}' RubyGem."
10
+ puts "Installation: gem install #{req_gem} -y"
11
+ exit
12
+ end
13
+ end
14
+
15
+ $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
@@ -0,0 +1,160 @@
1
+ require 'redcloth'
2
+
3
+ class Codex::Content
4
+
5
+ # Wrap the parameters to :code
6
+ #
7
+ # :code file.rb[:part class=xxx]
8
+ class Descriptor
9
+ attr_reader :file_name, :part
10
+ attr_reader :css_class
11
+ attr_reader :lang
12
+
13
+ def initialize(string)
14
+ @css_class = "code-normal"
15
+ @lang = "ruby"
16
+
17
+ if string && string =~ /(.*?)\[(.*)\]/
18
+ @file_name = $1
19
+ parse_params($2.dup)
20
+ else
21
+ @file_name = string
22
+ end
23
+ end
24
+
25
+ def parse_params(params)
26
+ params.split.each do |param|
27
+ if param =~ /(.*?)=(.*)/
28
+ case $1
29
+ when "class"
30
+ @css_class = $2
31
+ when "lang"
32
+ @lang = $2
33
+ else
34
+ fail "Unknown parameter #{$1} in '#{params}'"
35
+ end
36
+ else
37
+ @part = param
38
+ end
39
+ end
40
+ end
41
+
42
+ end
43
+
44
+ START_SLIDE = %{<div class="slide">\n}
45
+ END_SLIDE = %{</div>\n}
46
+ BETWEEN_SLIDES = END_SLIDE + "\n" + START_SLIDE
47
+
48
+ CODE_PATTERN = /^:code\s+(.+)/
49
+
50
+ # Temporarily prepended to lines of incldued code to stop them being processed
51
+ # as Textfile
52
+
53
+ INCLUDED_CODE_PREFIX = "XXX\001"
54
+ INCLUDED_CODE_PREFIX_REGEXP = /#{INCLUDED_CODE_PREFIX}/mo
55
+
56
+
57
+ def initialize(original)
58
+ @original = original.sub(/__END__.*/m, '').gsub(/__SKIP__.*?__ENDSKIP__/m, '')
59
+ end
60
+
61
+ def to_html
62
+ textile = preprocess_inlinecode(@original)
63
+ textile = preprocess_code(textile)
64
+ content = split_into_slides(textile)
65
+ html = RedCloth.new(content).to_html
66
+ remove_code_escaping_from(html)
67
+ end
68
+
69
+ # look for :code filename[part] and substitute in the appropriate part
70
+ # of the given file. Do in two steps because the regexp engine isn;t reentrant
71
+ def preprocess_code(text)
72
+ chunks = {}
73
+ text.scan(CODE_PATTERN) do |file,|
74
+ desc = Descriptor.new(file)
75
+ chunks[file] = find_content_from(desc)
76
+ end
77
+ text.gsub(CODE_PATTERN) { file = $1.dup; format_code(Descriptor.new(file), chunks[file]) }
78
+ end
79
+
80
+ # Look for :inlinecode /.../:endinlinecode and substitute in as if it came from a file
81
+ def preprocess_inlinecode(text)
82
+ state = :copying
83
+ result = []
84
+ text.split(/\n/).each do |line|
85
+ case state
86
+ when :copying
87
+ if line =~ /^:inlinecode(.*)/
88
+ args = $1.strip
89
+ desc = Descriptor.new("--[#{args}]")
90
+ result << %{<div class="#{desc.css_class}">\n}
91
+ result << %{\n<pre name="code" class="#{desc.lang}:nogutter:nocontrols">\n}
92
+ state = :incode
93
+ else
94
+ result << line
95
+ end
96
+ when :incode
97
+ if line =~ /^:endinlinecode/
98
+ result << "</pre></div>\n\n"
99
+ state = :copying
100
+ else
101
+ result << INCLUDED_CODE_PREFIX + line
102
+ end
103
+ end
104
+ end
105
+
106
+ result.join("\n")
107
+ end
108
+
109
+ def split_into_slides(textile)
110
+ result = []
111
+ slides = textile.split(/^h1/).each do |slide|
112
+ unless slide.empty?
113
+ result << START_SLIDE << "\nh1" << slide << END_SLIDE
114
+ end
115
+ end
116
+ result.join
117
+ end
118
+
119
+ def find_content_from(desc)
120
+ begin
121
+ content = File.read(desc.file_name)
122
+ rescue Exception => e
123
+ STDERR.puts e.message
124
+ exit 2
125
+ end
126
+
127
+ find_part_in(content, desc.part)
128
+ end
129
+
130
+ def find_part_in(content, part_name)
131
+ result = []
132
+ state = part_name ? :skipping : :normal
133
+ content.each_line do |line|
134
+ if line.sub!(/(START|END):(\w+)/, '')
135
+ if $2 == part_name
136
+ if $1 == "START"
137
+ state = :normal
138
+ else
139
+ state = :skipping
140
+ end
141
+ end
142
+ next
143
+ end
144
+ result << line unless state == :skipping
145
+ end
146
+ result.join
147
+ end
148
+
149
+ def format_code(desc, code)
150
+ code = code.gsub(/^/m, INCLUDED_CODE_PREFIX)
151
+ %{<div class="#{desc.css_class}">\n} +
152
+ %{\n<pre name="code" class="#{desc.lang}:nogutter:nocontrols">#{code}} +
153
+ %{</pre></div>} +
154
+ %{<div class="codeurl"><a href="txmt://open?url=file://#{File.expand_path(desc.file_name)}">#{desc.file_name}</a></div>\n\n}
155
+ end
156
+
157
+ def remove_code_escaping_from(html)
158
+ html.gsub(INCLUDED_CODE_PREFIX_REGEXP, '')
159
+ end
160
+ end
@@ -0,0 +1,107 @@
1
+ require 'yaml'
2
+
3
+ S5_HEAD = %{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml">
7
+
8
+ <head>
9
+ <title>&title;</title>
10
+ <!-- metadata -->
11
+ <meta name="generator" content="S5" />
12
+ <meta name="version" content="S5 1.1" />
13
+ <meta name="presdate" content="20050728" />
14
+ <meta name="author" content="&author;" />
15
+ <meta name="company" content="&company;" />
16
+ <!-- configuration parameters -->
17
+ <meta name="defaultView" content="slideshow" />
18
+ <meta name="controlVis" content="hidden" />
19
+ <!-- style sheet links -->
20
+ <link rel="stylesheet" href="../ui/default/slides.css" type="text/css" media="projection" id="slideProj" />
21
+ <link rel="stylesheet" href="../ui/default/outline.css" type="text/css" media="screen" id="outlineStyle" />
22
+ <link rel="stylesheet" href="../lib/stylesheets/print.css" type="text/css" media="print" id="slidePrint" />
23
+ <link rel="stylesheet" href="../ui/default/opera.css" type="text/css" media="projection" id="operaFix" />
24
+
25
+ <link rel="stylesheet" href="../lib/stylesheets/pressie.css" type="text/css" />
26
+
27
+ <!-- S5 JS -->
28
+ <script src="../ui/default/slides.js" type="text/javascript"></script>
29
+
30
+ <!-- Syntax Highlighter -->
31
+ <link rel="stylesheet" href="../dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css"></link>
32
+
33
+ </head>
34
+ <body>
35
+
36
+ <div class="layout">
37
+ <div id="controls"><!-- DO NOT EDIT --></div>
38
+ <div id="currentSlide"><!-- DO NOT EDIT --></div>
39
+ <div id="header"></div>
40
+ <div id="footer">
41
+ <h2>Copyright &copy; &copyright;</h2>
42
+ </div>
43
+
44
+ </div>
45
+
46
+
47
+ <div class="presentation">
48
+ }
49
+
50
+ S5_TAIL = %{
51
+ <!-- Syntax Highlighter -->
52
+ <script language="javascript" src="../dp.SyntaxHighlighter/Scripts/shCore.js"></script>
53
+ <script language="javascript" src="../dp.SyntaxHighlighter/Scripts/shBrushCpp.js"></script>
54
+ <script language="javascript" src="../dp.SyntaxHighlighter/Scripts/shBrushRuby.js"></script>
55
+ <script language="javascript" src="../dp.SyntaxHighlighter/Scripts/shBrushXml.js"></script>
56
+ <script language="javascript">
57
+ dp.SyntaxHighlighter.ClipboardSwf = '/flash/clipboard.swf';
58
+ dp.SyntaxHighlighter.HighlightAll('code');
59
+ </script>
60
+ </div>
61
+ </body>
62
+ </html>
63
+ }
64
+
65
+
66
+ module Codex
67
+ class Pressie
68
+
69
+ def self.process
70
+ new.process
71
+ end
72
+
73
+ def process
74
+ metadata_name = ARGV.shift || usage("Missing metadata file name")
75
+ load_metadata(metadata_name)
76
+ input_name = ARGV.shift || usage("Missing input file name")
77
+ content = Content.new(File.read(input_name)) rescue usage($!.message)
78
+ header = substitute_metadata_into(S5_HEAD)
79
+ puts header, content.to_html, S5_TAIL
80
+ end
81
+
82
+
83
+ private
84
+
85
+ def usage(msg = nil)
86
+ STDERR.puts "pressie.rb <metadatafile> <inputfile>"
87
+ if msg
88
+ STDERR.puts
89
+ STDERR.puts msg
90
+ end
91
+ exit 1
92
+ end
93
+
94
+ def load_metadata(file_name)
95
+ @metadata = YAML.load_file(file_name)
96
+ end
97
+
98
+ def substitute_metadata_into(text)
99
+ text = text.dup
100
+ %w{author company copyright title}.each do |key|
101
+ text.gsub!(/&#{key};/, @metadata[key]) if @metadata.has_key?(key)
102
+ end
103
+ text
104
+ end
105
+
106
+ end
107
+ end
@@ -0,0 +1,9 @@
1
+ module Codex #:nodoc:
2
+ module VERSION #:nodoc:
3
+ MAJOR = 1
4
+ MINOR = 0
5
+ TINY = 0
6
+
7
+ STRING = [MAJOR, MINOR, TINY].join('.')
8
+ end
9
+ end
data/lib/codex.rb ADDED
@@ -0,0 +1,7 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ module Codex; end
5
+
6
+ require 'codex/content'
7
+ require 'codex/pressie'
@@ -0,0 +1,196 @@
1
+ code {
2
+ font-family: Monaco;
3
+ }
4
+
5
+
6
+ div.slide code {
7
+ font-weight: normal;
8
+ font-size: 85%;
9
+ color: #228;
10
+ }
11
+
12
+ div.dp-highlighter
13
+ {
14
+ font-family: "Gill Sans", "Consolas", "Courier New", Courier, mono;
15
+ font-size: 100%;
16
+ background-color: white;
17
+ overflow: auto;
18
+ /* margin: 18px 0px 18px 0px; */
19
+ padding-top: 1px; /* adds a little border on top when controls are hidden */
20
+ margin-bottom: 0px;
21
+ border: 2px solid;
22
+ }
23
+
24
+ div.dp-highlighter ol
25
+ {
26
+ margin-top: 1px;
27
+ margin-bottom: 10px;
28
+ padding: 0px;
29
+ }
30
+
31
+ div.dp-highlighter ol li
32
+ {
33
+ background-color: white;
34
+ }
35
+
36
+ div.dp-highlighter .keyword {
37
+ font-weight: normal;
38
+ color: #33b;
39
+ }
40
+
41
+ div.dp-highlighter .variable {
42
+ font-weight: normal;
43
+ }
44
+
45
+ div.dp-highlighter .string {
46
+ color: #22c;
47
+ font-style: italic;
48
+ }
49
+
50
+ .dp-cpp span.datatypes {
51
+ font-weight: normal;
52
+ }
53
+
54
+ div.codeurl {
55
+ margin-top: 0.5em;
56
+ margin-bottom: 1.5em;
57
+ padding-right: 1em;
58
+ text-align: right;
59
+ font-size: 50%;
60
+ }
61
+
62
+ div.slide ul {
63
+ margin-left: 0pt;
64
+ }
65
+
66
+ div.slide td {
67
+ padding: 0.3em 1em;
68
+ }
69
+
70
+ div.slide th {
71
+ background: #337;
72
+ color: white;
73
+ font-weight: bold;
74
+ padding: 0.2em 0em 0.2em 0em;
75
+ }
76
+
77
+
78
+ body {
79
+ background: white;
80
+ }
81
+
82
+
83
+
84
+
85
+ div#header {
86
+ background: white;
87
+ display: none;
88
+ }
89
+
90
+ div#footer {
91
+ background: white;
92
+ font-size: 50%;
93
+ height: 1em;
94
+ }
95
+
96
+ div#footer h2 {
97
+ font-weight: normal;
98
+ font-size: 60%;
99
+ }
100
+
101
+ div.slide h1 {
102
+ background: white;
103
+ color: #993333;
104
+ left: 1em;
105
+ top: 0.5em;
106
+ width: 95%;
107
+ padding: 0em 0em 0em 0em;
108
+ border-bottom: 6px solid #ffaaaa;
109
+ text-transform: none;
110
+ }
111
+
112
+
113
+ div.slide h1.exercise {
114
+ background: white;
115
+ color: #339933;
116
+ left: 1em;
117
+ top: 0.5em;
118
+ width: 95%;
119
+ padding: 0em 0em 0em 0em;
120
+ border-bottom: 6px solid #aaffaa;
121
+ }
122
+
123
+
124
+ div#slide0, div.title {
125
+ height: 100%;
126
+ background-image: url(ruby.png);
127
+ background-repeat: no-repeat;
128
+ background-position: bottom right;
129
+ }
130
+
131
+ div#slide0 h1, div.title h1 {
132
+ color: #993333;
133
+ background:transparent none repeat scroll 0%;
134
+ font-family:Helvetica,sans-serif;
135
+ font-size:2em;
136
+ font-size-adjust:none;
137
+ font-stretch:normal;
138
+ font-style:normal;
139
+ font-variant:normal;
140
+ font-weight:bold;
141
+ line-height:normal;
142
+ margin:10% 0pt 0pt;
143
+ padding:0pt;
144
+ position:static;
145
+ white-space:normal;
146
+ }
147
+ }
148
+
149
+ /* code layout */
150
+ div.code-large {
151
+ font-size: 150% !important;
152
+ line-height: 1.6em !important;
153
+ }
154
+
155
+
156
+ div.code-normal {
157
+ font-size: 90% !important;
158
+ line-height: 2em !important;
159
+ }
160
+
161
+ div.code-normal li {
162
+ margin-top: 0.6em;
163
+ }
164
+
165
+ div.code-small {
166
+ font-size: 75% !important;
167
+ line-height: 2em !important;
168
+ }
169
+
170
+ div.code-small li {
171
+ margin-top: 0.6em;
172
+ }
173
+
174
+ div.code-tiny {
175
+ font-size: 50% !important;
176
+ line-height: 2em !important;
177
+ }
178
+
179
+ div.code-tiny li {
180
+ margin-top: 0.6em;
181
+ }
182
+
183
+ div.code-supertiny {
184
+ font-size: 33% !important;
185
+ line-height: 2em !important;
186
+ }
187
+
188
+ div.code-supertiny li {
189
+ margin-top: 0.6em;
190
+ }
191
+
192
+ .caption {
193
+ color: #448;
194
+ font-family: Gil Sans;
195
+ font-size: 70%;
196
+ }
@@ -0,0 +1,149 @@
1
+ /* The following rule is necessary to have all slides appear in print! DO NOT REMOVE IT! */
2
+ @page {
3
+ size: 8.5in 11in;
4
+ margin: .75in 0.5in .75in 0.5in
5
+ }
6
+
7
+ @page :left {
8
+ @top-left {
9
+ content: "Wibble";
10
+ }
11
+ }
12
+
13
+
14
+ body div.slide, ul {
15
+ page-break-inside: avoid !important;
16
+ widows: 20;
17
+ orphans: 20;
18
+ visibility: visible !important;
19
+ }
20
+ body div.slide {
21
+ page-break-before: auto;
22
+ clear: both;
23
+ margin-bottom: 1in;
24
+ }
25
+
26
+ h1 {page-break-after: avoid;}
27
+
28
+ body {margin-left: 75px; font-size: 12pt; background: blue;}
29
+ * {color: black;}
30
+
31
+ body div div#slide0 h1, body div div.title h1 {
32
+ page-break-before: always;
33
+ font-size: 200%;
34
+ border: 2px solid black;
35
+ margin: 0.5em 0 0.25em;
36
+ padding: 1em 1em 1em 1em;
37
+ color: black;
38
+ text-align: center;
39
+ }
40
+
41
+ div#slide0 {margin-bottom: 3em;}
42
+
43
+ body div.slide h1 {
44
+ border-top: 2pt solid gray;
45
+ border-bottom: 1px dotted silver;
46
+ color: black;
47
+ text-transform: none;
48
+ font-size: 150%;
49
+ }
50
+
51
+ .extra {background: transparent !important;}
52
+ div.extra, pre.extra, .example {font-size: 10pt; color: #333;}
53
+ ul.extra a {font-weight: bold;}
54
+ p.example {display: none;}
55
+
56
+ #header {display: none;}
57
+ #footer h1 {margin: 0; border-bottom: 1px solid; color: gray; font-style: italic;}
58
+ #footer h2, #controls {display: none;}
59
+
60
+ /* The following rule keeps the layout stuff out of print. Remove at your own risk! */
61
+ .layout, .layout * {display: none !important;}
62
+
63
+
64
+
65
+ /* code layout */
66
+ div div.code-large, div div.code-small, div div.code-normal, div div.code-tiny, div div.code-supertiny {
67
+ font-size: 80% !important;
68
+ line-height: 1.6em !important;
69
+ }
70
+
71
+
72
+
73
+
74
+
75
+ /*** Original
76
+
77
+ x div.slide ul {
78
+ margin-left: 0pt;
79
+ }
80
+
81
+ x div.slide td {
82
+ padding: 0.3em 1em;
83
+ }
84
+
85
+ x div.slide th {
86
+ background: #337;
87
+ color: white;
88
+ font-weight: bold;
89
+ padding: 0.2em 0em 0.2em 0em;
90
+ }
91
+
92
+
93
+ xxs div.slide h1 {
94
+ background: white;
95
+ color: #993333;
96
+ left: 1em;
97
+ top: 0.5em;
98
+ width: 95%;
99
+ padding: 0em 0em 0em 0em;
100
+ border-bottom: 6px solid #ffaaaa;
101
+
102
+ }
103
+
104
+
105
+ x div.slide h1.exercise {
106
+ background: white;
107
+ color: #339933;
108
+ left: 1em;
109
+ top: 0.5em;
110
+ width: 95%;
111
+ padding: 0em 0em 0em 0em;
112
+ border-bottom: 6px solid #aaffaa;
113
+ }
114
+
115
+
116
+ x div#slide0, div.title {
117
+ height: 100%;
118
+ background-image: url(ruby.png);
119
+ background-repeat: no-repeat;
120
+ background-position: bottom right;
121
+ }
122
+
123
+ x div#slide0 h1, div.title h1 {
124
+ color: #993333;
125
+ background:transparent none repeat scroll 0%;
126
+ font-family:Helvetica,sans-serif;
127
+ font-size:2em;
128
+ font-size-adjust:none;
129
+ font-stretch:normal;
130
+ font-style:normal;
131
+ font-variant:normal;
132
+ font-weight:bold;
133
+ line-height:normal;
134
+ margin:10% 0pt 0pt;
135
+ padding:0pt;
136
+ position:static;
137
+ white-space:normal;
138
+ }
139
+ }
140
+
141
+
142
+
143
+ x .caption {
144
+ color: #448;
145
+ font-family: Gil Sans;
146
+ font-size: 70%;
147
+ }
148
+
149
+ */
Binary file
data/script/console ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # File: script/console
3
+ irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
+
5
+ libs = " -r irb/completion"
6
+ # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
+ # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
+ libs << " -r #{File.dirname(__FILE__) + '/../lib/codex.rb'}"
9
+ puts "Loading codex gem"
10
+ exec "#{irb} #{libs} --simple-prompt"
data/script/destroy ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/destroy'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Destroy.new.run(ARGV)
data/script/generate ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/generate'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Generate.new.run(ARGV)