brandon-codex 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +18 -0
- data/LICENSE.txt +29 -0
- data/Manifest.txt +105 -0
- data/PostInstall.txt +5 -0
- data/README.txt +31 -0
- data/Rakefile +6 -0
- data/app_generators/codex/USAGE +5 -0
- data/app_generators/codex/codex_generator.rb +109 -0
- data/app_generators/codex/templates/Rakefile +59 -0
- data/app_generators/codex/templates/bin/build_all.rb +47 -0
- data/app_generators/codex/templates/bin/postprocess_all.rb +5 -0
- data/app_generators/codex/templates/bin/pressie.rb +10 -0
- data/app_generators/codex/templates/code/control/basic_continuation.rb +11 -0
- data/app_generators/codex/templates/code/control/cc_throw_catch.rb +59 -0
- data/app_generators/codex/templates/code/control/closure_continuation.rb +8 -0
- data/app_generators/codex/templates/code/control/closure_continuation_2.rb +12 -0
- data/app_generators/codex/templates/content/basics.textile +37 -0
- data/app_generators/codex/templates/content/building.textile +27 -0
- data/app_generators/codex/templates/content/example.textile +80 -0
- data/app_generators/codex/templates/content/including_code.textile +80 -0
- data/app_generators/codex/templates/content/including_tex.textile +31 -0
- data/app_generators/codex/templates/content/metadata.yml +4 -0
- data/app_generators/codex/templates/content/table_of_contents.textile +20 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/CSS.html +115 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/CSharp.html +134 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/CollapseCode.html +90 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Cpp.html +190 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/CrashTest.html +108 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Delphi.html +112 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/FirstLine.html +90 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Index.html +80 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Java.html +122 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/JavaScript.html +112 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/NoControls.html +89 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/NoGutter.html +89 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/PHP.html +102 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Python.html +121 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Ruby.html +131 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/SQL.html +98 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/clipboard.swf +0 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCSharp.js +32 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCpp.js +73 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCss.js +52 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushDelphi.js +34 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJScript.js +22 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJava.js +28 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPhp.js +60 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPython.js +30 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushRuby.js +28 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushSql.js +42 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushVb.js +29 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushXml.js +70 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.js +414 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.uncompressed.js +674 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/ShowColumns.html +89 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/SmartTabs.html +88 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css +158 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Styles/TestPages.css +63 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/Templates/Test.dwt +80 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/VB.html +115 -0
- data/app_generators/codex/templates/dp.SyntaxHighlighter/XML.html +136 -0
- data/app_generators/codex/templates/html/all.html +0 -0
- data/app_generators/codex/templates/readme.txt +4 -0
- data/app_generators/codex/templates/ui/default/blank.gif +0 -0
- data/app_generators/codex/templates/ui/default/bodybg.gif +0 -0
- data/app_generators/codex/templates/ui/default/framing.css +23 -0
- data/app_generators/codex/templates/ui/default/iepngfix.htc +42 -0
- data/app_generators/codex/templates/ui/default/opera.css +7 -0
- data/app_generators/codex/templates/ui/default/outline.css +15 -0
- data/app_generators/codex/templates/ui/default/pretty.css +86 -0
- data/app_generators/codex/templates/ui/default/print.css +1 -0
- data/app_generators/codex/templates/ui/default/s5-core.css +9 -0
- data/app_generators/codex/templates/ui/default/slides.css +3 -0
- data/app_generators/codex/templates/ui/default/slides.js +553 -0
- data/bin/codex +17 -0
- data/codex.gemspec +30 -0
- data/config/hoe.rb +76 -0
- data/config/requirements.rb +15 -0
- data/lib/codex.rb +23 -0
- data/lib/codex/content.rb +27 -0
- data/lib/codex/pressie.rb +108 -0
- data/lib/codex/version.rb +9 -0
- data/lib/stylesheets/pressie.css +196 -0
- data/lib/stylesheets/print.css +149 -0
- data/lib/stylesheets/ruby.png +0 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/setup.rb +1585 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +9 -0
- data/test/test_codex.rb +11 -0
- data/test/test_codex_generator.rb +78 -0
- data/test/test_generator_helper.rb +29 -0
- data/test/test_helper.rb +3 -0
- metadata +164 -0
data/History.txt
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
== 1.0.3 2008-05-22
|
2
|
+
|
3
|
+
* Support for user defined filters
|
4
|
+
* The functionality is in added file lib/codex/filters/filter.rb
|
5
|
+
* Included WebTeX filter
|
6
|
+
* Added ritex >= 0.1 as dependency
|
7
|
+
* Syntax highlighter is a filter now
|
8
|
+
* Syntax highlighter stuff from content.rb is now in lib/codex/filters/code_filter.rb
|
9
|
+
* Added some slides elaborating on this to the templates
|
10
|
+
|
11
|
+
== 1.0.2 2008-05-20
|
12
|
+
|
13
|
+
* Add rubigen 1.3.2 to dependency list as its used for codex generator
|
14
|
+
|
15
|
+
== 1.0.0 2008-05-19
|
16
|
+
|
17
|
+
* 1 major enhancement:
|
18
|
+
* Initial release
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
This source tree contains a mixture of original material and other people's work. In particular,
|
2
|
+
it contains Syntax Highlighting code from http://code.google.com/p/syntaxhighlighter/ and
|
3
|
+
the S5 package from http://meyerweb.com/eric/tools/s5/. Both of these packages carry their own licenses,
|
4
|
+
and the conditions in this file do not apply to these packages.
|
5
|
+
|
6
|
+
The following terms apply to the original code in this source tree:
|
7
|
+
|
8
|
+
Copyright (c) 2008 Dave Thomas
|
9
|
+
|
10
|
+
Permission is hereby granted, free of charge, to any person
|
11
|
+
obtaining a copy of this software and associated documentation
|
12
|
+
files (the "Software"), to deal in the Software without
|
13
|
+
restriction, including without limitation the rights to use,
|
14
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
15
|
+
copies of the Software, and to permit persons to whom the
|
16
|
+
Software is furnished to do so, subject to the following
|
17
|
+
conditions:
|
18
|
+
|
19
|
+
The above copyright notice and this permission notice shall be
|
20
|
+
included in all copies or substantial portions of the Software.
|
21
|
+
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
23
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
24
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
25
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
26
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
27
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
28
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
29
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
History.txt
|
2
|
+
LICENSE.txt
|
3
|
+
Manifest.txt
|
4
|
+
PostInstall.txt
|
5
|
+
README.txt
|
6
|
+
Rakefile
|
7
|
+
app_generators/codex/USAGE
|
8
|
+
app_generators/codex/codex_generator.rb
|
9
|
+
app_generators/codex/templates/Rakefile
|
10
|
+
app_generators/codex/templates/bin/build_all.rb
|
11
|
+
app_generators/codex/templates/bin/postprocess_all.rb
|
12
|
+
app_generators/codex/templates/bin/pressie.rb
|
13
|
+
app_generators/codex/templates/code/control/basic_continuation.rb
|
14
|
+
app_generators/codex/templates/code/control/cc_throw_catch.rb
|
15
|
+
app_generators/codex/templates/code/control/closure_continuation.rb
|
16
|
+
app_generators/codex/templates/code/control/closure_continuation_2.rb
|
17
|
+
app_generators/codex/templates/code/graphviz/graph.dot
|
18
|
+
app_generators/codex/templates/content/basics.textile
|
19
|
+
app_generators/codex/templates/content/building.textile
|
20
|
+
app_generators/codex/templates/content/example.textile
|
21
|
+
app_generators/codex/templates/content/graphviz.textile
|
22
|
+
app_generators/codex/templates/content/including_code.textile
|
23
|
+
app_generators/codex/templates/content/including_tex.textile
|
24
|
+
app_generators/codex/templates/content/metadata.yml
|
25
|
+
app_generators/codex/templates/content/table_of_contents.textile
|
26
|
+
app_generators/codex/templates/content/user_defined.textile
|
27
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/CSS.html
|
28
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/CSharp.html
|
29
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/CollapseCode.html
|
30
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Cpp.html
|
31
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/CrashTest.html
|
32
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Delphi.html
|
33
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/FirstLine.html
|
34
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Index.html
|
35
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Java.html
|
36
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/JavaScript.html
|
37
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/NoControls.html
|
38
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/NoGutter.html
|
39
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/PHP.html
|
40
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Python.html
|
41
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Ruby.html
|
42
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/SQL.html
|
43
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/clipboard.swf
|
44
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCSharp.js
|
45
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCpp.js
|
46
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCss.js
|
47
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushDelphi.js
|
48
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJScript.js
|
49
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJava.js
|
50
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPhp.js
|
51
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPython.js
|
52
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushRuby.js
|
53
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushSql.js
|
54
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushVb.js
|
55
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushXml.js
|
56
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.js
|
57
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.uncompressed.js
|
58
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/ShowColumns.html
|
59
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/SmartTabs.html
|
60
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css
|
61
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Styles/TestPages.css
|
62
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/Templates/Test.dwt
|
63
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/VB.html
|
64
|
+
app_generators/codex/templates/dp.SyntaxHighlighter/XML.html
|
65
|
+
app_generators/codex/templates/filters/example_filter.rb
|
66
|
+
app_generators/codex/templates/html/all.html
|
67
|
+
app_generators/codex/templates/readme.txt
|
68
|
+
app_generators/codex/templates/ui/default/blank.gif
|
69
|
+
app_generators/codex/templates/ui/default/bodybg.gif
|
70
|
+
app_generators/codex/templates/ui/default/framing.css
|
71
|
+
app_generators/codex/templates/ui/default/iepngfix.htc
|
72
|
+
app_generators/codex/templates/ui/default/opera.css
|
73
|
+
app_generators/codex/templates/ui/default/outline.css
|
74
|
+
app_generators/codex/templates/ui/default/pretty.css
|
75
|
+
app_generators/codex/templates/ui/default/print.css
|
76
|
+
app_generators/codex/templates/ui/default/s5-core.css
|
77
|
+
app_generators/codex/templates/ui/default/slides.css
|
78
|
+
app_generators/codex/templates/ui/default/slides.js
|
79
|
+
bin/codex
|
80
|
+
codex.gemspec
|
81
|
+
config/hoe.rb
|
82
|
+
config/requirements.rb
|
83
|
+
lib/codex.rb
|
84
|
+
lib/codex/content.rb
|
85
|
+
lib/codex/filter.rb
|
86
|
+
lib/codex/filters/code_filter.rb
|
87
|
+
lib/codex/filters/graphviz_filter.rb
|
88
|
+
lib/codex/filters/ritex_filter.rb
|
89
|
+
lib/codex/pressie.rb
|
90
|
+
lib/codex/version.rb
|
91
|
+
lib/stylesheets/pressie.css
|
92
|
+
lib/stylesheets/print.css
|
93
|
+
lib/stylesheets/ruby.png
|
94
|
+
script/console
|
95
|
+
script/destroy
|
96
|
+
script/generate
|
97
|
+
setup.rb
|
98
|
+
tasks/deployment.rake
|
99
|
+
tasks/environment.rake
|
100
|
+
tasks/website.rake
|
101
|
+
test/test_codex.rb
|
102
|
+
test/test_codex_generator.rb
|
103
|
+
test/test_filter.rb
|
104
|
+
test/test_generator_helper.rb
|
105
|
+
test/test_helper.rb
|
data/PostInstall.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
= Codex
|
2
|
+
|
3
|
+
http://github.com/pragdave/codex
|
4
|
+
|
5
|
+
== Description
|
6
|
+
|
7
|
+
This is a remarkably trivial package that makes simply HTML-based presentations from
|
8
|
+
a set up source files written using Textile. It's designed to help when creating
|
9
|
+
slides that contain lots of code, as it allows code to be embedded from external source files.
|
10
|
+
This means that the code that you embed can come from running (and tested) programs.
|
11
|
+
|
12
|
+
The code in the resulting slides is syntax highlighted, and is hyperlinked to the original
|
13
|
+
source file, allowing that file to be brought up in Textmate.
|
14
|
+
|
15
|
+
== Requirements
|
16
|
+
|
17
|
+
* make sure you have Ruby 1.8.6 installed and RubyGems
|
18
|
+
|
19
|
+
== Installation
|
20
|
+
|
21
|
+
gem install codex
|
22
|
+
|
23
|
+
== Usage
|
24
|
+
|
25
|
+
* type 'rake all' in the same directory as this README file
|
26
|
+
* open html/all.html
|
27
|
+
|
28
|
+
== License
|
29
|
+
|
30
|
+
See the file LICENSE.txt for details on how this all may be used.
|
31
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
class CodexGenerator < RubiGen::Base
|
2
|
+
|
3
|
+
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
|
4
|
+
Config::CONFIG['ruby_install_name'])
|
5
|
+
|
6
|
+
default_options :author => nil
|
7
|
+
|
8
|
+
attr_reader :name
|
9
|
+
|
10
|
+
def initialize(runtime_args, runtime_options = {})
|
11
|
+
super
|
12
|
+
usage if args.empty?
|
13
|
+
@destination_root = File.expand_path(args.shift)
|
14
|
+
@name = base_name
|
15
|
+
extract_options
|
16
|
+
end
|
17
|
+
|
18
|
+
def manifest
|
19
|
+
record do |m|
|
20
|
+
# Ensure appropriate folder(s) exists
|
21
|
+
m.directory ''
|
22
|
+
BASEDIRS.each { |path| m.directory path }
|
23
|
+
|
24
|
+
# Create stubs
|
25
|
+
m.template_copy_each %w[Rakefile]
|
26
|
+
m.template_copy_each "html/all.html"
|
27
|
+
%w[basics building example including_code including_tex table_of_contents user_defined graphviz].each do |template|
|
28
|
+
m.file_copy_each "content/#{template}.textile"
|
29
|
+
end
|
30
|
+
m.file_copy_each "content/metadata.yml"
|
31
|
+
%w[build_all postprocess_all pressie].each do |bin|
|
32
|
+
m.file_copy_each "bin/#{bin}.rb"
|
33
|
+
end
|
34
|
+
%w[basic_continuation cc_throw_catch closure_continuation closure_continuation_2].each do |code|
|
35
|
+
m.file_copy_each "code/control/#{code}.rb"
|
36
|
+
end
|
37
|
+
m.file_copy_each "code/graphviz/graph.dot"
|
38
|
+
["CollapseCode.html", "Cpp.html", "CrashTest.html", "CSharp.html", "CSS.html",
|
39
|
+
"Delphi.html", "FirstLine.html", "Index.html", "Java.html", "JavaScript.html",
|
40
|
+
"NoControls.html", "NoGutter.html", "PHP.html", "Python.html", "Ruby.html",
|
41
|
+
"ShowColumns.html", "SmartTabs.html", "SQL.html",
|
42
|
+
"VB.html", "XML.html",
|
43
|
+
"Scripts/clipboard.swf", "Scripts/shBrushCpp.js", "Scripts/shBrushCSharp.js",
|
44
|
+
"Scripts/shBrushCss.js", "Scripts/shBrushDelphi.js", "Scripts/shBrushJava.js",
|
45
|
+
"Scripts/shBrushJScript.js", "Scripts/shBrushPhp.js", "Scripts/shBrushPython.js",
|
46
|
+
"Scripts/shBrushRuby.js", "Scripts/shBrushSql.js", "Scripts/shBrushVb.js",
|
47
|
+
"Scripts/shBrushXml.js", "Scripts/shCore.js", "Scripts/shCore.uncompressed.js",
|
48
|
+
"Styles/SyntaxHighlighter.css", "Styles/TestPages.css",
|
49
|
+
"Templates/Test.dwt"
|
50
|
+
].each do |syntax|
|
51
|
+
m.file_copy_each "dp.SyntaxHighlighter/#{syntax}"
|
52
|
+
end
|
53
|
+
["blank.gif", "bodybg.gif", "framing.css", "iepngfix.htc", "opera.css", "outline.css",
|
54
|
+
"pretty.css", "print.css", "s5-core.css", "slides.css", "slides.js"].each do |asset|
|
55
|
+
m.file_copy_each "ui/default/#{asset}"
|
56
|
+
end
|
57
|
+
m.template_copy_each "filters/example_filter.rb"
|
58
|
+
|
59
|
+
m.dependency "install_rubigen_scripts", [destination_root, 'codex'],
|
60
|
+
:shebang => options[:shebang], :collision => :force
|
61
|
+
|
62
|
+
m.readme 'readme.txt'
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
protected
|
67
|
+
def banner
|
68
|
+
<<-EOS
|
69
|
+
Creates a Codex presentations.
|
70
|
+
Codex is imple tool for creating source-code intensive presentations and courses
|
71
|
+
|
72
|
+
USAGE: #{spec.name} name
|
73
|
+
EOS
|
74
|
+
end
|
75
|
+
|
76
|
+
def add_options!(opts)
|
77
|
+
opts.separator ''
|
78
|
+
opts.separator 'Options:'
|
79
|
+
# For each option below, place the default
|
80
|
+
# at the top of the file next to "default_options"
|
81
|
+
# opts.on("-a", "--author=\"Your Name\"", String,
|
82
|
+
# "Some comment about this option",
|
83
|
+
# "Default: none") { |options[:author]| }
|
84
|
+
opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
85
|
+
end
|
86
|
+
|
87
|
+
def extract_options
|
88
|
+
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
89
|
+
# Templates can access these value via the attr_reader-generated methods, but not the
|
90
|
+
# raw instance variable value.
|
91
|
+
# @author = options[:author]
|
92
|
+
end
|
93
|
+
|
94
|
+
# Installation skeleton. Intermediate directories are automatically
|
95
|
+
# created so don't sweat their absence here.
|
96
|
+
BASEDIRS = %w(
|
97
|
+
bin
|
98
|
+
code/control
|
99
|
+
code/graphviz
|
100
|
+
html/images
|
101
|
+
dp.SyntaxHighlighter/Scripts
|
102
|
+
dp.SyntaxHighlighter/Styles
|
103
|
+
dp.SyntaxHighlighter/Templates
|
104
|
+
script
|
105
|
+
content
|
106
|
+
filters
|
107
|
+
ui/default
|
108
|
+
)
|
109
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
CONTENT_DIR = 'content/'
|
2
|
+
HTML_DIR = 'html/'
|
3
|
+
IMG_DIR = 'html/images/'
|
4
|
+
ALL_HTML = File.join(HTML_DIR, "all.html")
|
5
|
+
|
6
|
+
METADATA = File.join(CONTENT_DIR, "metadata.yml")
|
7
|
+
|
8
|
+
Dir.chdir(CONTENT_DIR) { SRC = FileList['*.textile']; SRC.resolve }
|
9
|
+
|
10
|
+
OUTPUT = []
|
11
|
+
|
12
|
+
SRC.each do |file_name|
|
13
|
+
content_file = File.join(CONTENT_DIR, file_name)
|
14
|
+
html_file = File.join(HTML_DIR, file_name.ext('.html'))
|
15
|
+
OUTPUT << html_file
|
16
|
+
desc "Build #{html_file} from #{content_file}"
|
17
|
+
file html_file => [HTML_DIR, content_file] do
|
18
|
+
sh "ruby bin/pressie.rb #{METADATA} #{content_file} > #{html_file}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Build the HTML output"
|
23
|
+
task :default => OUTPUT
|
24
|
+
|
25
|
+
desc "Build all based on the contents of content/table_of_contents.textile"
|
26
|
+
task :all => [ 'tmp/', HTML_DIR, IMG_DIR, ALL_HTML, :remove_tmp ]
|
27
|
+
|
28
|
+
task ALL_HTML => 'tmp/almost_all.html' do
|
29
|
+
sh "ruby bin/postprocess_all.rb tmp/almost_all.html >#{ALL_HTML}"
|
30
|
+
end
|
31
|
+
|
32
|
+
task 'tmp/almost_all.html' => 'tmp/almost_all.textile' do
|
33
|
+
sh "ruby bin/pressie.rb #{METADATA} tmp/almost_all.textile >tmp/almost_all.html"
|
34
|
+
end
|
35
|
+
|
36
|
+
task 'tmp/almost_all.textile' => OUTPUT do
|
37
|
+
sh "ruby bin/build_all.rb #{METADATA} content/table_of_contents.textile tmp/almost_all.textile"
|
38
|
+
end
|
39
|
+
|
40
|
+
file "tmp/" do
|
41
|
+
mkdir "tmp"
|
42
|
+
end
|
43
|
+
|
44
|
+
file "html/" do
|
45
|
+
mkdir "html"
|
46
|
+
end
|
47
|
+
|
48
|
+
file "html/" do
|
49
|
+
mkdir "html/images"
|
50
|
+
end
|
51
|
+
|
52
|
+
task :remove_tmp do
|
53
|
+
FileUtils.rm_rf("tmp")
|
54
|
+
end
|
55
|
+
|
56
|
+
desc "Remove all work products—slides and temporary files"
|
57
|
+
task :clean => :remove_tmp do
|
58
|
+
FileUtils.rm_rf HTML_DIR
|
59
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# We're passed a file containing hyperlinks to the HTML
|
2
|
+
# (ie, table_con_contents.textile)
|
3
|
+
# and contruct all.textile from it
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
def usage(msg = nil)
|
7
|
+
STDERR.puts "#{__FILE__} metadata contents output"
|
8
|
+
if msg
|
9
|
+
STDERR.puts
|
10
|
+
STDERR.puts msg
|
11
|
+
end
|
12
|
+
exit 1
|
13
|
+
end
|
14
|
+
|
15
|
+
BASE = File.join(File.dirname(__FILE__), "..")
|
16
|
+
|
17
|
+
metadata_name = ARGV.shift || usage("Missing metadata")
|
18
|
+
contents_name = ARGV.shift || usage("Missing table of contents file name")
|
19
|
+
op_name = ARGV.shift || usage("Missing output file name")
|
20
|
+
|
21
|
+
metadata = YAML.load_file(metadata_name)
|
22
|
+
|
23
|
+
contents = File.readlines(contents_name).
|
24
|
+
grep(/^\*.*:(.*)\.html/) { File.join(BASE, "content", "#{$1}.textile") }.
|
25
|
+
map {|name| File.read(name) }
|
26
|
+
|
27
|
+
File.open(op_name, "w") do |op|
|
28
|
+
|
29
|
+
op.puts "h1. #{metadata['title']}\n\n"
|
30
|
+
op.puts "bq. #{metadata['author']}\n\n"
|
31
|
+
|
32
|
+
op.puts "h1. Contents\n\n"
|
33
|
+
|
34
|
+
op.puts %{<div style="font-size: 70%">\n\n}
|
35
|
+
|
36
|
+
contents.each do |content|
|
37
|
+
content =~ /h1.\s+(.*)/
|
38
|
+
STDERR.puts $1
|
39
|
+
op.puts "* #{$1}\n\n"
|
40
|
+
end
|
41
|
+
|
42
|
+
op.puts "</div>\n\n"
|
43
|
+
|
44
|
+
contents.each do |content|
|
45
|
+
op.puts content.sub(/h1/, 'h1(slide0)').sub(/__END__.*/m, '')
|
46
|
+
end
|
47
|
+
end
|