francois-webby 0.9.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. data/History.txt +218 -0
  2. data/README.rdoc +92 -0
  3. data/Rakefile +62 -0
  4. data/bin/webby +41 -0
  5. data/bin/webby-gen +41 -0
  6. data/examples/blog/Sitefile +7 -0
  7. data/examples/blog/tasks/blog.rake +72 -0
  8. data/examples/blog/templates/atom_feed.erb +40 -0
  9. data/examples/blog/templates/blog/month.erb +22 -0
  10. data/examples/blog/templates/blog/post.erb +16 -0
  11. data/examples/blog/templates/blog/year.erb +22 -0
  12. data/examples/presentation/Sitefile +10 -0
  13. data/examples/presentation/content/css/uv/twilight.css +137 -0
  14. data/examples/presentation/content/presentation/_sample_code.txt +10 -0
  15. data/examples/presentation/content/presentation/index.txt +63 -0
  16. data/examples/presentation/content/presentation/s5/blank.gif +0 -0
  17. data/examples/presentation/content/presentation/s5/bodybg.gif +0 -0
  18. data/examples/presentation/content/presentation/s5/framing.css +23 -0
  19. data/examples/presentation/content/presentation/s5/iepngfix.htc +42 -0
  20. data/examples/presentation/content/presentation/s5/opera.css +7 -0
  21. data/examples/presentation/content/presentation/s5/outline.css +15 -0
  22. data/examples/presentation/content/presentation/s5/pretty.css +86 -0
  23. data/examples/presentation/content/presentation/s5/print.css +25 -0
  24. data/examples/presentation/content/presentation/s5/s5-core.css +9 -0
  25. data/examples/presentation/content/presentation/s5/slides.css +3 -0
  26. data/examples/presentation/content/presentation/s5/slides.js +553 -0
  27. data/examples/presentation/layouts/presentation.txt +43 -0
  28. data/examples/presentation/templates/_code_partial.erb +13 -0
  29. data/examples/presentation/templates/presentation.erb +40 -0
  30. data/examples/tumblog/Sitefile +9 -0
  31. data/examples/tumblog/content/css/tumblog.css +308 -0
  32. data/examples/tumblog/content/images/tumblog/permalink.gif +0 -0
  33. data/examples/tumblog/content/images/tumblog/rss.gif +0 -0
  34. data/examples/tumblog/content/tumblog/200806/the-noble-chicken/index.txt +12 -0
  35. data/examples/tumblog/content/tumblog/200807/historical-perspectives-on-the-classic-chicken-joke/index.txt +12 -0
  36. data/examples/tumblog/content/tumblog/200807/mad-city-chickens/index.txt +10 -0
  37. data/examples/tumblog/content/tumblog/200807/the-wisdom-of-the-dutch/index.txt +11 -0
  38. data/examples/tumblog/content/tumblog/200807/up-a-tree/index.txt +13 -0
  39. data/examples/tumblog/content/tumblog/index.txt +37 -0
  40. data/examples/tumblog/content/tumblog/rss.txt +37 -0
  41. data/examples/tumblog/layouts/tumblog/default.txt +44 -0
  42. data/examples/tumblog/layouts/tumblog/post.txt +15 -0
  43. data/examples/tumblog/lib/tumblog_helper.rb +32 -0
  44. data/examples/tumblog/tasks/tumblog.rake +30 -0
  45. data/examples/tumblog/templates/atom_feed.erb +40 -0
  46. data/examples/tumblog/templates/tumblog/conversation.erb +12 -0
  47. data/examples/tumblog/templates/tumblog/link.erb +10 -0
  48. data/examples/tumblog/templates/tumblog/photo.erb +13 -0
  49. data/examples/tumblog/templates/tumblog/post.erb +12 -0
  50. data/examples/tumblog/templates/tumblog/quote.erb +11 -0
  51. data/examples/webby/Sitefile +19 -0
  52. data/examples/webby/content/communicate/index.txt +28 -0
  53. data/examples/webby/content/css/background.gif +0 -0
  54. data/examples/webby/content/css/blueprint/print.css +76 -0
  55. data/examples/webby/content/css/blueprint/screen.css +696 -0
  56. data/examples/webby/content/css/coderay.css +96 -0
  57. data/examples/webby/content/css/site.css +196 -0
  58. data/examples/webby/content/css/uv/twilight.css +137 -0
  59. data/examples/webby/content/index.txt +37 -0
  60. data/examples/webby/content/learn/index.txt +28 -0
  61. data/examples/webby/content/reference/index.txt +204 -0
  62. data/examples/webby/content/release-notes/index.txt +21 -0
  63. data/examples/webby/content/release-notes/rel-0-9-0/index.txt +74 -0
  64. data/examples/webby/content/release-notes/rel-0-9-1/index.txt +93 -0
  65. data/examples/webby/content/release-notes/rel-0-9-2/index.txt +14 -0
  66. data/examples/webby/content/release-notes/rel-0-9-3/index.txt +47 -0
  67. data/examples/webby/content/robots.txt +6 -0
  68. data/examples/webby/content/script/jquery.corner.js +152 -0
  69. data/examples/webby/content/script/jquery.js +31 -0
  70. data/examples/webby/content/sitemap.txt +31 -0
  71. data/examples/webby/content/tips_and_tricks/index.txt +97 -0
  72. data/examples/webby/content/tutorial/index.txt +135 -0
  73. data/examples/webby/content/user-manual/index.txt +419 -0
  74. data/examples/webby/layouts/default.txt +49 -0
  75. data/examples/webby/templates/page.erb +10 -0
  76. data/examples/website/Sitefile +7 -0
  77. data/examples/website/content/css/blueprint/ie.css +26 -0
  78. data/examples/website/content/css/blueprint/plugins/buttons/icons/cross.png +0 -0
  79. data/examples/website/content/css/blueprint/plugins/buttons/icons/key.png +0 -0
  80. data/examples/website/content/css/blueprint/plugins/buttons/icons/tick.png +0 -0
  81. data/examples/website/content/css/blueprint/plugins/buttons/readme.txt +32 -0
  82. data/examples/website/content/css/blueprint/plugins/buttons/screen.css +97 -0
  83. data/examples/website/content/css/blueprint/plugins/fancy-type/readme.txt +14 -0
  84. data/examples/website/content/css/blueprint/plugins/fancy-type/screen.css +71 -0
  85. data/examples/website/content/css/blueprint/plugins/link-icons/icons/doc.png +0 -0
  86. data/examples/website/content/css/blueprint/plugins/link-icons/icons/email.png +0 -0
  87. data/examples/website/content/css/blueprint/plugins/link-icons/icons/external.png +0 -0
  88. data/examples/website/content/css/blueprint/plugins/link-icons/icons/feed.png +0 -0
  89. data/examples/website/content/css/blueprint/plugins/link-icons/icons/im.png +0 -0
  90. data/examples/website/content/css/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  91. data/examples/website/content/css/blueprint/plugins/link-icons/icons/visited.png +0 -0
  92. data/examples/website/content/css/blueprint/plugins/link-icons/icons/xls.png +0 -0
  93. data/examples/website/content/css/blueprint/plugins/link-icons/readme.txt +18 -0
  94. data/examples/website/content/css/blueprint/plugins/link-icons/screen.css +40 -0
  95. data/examples/website/content/css/blueprint/plugins/rtl/readme.txt +10 -0
  96. data/examples/website/content/css/blueprint/plugins/rtl/screen.css +109 -0
  97. data/examples/website/content/css/blueprint/print.css +30 -0
  98. data/examples/website/content/css/blueprint/screen.css +251 -0
  99. data/examples/website/content/css/blueprint/src/forms.css +49 -0
  100. data/examples/website/content/css/blueprint/src/grid.css +212 -0
  101. data/examples/website/content/css/blueprint/src/grid.png +0 -0
  102. data/examples/website/content/css/blueprint/src/ie.css +59 -0
  103. data/examples/website/content/css/blueprint/src/print.css +85 -0
  104. data/examples/website/content/css/blueprint/src/reset.css +38 -0
  105. data/examples/website/content/css/blueprint/src/typography.css +105 -0
  106. data/examples/website/content/css/coderay.css +111 -0
  107. data/examples/website/content/css/site.css +67 -0
  108. data/examples/website/content/index.txt +19 -0
  109. data/examples/website/layouts/default.txt +61 -0
  110. data/examples/website/lib/breadcrumbs.rb +28 -0
  111. data/examples/website/templates/_partial.erb +10 -0
  112. data/examples/website/templates/page.erb +18 -0
  113. data/lib/webby/apps/generator.rb +276 -0
  114. data/lib/webby/apps/main.rb +258 -0
  115. data/lib/webby/apps.rb +12 -0
  116. data/lib/webby/auto_builder.rb +157 -0
  117. data/lib/webby/builder.rb +172 -0
  118. data/lib/webby/core_ext/enumerable.rb +11 -0
  119. data/lib/webby/core_ext/hash.rb +28 -0
  120. data/lib/webby/core_ext/kernel.rb +26 -0
  121. data/lib/webby/core_ext/string.rb +163 -0
  122. data/lib/webby/core_ext/time.rb +9 -0
  123. data/lib/webby/filters/basepath.rb +97 -0
  124. data/lib/webby/filters/erb.rb +9 -0
  125. data/lib/webby/filters/haml.rb +18 -0
  126. data/lib/webby/filters/markdown.rb +16 -0
  127. data/lib/webby/filters/maruku.rb +16 -0
  128. data/lib/webby/filters/outline.rb +309 -0
  129. data/lib/webby/filters/sass.rb +17 -0
  130. data/lib/webby/filters/slides.rb +56 -0
  131. data/lib/webby/filters/textile.rb +16 -0
  132. data/lib/webby/filters/tidy.rb +76 -0
  133. data/lib/webby/filters/wiki_words.rb +14 -0
  134. data/lib/webby/filters.rb +85 -0
  135. data/lib/webby/helpers/capture_helper.rb +141 -0
  136. data/lib/webby/helpers/coderay_helper.rb +69 -0
  137. data/lib/webby/helpers/graphviz_helper.rb +136 -0
  138. data/lib/webby/helpers/tag_helper.rb +65 -0
  139. data/lib/webby/helpers/tex_img_helper.rb +133 -0
  140. data/lib/webby/helpers/ultraviolet_helper.rb +63 -0
  141. data/lib/webby/helpers/url_helper.rb +241 -0
  142. data/lib/webby/helpers.rb +30 -0
  143. data/lib/webby/journal.rb +126 -0
  144. data/lib/webby/link_validator.rb +160 -0
  145. data/lib/webby/renderer.rb +389 -0
  146. data/lib/webby/resources/db.rb +251 -0
  147. data/lib/webby/resources/layout.rb +54 -0
  148. data/lib/webby/resources/meta_file.rb +211 -0
  149. data/lib/webby/resources/page.rb +81 -0
  150. data/lib/webby/resources/partial.rb +85 -0
  151. data/lib/webby/resources/resource.rb +201 -0
  152. data/lib/webby/resources/static.rb +36 -0
  153. data/lib/webby/resources.rb +137 -0
  154. data/lib/webby/stelan/mktemp.rb +135 -0
  155. data/lib/webby/stelan/paginator.rb +165 -0
  156. data/lib/webby/tasks/build.rake +27 -0
  157. data/lib/webby/tasks/create.rake +25 -0
  158. data/lib/webby/tasks/deploy.rake +22 -0
  159. data/lib/webby/tasks/growl.rake +16 -0
  160. data/lib/webby/tasks/validate.rake +19 -0
  161. data/lib/webby.rb +232 -0
  162. data/spec/core_ext/hash_spec.rb +47 -0
  163. data/spec/core_ext/string_spec.rb +110 -0
  164. data/spec/core_ext/time_spec.rb +19 -0
  165. data/spec/data/hooligans/bad_meta_data_1.txt +34 -0
  166. data/spec/data/hooligans/bad_meta_data_2.txt +34 -0
  167. data/spec/data/html/anchor.html +11 -0
  168. data/spec/data/html/external.html +10 -0
  169. data/spec/data/html/invalid-relative.html +10 -0
  170. data/spec/data/html/relative-anchor.html +10 -0
  171. data/spec/data/html/relative-invalid-anchor.html +10 -0
  172. data/spec/data/html/relative.html +10 -0
  173. data/spec/data/outline/basic.out +81 -0
  174. data/spec/data/outline/basic.txt +25 -0
  175. data/spec/data/outline/no_clobber.out +86 -0
  176. data/spec/data/outline/numbering.out +81 -0
  177. data/spec/data/outline/numbering_only.out +21 -0
  178. data/spec/data/outline/toc_range_1.out +66 -0
  179. data/spec/data/outline/toc_range_2.out +55 -0
  180. data/spec/data/outline/toc_style.out +81 -0
  181. data/spec/data/site/Sitefile +9 -0
  182. data/spec/data/site/content/_partial.txt +10 -0
  183. data/spec/data/site/content/css/coderay.css +111 -0
  184. data/spec/data/site/content/css/site.css +67 -0
  185. data/spec/data/site/content/css/tumblog.css +308 -0
  186. data/spec/data/site/content/images/tumblog/permalink.gif +0 -0
  187. data/spec/data/site/content/images/tumblog/rss.gif +0 -0
  188. data/spec/data/site/content/index.txt +19 -0
  189. data/spec/data/site/content/photos.txt +21 -0
  190. data/spec/data/site/content/tumblog/200806/the-noble-chicken/index.txt +12 -0
  191. data/spec/data/site/content/tumblog/200807/historical-perspectives-on-the-classic-chicken-joke/index.txt +12 -0
  192. data/spec/data/site/content/tumblog/200807/mad-city-chickens/index.txt +10 -0
  193. data/spec/data/site/content/tumblog/200807/the-wisdom-of-the-dutch/index.txt +11 -0
  194. data/spec/data/site/content/tumblog/200807/up-a-tree/index.txt +13 -0
  195. data/spec/data/site/content/tumblog/index.txt +37 -0
  196. data/spec/data/site/content/tumblog/rss.txt +37 -0
  197. data/spec/data/site/layouts/default.txt +58 -0
  198. data/spec/data/site/layouts/tumblog/default.txt +44 -0
  199. data/spec/data/site/layouts/tumblog/post.txt +15 -0
  200. data/spec/data/site/lib/breadcrumbs.rb +28 -0
  201. data/spec/data/site/lib/tumblog_helper.rb +32 -0
  202. data/spec/data/site/tasks/tumblog.rake +30 -0
  203. data/spec/data/site/templates/_partial.erb +10 -0
  204. data/spec/data/site/templates/atom_feed.erb +40 -0
  205. data/spec/data/site/templates/page.erb +18 -0
  206. data/spec/data/site/templates/presentation.erb +40 -0
  207. data/spec/data/site/templates/tumblog/conversation.erb +12 -0
  208. data/spec/data/site/templates/tumblog/link.erb +10 -0
  209. data/spec/data/site/templates/tumblog/photo.erb +13 -0
  210. data/spec/data/site/templates/tumblog/post.erb +12 -0
  211. data/spec/data/site/templates/tumblog/quote.erb +11 -0
  212. data/spec/spec.opts +1 -0
  213. data/spec/spec_helper.rb +58 -0
  214. data/spec/webby/apps/generator_spec.rb +117 -0
  215. data/spec/webby/apps/main_spec.rb +88 -0
  216. data/spec/webby/filters/basepath_spec.rb +167 -0
  217. data/spec/webby/filters/maruku_spec.rb +31 -0
  218. data/spec/webby/filters/outline_spec.rb +92 -0
  219. data/spec/webby/filters/textile_spec.rb +31 -0
  220. data/spec/webby/helpers/capture_helper_spec.rb +56 -0
  221. data/spec/webby/link_validator_spec.rb +154 -0
  222. data/spec/webby/renderer_spec.rb +139 -0
  223. data/spec/webby/resources/db_spec.rb +250 -0
  224. data/spec/webby/resources/layout_spec.rb +83 -0
  225. data/spec/webby/resources/meta_file_spec.rb +171 -0
  226. data/spec/webby/resources/page_spec.rb +111 -0
  227. data/spec/webby/resources/partial_spec.rb +58 -0
  228. data/spec/webby/resources/resource_spec.rb +219 -0
  229. data/spec/webby/resources/static_spec.rb +49 -0
  230. data/spec/webby/resources_spec.rb +69 -0
  231. data/tasks/mswin32.rake +38 -0
  232. data/tasks/website.rake +37 -0
  233. metadata +372 -0
@@ -0,0 +1,47 @@
1
+
2
+ require ::File.expand_path(
3
+ ::File.join(::File.dirname(__FILE__), %w[.. spec_helper]))
4
+
5
+ describe Hash do
6
+
7
+ it "should stringify keys" do
8
+ h = {
9
+ :one => 1,
10
+ :two => 2,
11
+ 3 => 'three',
12
+ [3,4] => :thirty_four
13
+ }.stringify_keys
14
+ h.keys.sort.should == %w[3 34 one two]
15
+ end
16
+
17
+ it "should symbolize keys" do
18
+ h = {
19
+ 'foo' => 42,
20
+ 'bar' => 'baz'
21
+ }.symbolize_keys
22
+
23
+ h.has_key?('foo').should == false
24
+ h.has_key?('bar').should == false
25
+
26
+ h.has_key?(:foo).should == true
27
+ h.has_key?(:bar).should == true
28
+ end
29
+
30
+ describe "when sanitizing values" do
31
+ [
32
+ ['none', nil], ['nil', nil],
33
+ ['true', true], ['yes', true],
34
+ ['false', false], ['no', false]
35
+ ].each do |from, to|
36
+
37
+ it "should convert #{from.inspect} to #{to.inspect}" do
38
+ h = {:key => from}
39
+ h.sanitize!
40
+ h[:key].should == to
41
+ end
42
+ end
43
+ end
44
+
45
+ end
46
+
47
+ # EOF
@@ -0,0 +1,110 @@
1
+
2
+ require ::File.expand_path(
3
+ ::File.join(::File.dirname(__FILE__), %w[.. spec_helper]))
4
+
5
+ describe String do
6
+
7
+ describe "#/" do
8
+ it "should join other strings to form a file path" do
9
+ path = 'foo' / 'bar' / 'baz'
10
+ path.should == ::File.join(%w[foo bar baz])
11
+ end
12
+ end
13
+
14
+ describe "#titlecase" do
15
+ it "should not capitalize small words" do
16
+ 'and on the other hand of fate we have a ring'.titlecase.
17
+ should == 'And on the Other Hand of Fate We Have a Ring'
18
+ end
19
+
20
+ it "should not modify words that contain capital letters other than the first character" do
21
+ 'the iTunes store is down'.titlecase.
22
+ should == 'The iTunes Store Is Down'
23
+ "what's up with the MacUpdate site".titlecase.
24
+ should == "What's Up With the MacUpdate Site"
25
+ end
26
+
27
+ it "should skip words with line dots (example.com or del.icio.us)" do
28
+ 'the website example.com is used in documentation'.titlecase.
29
+ should == 'The Website example.com Is Used in Documentation'
30
+ end
31
+
32
+ it "should always capitlize the first and last words of the title" do
33
+ 'a little bit of'.titlecase.should == 'A Little Bit Of'
34
+ 'iTunes is being released'.titlecase.should == 'iTunes Is Being Released'
35
+ %q("a quoted title if").titlecase.should == %q("A Quoted Title If")
36
+ %q(and if you do via?).titlecase.should == %q(And if You Do Via?)
37
+ end
38
+
39
+ it "should caplitalize a small word after a colon" do
40
+ %q(starting sub-phrase with a small word: a trick, perhaps?).titlecase.
41
+ should == %q(Starting Sub-Phrase With a Small Word: A Trick, Perhaps?)
42
+
43
+ %q(sub-phrase with a small word in quotes: 'a trick, perhaps?').titlecase.
44
+ should == %q(Sub-Phrase With a Small Word in Quotes: 'A Trick, Perhaps?')
45
+
46
+ %q(sub-phrase with a small word in quotes: "a trick, perhaps?").titlecase.
47
+ should == %q(Sub-Phrase With a Small Word in Quotes: "A Trick, Perhaps?")
48
+ end
49
+
50
+ it "should properly handle contractions" do
51
+ %q(this isn't going to work).titlecase.
52
+ should == %q(This Isn't Going to Work)
53
+
54
+ %q(MicroSoft won't go down that route).titlecase.
55
+ should == %q(MicroSoft Won't Go Down That Route)
56
+ end
57
+
58
+ it "should capitalize phrases inside quotations" do
59
+ %q(Q&A with steve jobs: 'that's what happens in technology').titlecase.
60
+ should == %q(Q&A With Steve Jobs: 'That's What Happens in Technology')
61
+ end
62
+
63
+ end
64
+
65
+ describe "#to_url" do
66
+ it "should convert characters to words" do
67
+ given = "10% Inspiration & 90% Perspiration"
68
+ expected = "10-percent-inspiration-and-90-percent-perspiration"
69
+
70
+ given.to_url.should == expected
71
+ end
72
+
73
+ it "should convert entities to words" do
74
+ given = "Tea & crumpets & crêpes for me!"
75
+ expected = "tea-and-crumpets-and-crepes-for-me"
76
+
77
+ given.to_url.should == expected
78
+ end
79
+
80
+ it "should remove html tags" do
81
+ given = "I Am <strong>Awesome</strong>"
82
+ expected = "i-am-awesome"
83
+
84
+ given.to_url.should == expected
85
+ end
86
+
87
+ it "should convert ellipses" do
88
+ given = "The Suspense... Is... Killing Me"
89
+ expected = "the-suspense-dot-dot-dot-is-dot-dot-dot-killing-me"
90
+
91
+ given.to_url.should == expected
92
+ end
93
+
94
+ it "should convert underscores to dashes" do
95
+ given = "How to use attr_accessible and attr_protected"
96
+ expected = "how-to-use-attr-accessible-and-attr-protected"
97
+
98
+ given.to_url.should == expected
99
+ end
100
+
101
+ it "should remove punctuation" do
102
+ given = "I'm just making sure there's nothing wrong with things!"
103
+ expected = "im-just-making-sure-theres-nothing-wrong-with-things"
104
+
105
+ given.to_url.should == expected
106
+ end
107
+ end
108
+ end
109
+
110
+ # EOF
@@ -0,0 +1,19 @@
1
+
2
+ require ::File.expand_path(
3
+ ::File.join(::File.dirname(__FILE__), %w[.. spec_helper]))
4
+
5
+ describe Time do
6
+
7
+ it "should serialize to a YAML string" do
8
+ now = Time.now
9
+
10
+ utc_offset = now.utc_offset / 3600
11
+ sign, utc_offset = utc_offset < 0 ? ['-', -utc_offset] : ['', utc_offset]
12
+ str = "%s.%06d %s%02d:00" %
13
+ [now.strftime('%Y-%m-%d %H:%M:%S'), now.usec, sign, utc_offset]
14
+
15
+ now.to_y.should == str
16
+ end
17
+ end
18
+
19
+ # EOF
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: Bad Meta-Data 1
3
+ created_at: 2007-08-29 08:57:11.000000 -06:00
4
+ filter: textile
5
+ ---
6
+ h2. Pagination
7
+
8
+ Pagination is the process of organizing information onto a page such that a fixed number of items appear on each page. Webby provides some methods for paginating information.
9
+
10
+ Let's assume that your website has a collection of articles in a folder called "articles" in the content directory. The goal is to display these articles ten at a time in reverse chronological order.
11
+
12
+ <pre>
13
+ ---
14
+ title: Articles
15
+ filter:
16
+ - erb
17
+ - textile
18
+ ---
19
+ h2. <%= h(@page.title) %>
20
+
21
+ <%
22
+ articles = @pages.find(:all, :in_directory => "articles",
23
+ :sort_by => "mtime", :reverse => true)
24
+ paginate(articles, 10) do |page|
25
+ %>
26
+ <%= page.render %>
27
+ <hr />
28
+ <% end %>
29
+
30
+ <%= link_to("Prev", @pager.prev) if @pager.prev? %>
31
+ <%= link_to("Next", @pager.next) if @pager.next? %>
32
+ </pre>
33
+
34
+ In the example page above, the first step is get the collection of articles we are interested in the paginating. This is done using the <code>@pages.find</code> method to retrieve all the pages from the articles folder sorted in reverse order by modification time. When we have the collection of articles, we pass them to the @paginate@ method along with the desired number of articles per page. The @paginate@ method will pass each page in the @articles@ collection to the supplied block of code, but for each ten pages passed to the block, a new webpage will be created.
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: Bad Meta-Data 2
3
+ created_at: 2007-08-29 08:57:11.000000 -06:00
4
+ filter:
5
+ - erb
6
+ - textile
7
+ ---
8
+ h3. Requirements
9
+
10
+ Webby is written in the Ruby programming language. To install and run Webby you will need the following applications installed on your system:
11
+
12
+ * "Ruby":http://ruby-lang.org
13
+ * "RubyGems":http://rubygems.org/read/chapter/3
14
+
15
+ h3(#pages). Pages
16
+
17
+ Pages are found in the _content_ folder along with regular files. Pages contain *meta-data* at the top of the file; this is what differentiates a page from a regular file. The meta-data is a section of "YAML":http://www.yaml.org/spec/1.1/ formatted text that describes various properties and attributes of the page. These attributes are used by Webby to determine how the page will be processed by the filter engine.
18
+
19
+ Let's look at an example page.
20
+
21
+ <pre>
22
+ ---
23
+ title: Lorem Ipsum
24
+ created_at: Wed Aug 29 08:57:00 -0600 2007
25
+ filter:
26
+ - erb
27
+ - textile
28
+ ---
29
+ h2. <%%= @page.title %>
30
+
31
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc congue ipsum
32
+ vestibulum libero. Aenean vitae justo. Nam eget tellus. Etiam convallis, est eu
33
+ lobortis mattis, lectus tellus tempus felis, a ultricies erat ipsum at metus.
34
+ </pre>
@@ -0,0 +1,11 @@
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
+ <title>Anchor</title>
6
+ </head>
7
+ <body>
8
+ <a href="#anchor"></a>
9
+ <a id="anchor"></a>
10
+ </body>
11
+ </html>
@@ -0,0 +1,10 @@
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
+ <title>Anchor</title>
6
+ </head>
7
+ <body>
8
+ <a href="http://www.google.com"></a>
9
+ </body>
10
+ </html>
@@ -0,0 +1,10 @@
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
+ <title>Anchor</title>
6
+ </head>
7
+ <body>
8
+ <a href="/invalid.html"></a>
9
+ </body>
10
+ </html>
@@ -0,0 +1,10 @@
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
+ <title>Anchor</title>
6
+ </head>
7
+ <body>
8
+ <a href="/anchor.html#anchor"></a>
9
+ </body>
10
+ </html>
@@ -0,0 +1,10 @@
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
+ <title>Anchor</title>
6
+ </head>
7
+ <body>
8
+ <a href="/anchor.html#invalid"></a>
9
+ </body>
10
+ </html>
@@ -0,0 +1,10 @@
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
+ <title>Anchor</title>
6
+ </head>
7
+ <body>
8
+ <a href="/anchor.html"></a>
9
+ </body>
10
+ </html>
@@ -0,0 +1,81 @@
1
+ <ol>
2
+ <li>
3
+ <a href="#h1">First Header</a>
4
+ <ol>
5
+ <li>
6
+ <a href="#h1_1">Second Header</a>
7
+ </li>
8
+ <li>
9
+ <a href="#h1_2">Third Header</a>
10
+ </li>
11
+ </ol>
12
+ </li>
13
+ <li>
14
+ <a href="#h2">Fourth Header</a>
15
+ </li>
16
+ <li>
17
+ <a href="#h3">Fifth Header</a>
18
+ <ol>
19
+ <li>
20
+ <a href="#h3_1">Sixth Header</a>
21
+ <ol>
22
+ <li>
23
+ <a href="#h3_1_1">Seventh Header</a>
24
+ <ol>
25
+ <li>
26
+ <a href="#h3_1_1_1">Eighth Header</a>
27
+ <ol>
28
+ <li>
29
+ <a href="#h3_1_1_1_1">Ninth Header</a>
30
+ <ol>
31
+ <li>
32
+ <a href="#h3_1_1_1_1_1">Tenth Header</a>
33
+ </li>
34
+ </ol>
35
+ </li>
36
+ </ol>
37
+ </li>
38
+ </ol>
39
+ </li>
40
+ </ol>
41
+ </li>
42
+ <li>
43
+ <a href="#h3_2">Eleventh Header</a>
44
+ <ol>
45
+ <li>
46
+ <a href="#h3_2_1">Twelfth Header</a>
47
+ </li>
48
+ <li>
49
+ <a href="#h3_2_2">Thirteenth Header</a>
50
+ </li>
51
+ </ol>
52
+ </li>
53
+ </ol>
54
+ </li>
55
+ <li>
56
+ <a href="#h4">Fourteenth Header</a>
57
+ <ol>
58
+ <li>
59
+ <a href="#h4_1">Fifteenth Header</a>
60
+ </li>
61
+ </ol></li></ol>
62
+
63
+ <h1 id="h1"><span class="heading-num">1</span>First Header</h1>
64
+ <h2 id="h1_1"><span class="heading-num">1.1</span>Second Header</h2>
65
+ <h2 id="h1_2"><span class="heading-num">1.2</span>Third Header</h2>
66
+
67
+ <h1 id="h2"><span class="heading-num">2</span>Fourth Header</h1>
68
+
69
+ <h1 id="h3"><span class="heading-num">3</span>Fifth Header</h1>
70
+ <h2 id="h3_1"><span class="heading-num">3.1</span>Sixth Header</h2>
71
+ <h3 id="h3_1_1"><span class="heading-num">3.1.1</span>Seventh Header</h3>
72
+ <h4 id="h3_1_1_1"><span class="heading-num">3.1.1.1</span>Eighth Header</h4>
73
+ <h5 id="h3_1_1_1_1"><span class="heading-num">3.1.1.1.1</span>Ninth Header</h5>
74
+ <h6 id="h3_1_1_1_1_1"><span class="heading-num">3.1.1.1.1.1</span>Tenth Header</h6>
75
+
76
+ <h2 id="h3_2"><span class="heading-num">3.2</span>Eleventh Header</h2>
77
+ <h3 id="h3_2_1"><span class="heading-num">3.2.1</span>Twelfth Header</h3>
78
+ <h3 id="h3_2_2"><span class="heading-num">3.2.2</span>Thirteenth Header</h3>
79
+
80
+ <h1 id="h4"><span class="heading-num">4</span>Fourteenth Header</h1>
81
+ <h2 id="h4_1"><span class="heading-num">4.1</span>Fifteenth Header</h2>
@@ -0,0 +1,25 @@
1
+ ---
2
+ title: Outline Test
3
+ filter: outline
4
+ ---
5
+ <toc />
6
+
7
+ <h1>First Header</h1>
8
+ <h2>Second Header</h2>
9
+ <h2>Third Header</h2>
10
+
11
+ <h1>Fourth Header</h1>
12
+
13
+ <h1>Fifth Header</h1>
14
+ <h2>Sixth Header</h2>
15
+ <h3>Seventh Header</h3>
16
+ <h4>Eighth Header</h4>
17
+ <h5>Ninth Header</h5>
18
+ <h6>Tenth Header</h6>
19
+
20
+ <h2>Eleventh Header</h2>
21
+ <h3>Twelfth Header</h3>
22
+ <h3>Thirteenth Header</h3>
23
+
24
+ <h1>Fourteenth Header</h1>
25
+ <h2>Fifteenth Header</h2>
@@ -0,0 +1,86 @@
1
+ <div>
2
+ <p>This is the title</p>
3
+ <ol>
4
+ <li>
5
+ <a href="#h1">First Header</a>
6
+ <ol>
7
+ <li>
8
+ <a href="#h1_1">Second Header</a>
9
+ </li>
10
+ <li>
11
+ <a href="#h1_2">Third Header</a>
12
+ </li>
13
+ </ol>
14
+ </li>
15
+ <li>
16
+ <a href="#h2">Fourth Header</a>
17
+ </li>
18
+ <li>
19
+ <a href="#h3">Fifth Header</a>
20
+ <ol>
21
+ <li>
22
+ <a href="#h3_1">Sixth Header</a>
23
+ <ol>
24
+ <li>
25
+ <a href="#h3_1_1">Seventh Header</a>
26
+ <ol>
27
+ <li>
28
+ <a href="#h3_1_1_1">Eighth Header</a>
29
+ <ol>
30
+ <li>
31
+ <a href="#h3_1_1_1_1">Ninth Header</a>
32
+ <ol>
33
+ <li>
34
+ <a href="#h3_1_1_1_1_1">Tenth Header</a>
35
+ </li>
36
+ </ol>
37
+ </li>
38
+ </ol>
39
+ </li>
40
+ </ol>
41
+ </li>
42
+ </ol>
43
+ </li>
44
+ <li>
45
+ <a href="#h3_2">Eleventh Header</a>
46
+ <ol>
47
+ <li>
48
+ <a href="#h3_2_1">Twelfth Header</a>
49
+ </li>
50
+ <li>
51
+ <a href="#h3_2_2">Thirteenth Header</a>
52
+ </li>
53
+ </ol>
54
+ </li>
55
+ </ol>
56
+ </li>
57
+ <li>
58
+ <a href="#h4">Fourteenth Header</a>
59
+ <ol>
60
+ <li>
61
+ <a href="#h4_1">Fifteenth Header</a>
62
+ </li>
63
+ </ol></li></ol>
64
+ <p>And some sampler text</p>
65
+ </div>
66
+
67
+
68
+ <h1 id="h1"><span class="heading-num">1</span>First Header</h1>
69
+ <h2 id="h1_1"><span class="heading-num">1.1</span>Second Header</h2>
70
+ <h2 id="h1_2"><span class="heading-num">1.2</span>Third Header</h2>
71
+
72
+ <h1 id="h2"><span class="heading-num">2</span>Fourth Header</h1>
73
+
74
+ <h1 id="h3"><span class="heading-num">3</span>Fifth Header</h1>
75
+ <h2 id="h3_1"><span class="heading-num">3.1</span>Sixth Header</h2>
76
+ <h3 id="h3_1_1"><span class="heading-num">3.1.1</span>Seventh Header</h3>
77
+ <h4 id="h3_1_1_1"><span class="heading-num">3.1.1.1</span>Eighth Header</h4>
78
+ <h5 id="h3_1_1_1_1"><span class="heading-num">3.1.1.1.1</span>Ninth Header</h5>
79
+ <h6 id="h3_1_1_1_1_1"><span class="heading-num">3.1.1.1.1.1</span>Tenth Header</h6>
80
+
81
+ <h2 id="h3_2"><span class="heading-num">3.2</span>Eleventh Header</h2>
82
+ <h3 id="h3_2_1"><span class="heading-num">3.2.1</span>Twelfth Header</h3>
83
+ <h3 id="h3_2_2"><span class="heading-num">3.2.2</span>Thirteenth Header</h3>
84
+
85
+ <h1 id="h4"><span class="heading-num">4</span>Fourteenth Header</h1>
86
+ <h2 id="h4_1"><span class="heading-num">4.1</span>Fifteenth Header</h2>