webby 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/History.txt +20 -0
  2. data/Manifest.txt +46 -2
  3. data/Rakefile +4 -3
  4. data/bin/webby +1 -1
  5. data/data/Rakefile +0 -1
  6. data/data/content/css/blueprint/plugins/buttons/icons/cross.png +0 -0
  7. data/data/content/css/blueprint/plugins/buttons/icons/key.png +0 -0
  8. data/data/content/css/blueprint/plugins/buttons/icons/tick.png +0 -0
  9. data/data/content/s5/blank.gif +0 -0
  10. data/data/content/s5/bodybg.gif +0 -0
  11. data/data/content/s5/framing.css +23 -0
  12. data/data/content/s5/iepngfix.htc +42 -0
  13. data/data/content/s5/opera.css +7 -0
  14. data/data/content/s5/outline.css +15 -0
  15. data/data/content/s5/pretty.css +86 -0
  16. data/data/content/s5/print.css +1 -0
  17. data/data/content/s5/s5-core.css +9 -0
  18. data/data/content/s5/slides.css +3 -0
  19. data/data/content/s5/slides.js +553 -0
  20. data/data/lib/breadcrumbs.rb +0 -0
  21. data/data/tasks/blog.rake +71 -0
  22. data/data/tasks/build.rake +27 -0
  23. data/data/tasks/create.rake +19 -1
  24. data/data/tasks/deploy.rake +2 -2
  25. data/data/tasks/setup.rb +4 -1
  26. data/data/templates/atom_feed.erb +20 -13
  27. data/data/templates/page.erb +1 -1
  28. data/data/templates/presentation.erb +40 -0
  29. data/examples/presentation/Rakefile +14 -0
  30. data/examples/presentation/content/_sample_code.txt +10 -0
  31. data/examples/presentation/content/css/uv/twilight.css +137 -0
  32. data/examples/presentation/content/index.txt +63 -0
  33. data/examples/presentation/content/s5/blank.gif +0 -0
  34. data/examples/presentation/content/s5/bodybg.gif +0 -0
  35. data/examples/presentation/content/s5/framing.css +23 -0
  36. data/examples/presentation/content/s5/iepngfix.htc +42 -0
  37. data/examples/presentation/content/s5/opera.css +7 -0
  38. data/examples/presentation/content/s5/outline.css +15 -0
  39. data/examples/presentation/content/s5/pretty.css +86 -0
  40. data/examples/presentation/content/s5/print.css +1 -0
  41. data/examples/presentation/content/s5/s5-core.css +9 -0
  42. data/examples/presentation/content/s5/slides.css +3 -0
  43. data/examples/presentation/content/s5/slides.js +553 -0
  44. data/examples/presentation/layouts/presentation.rhtml +43 -0
  45. data/examples/presentation/tasks/blog.rake +71 -0
  46. data/examples/presentation/tasks/build.rake +27 -0
  47. data/examples/presentation/tasks/create.rake +22 -0
  48. data/examples/presentation/tasks/deploy.rake +22 -0
  49. data/examples/presentation/tasks/growl.rake +12 -0
  50. data/examples/presentation/tasks/heel.rake +28 -0
  51. data/examples/presentation/tasks/setup.rb +17 -0
  52. data/examples/presentation/tasks/validate.rake +19 -0
  53. data/examples/presentation/templates/_partial.erb +13 -0
  54. data/examples/presentation/templates/presentation.erb +40 -0
  55. data/examples/webby/Rakefile +3 -2
  56. data/examples/webby/content/css/blueprint/screen.css +1 -1
  57. data/examples/webby/content/css/coderay.css +0 -15
  58. data/examples/webby/content/css/site.css +18 -13
  59. data/examples/webby/content/css/uv/twilight.css +137 -0
  60. data/examples/webby/content/index.txt +6 -10
  61. data/examples/webby/content/manual/index.txt +83 -122
  62. data/examples/webby/content/reference/index.txt +161 -16
  63. data/examples/webby/content/script/jquery.js +1 -1
  64. data/examples/webby/content/tips_and_tricks/index.txt +1 -1
  65. data/examples/webby/content/tutorial/index.txt +1 -1
  66. data/examples/webby/layouts/default.rhtml +2 -7
  67. data/examples/webby/tasks/blog.rake +71 -0
  68. data/examples/webby/tasks/build.rake +27 -0
  69. data/examples/webby/tasks/create.rake +19 -1
  70. data/examples/webby/tasks/deploy.rake +2 -2
  71. data/examples/webby/tasks/setup.rb +4 -20
  72. data/examples/webby/templates/page.erb +1 -1
  73. data/lib/webby.rb +30 -5
  74. data/lib/webby/auto_builder.rb +0 -2
  75. data/lib/webby/builder.rb +51 -5
  76. data/lib/webby/filters.rb +3 -3
  77. data/lib/webby/filters/basepath.rb +7 -7
  78. data/lib/webby/filters/erb.rb +0 -2
  79. data/lib/webby/filters/haml.rb +0 -2
  80. data/lib/webby/filters/markdown.rb +0 -2
  81. data/lib/webby/filters/outline.rb +43 -2
  82. data/lib/webby/filters/sass.rb +0 -2
  83. data/lib/webby/filters/slides.rb +56 -0
  84. data/lib/webby/filters/textile.rb +0 -2
  85. data/lib/webby/filters/tidy.rb +0 -2
  86. data/lib/webby/helpers.rb +0 -2
  87. data/lib/webby/helpers/capture_helper.rb +141 -0
  88. data/lib/webby/helpers/coderay_helper.rb +5 -16
  89. data/lib/webby/helpers/graphviz_helper.rb +6 -18
  90. data/lib/webby/helpers/tag_helper.rb +0 -2
  91. data/lib/webby/helpers/tex_img_helper.rb +5 -16
  92. data/lib/webby/helpers/ultraviolet_helper.rb +11 -22
  93. data/lib/webby/helpers/url_helper.rb +2 -4
  94. data/lib/webby/link_validator.rb +0 -2
  95. data/lib/webby/main.rb +0 -2
  96. data/lib/webby/renderer.rb +163 -37
  97. data/lib/webby/resources.rb +0 -2
  98. data/lib/webby/resources/db.rb +37 -27
  99. data/lib/webby/resources/file.rb +0 -2
  100. data/lib/webby/resources/layout.rb +0 -2
  101. data/lib/webby/resources/page.rb +4 -9
  102. data/lib/webby/resources/partial.rb +1 -3
  103. data/lib/webby/resources/resource.rb +10 -2
  104. data/lib/webby/resources/static.rb +0 -2
  105. data/lib/webby/stelan/mktemp.rb +0 -2
  106. data/lib/webby/stelan/spawner.rb +0 -2
  107. data/lib/webby/utils.rb +0 -2
  108. data/spec/spec_helper.rb +1 -4
  109. data/spec/webby/helpers/capture_helper_spec.rb +56 -0
  110. data/spec/webby/resources/file_spec.rb +0 -1
  111. data/tasks/ann.rake +7 -4
  112. data/tasks/bones.rake +2 -2
  113. data/tasks/gem.rake +26 -14
  114. data/tasks/notes.rake +11 -5
  115. data/tasks/post_load.rake +4 -2
  116. data/tasks/rdoc.rake +4 -2
  117. data/tasks/rubyforge.rake +3 -3
  118. data/tasks/setup.rb +24 -9
  119. data/tasks/spec.rake +1 -1
  120. data/tasks/website.rake +1 -1
  121. metadata +51 -7
  122. data/lib/webby/webby_task.rb +0 -134
  123. data/tasks/svn.rake +0 -45
@@ -9,9 +9,7 @@ Webby works by combining the contents of a *page* with a *layout* to produce HTM
9
9
 
10
10
  Install Webby and try it out!
11
11
 
12
- <pre>
13
- sudo gem install -y webby
14
- </pre>
12
+ sudo gem install webby
15
13
 
16
14
  h2. Features
17
15
 
@@ -29,13 +27,11 @@ h2. But Wait! There's More!
29
27
 
30
28
  Webby has a great _autobuild_ feature that continuously generates HTML whenever the *pages* or *layouts* change. The HTML is served up via "heel":http://copiousfreetime.rubyforge.org/heel/, a static file webserver based on mongrel. Whenever you change a page, you can immediately see those changes without having to run any commands.
31
29
 
32
- <pre>
33
- $ rake autobuild
34
- heel --root output --daemonize
35
- [10:21:26] INFO: starting autobuild (Ctrl-C to stop)
36
- [10:21:26] INFO: creating output/index.html
37
- [10:22:57] INFO: creating output/index.html
38
- </pre>
30
+ $ rake autobuild
31
+ heel --root output --daemonize
32
+ [10:21:26] INFO: starting autobuild (Ctrl-C to stop)
33
+ [10:21:26] INFO: creating output/index.html
34
+ [10:22:57] INFO: creating output/index.html
39
35
 
40
36
  Webby is not limited to producing HTML. By no means! Do you ever get tired of repeating the same color code *#D3C4A2* in your CSS files? Webby can help. Need some customized JavaScript for your website. Webby can help. Anytime you find yourself repeating the same bit of text over and over, then you should be using Webby.
41
37
 
@@ -188,7 +188,7 @@ The following attributes are defined for each page in the content folder. These
188
188
 
189
189
  h4. Page Filters
190
190
 
191
- Filters operate on the content of a page by transforming the text of the content section according to the rules of the individual filter. Some filters transform simplified markup into true HTML syntax; examples of these are the Textile filter and the Markdown filter. Other filters create images from text in the page (Graphviz filter) or apply syntax highlighting to the text (CodeRay filter). All the filters are discussed in detail in the "Filters":#filters section of this document.
191
+ Filters operate on the content of a page by transforming the text of the content section according to the rules of the individual filter. Some filters transform simplified markup into true HTML syntax; examples of these are the Textile filter and the Markdown filter. Other filters will rewrite URLs (basepath filter) or clean up the generated HTML (tidy filter). All the filters are discussed in detail in the "Filters":#filters section of this document.
192
192
 
193
193
  h3. Layouts
194
194
 
@@ -248,17 +248,20 @@ The title of this page is "&lt;%= @page.title" %&gt;".
248
248
  The title of this page is "<%= @page.title %>".
249
249
  </pre>
250
250
 
251
- p(column span-2). *Usage*:
252
-
253
- p(column span-13). Include "erb" in the filter list of the page or layout that contains ERB formatting.
254
-
255
- p(column span-2). *Options*:
256
-
257
- p(column span-13). none
251
+ <div class="label">Usage</div>
252
+ <div class="desc">
253
+ Include "erb" in the filter list of the page or layout that contains ERB formatting.
254
+ </div>
258
255
 
259
- p(column span-2). *Require*:
256
+ <div class="label">Options</div>
257
+ <div class="desc">
258
+ none
259
+ </div>
260
260
 
261
- p(column span-13). none
261
+ <div class="label">Require</div>
262
+ <div class="desc">
263
+ none
264
+ </div>
262
265
 
263
266
  h3. Textile
264
267
 
@@ -268,17 +271,20 @@ A complete textile reference is beyond the scope of this document. Please refer
268
271
 
269
272
  The textile filter will operate on all the contents of a page or layout. Given that fact, it should be one of the last filters applied to the page. You can prevent a section of the page from being processed by the textile filter by surrounding it with <code><notextile>&lt;notextile&gt;...&lt;/notextile&gt;</notextile></code> tags.
270
273
 
271
- p(column span-2). *Usage*:
272
-
273
- p(column span-13). Include "textile" in the filter list of the page or layout that contains Textile formatting
274
-
275
- p(column span-2). *Options*:
276
-
277
- p(column span-13). none
274
+ <div class="label">Usage</div>
275
+ <div class="desc">
276
+ Include "textile" in the filter list of the page or layout that contains Textile formatting
277
+ </div>
278
278
 
279
- p(column span-2). *Require*:
279
+ <div class="label">Options</div>
280
+ <div class="desc">
281
+ none
282
+ </div>
280
283
 
281
- p(column span-13). The @RedCloth@ gem must be installed on your system in order to use the textile filter.
284
+ <div class="label">Require</div>
285
+ <div class="desc">
286
+ The *RedCloth* gem must be installed on your system in order to use the textile filter.
287
+ </div>
282
288
 
283
289
  fn1(fn){clear:both}. Please don't ask. Why is very smart, he wrote the Ruby code that handles Textile markup, and the code is very solid. Enjoy the benefits of his work.
284
290
 
@@ -290,17 +296,20 @@ bq. The overriding design goal for Markdown's formatting syntax is to make it as
290
296
 
291
297
  The markdown filter will operate on all the contents of a page or layout. Given that fact, it should be one of the last filters applied to the page.
292
298
 
293
- p(column span-2). *Usage*:
294
-
295
- p(column span-13). Include "markdown" in the filter list of the page or layout that contains Markdown formatting.
296
-
297
- p(column span-2). *Options*:
298
-
299
- p(column span-13). none
299
+ <div class="label">Usage</div>
300
+ <div class="desc">
301
+ Include "markdown" in the filter list of the page or layout that contains Markdown formatting.
302
+ </div>
300
303
 
301
- p(column span-2). *Require*:
304
+ <div class="label">Options</div>
305
+ <div class="desc">
306
+ none
307
+ </div>
302
308
 
303
- p(column span-13). The @BlueCloth@ gem must be installed on your system in order to use the markdown filter.
309
+ <div class="label">Require</div>
310
+ <div class="desc">
311
+ The *BlueCloth* gem must be installed on your system in order to use the markdown filter.
312
+ </div>
304
313
 
305
314
  h3. HAML & SASS
306
315
 
@@ -310,95 +319,38 @@ bq. "HAML":http://haml.hamptoncatlin.com/docs/haml and "SASS":http://haml.hampto
310
319
 
311
320
  Both the haml and the sass filter will operate on all the contents of a page or layout. Given that fact, these should be one of the last filters applied to the page.
312
321
 
313
- p(column span-2). *Usage*:
314
-
315
- p(column span-13). Include "haml" in the filter list of the page or layout that contains HAML formatting. Include "sass" in the filter list of the page that contains SASS formatting (this should be a CSS page).
316
-
317
- p(column span-2). *Options*:
318
-
319
- p(column span-13). Options are passed to the haml filter by setting the "haml_options" in the page meta-data -- the hash of options defined under the "haml_options" attribute will be passed to the haml filter engine when it is run. Please refer to the HAML documentation for the list of available options.
320
-
321
- p(column span-13 prepend-2). Options are passed to the sass filter by setting the "sass_options" in the page meta-data -- the hash of options defined under the "sass_options" attribute will be passed to the sass filter engine when it is run. Please refer to the SASS documentation for the list of available options.
322
-
323
- p(column span-2). *Require*:
324
-
325
- p(column span-13). The @haml@ gem must be installed on your system in order to use the haml filter or the sass filter.
326
-
327
- h3. CodeRay
328
-
329
- "CodeRay":http://coderay.rubychan.de/ is a Ruby library that provides syntax highlighting for various types of source code. The coderay filter takes a portion of the page contents and runs it through the CodeRay syntax highlighter, and pretty, colored XHTML is inserted into the page. The end result is that you can embed code into a page, and the coderay filter will convert that code into valid XHTML.
330
-
331
- Unlike the filters mentioned thus far, the coderay filter does not operate on the entire contents of a page. Only text between <code><notextile>&lt;coderay&gt;...&lt;/coderay&gt;</notextile></code> tags will be run through the coderay filter. The XHTML inserted into the page is contained in a @div@ element styled with a @CodeRay@ class.
332
-
333
- The coderay filter is controlled by setting attributes on the coderay tags in the content of the page. These attributes tell the CodeRay engine the language being parsed, to show line numbers, where to start numbering etc.
334
-
335
- <pre>
336
- <notextile>&lt;coderay lang="ruby" line_numbers="inline"&gt;
337
- class Object
338
- def returning( r )
339
- yield r if block_given?
340
- r
341
- end
342
- end
343
- &lt;/coderay&gt;</notextile>
344
- </pre>
345
-
346
- <% coderay :lang => "ruby", :line_numbers => "inline" do %>
347
- class Object
348
- def returning( r )
349
- yield r if block_given?
350
- r
351
- end
352
- end
353
- <% end %>
354
-
355
- p(column span-2). *Usage*:
356
-
357
- p(column span-13). Include "coderay" in the filter list of the page or layout that contains Markdown formatting. You will also need to link to the coderay stylesheet in any page containing coderay markup.
322
+ <div class="label">Usage</div>
323
+ <div class="desc">
324
+ Include "haml" in the filter list of the page or layout that contains HAML formatting. Include "sass" in the filter list of the page that contains SASS formatting (this should be a CSS page).
325
+ </div>
358
326
 
359
- p(column span-2). *Options*:
327
+ <div class="label">Options</div>
328
+ <div class="desc">
360
329
 
361
- p(column span-13). The full list of "coderay options":/rdoc/classes/Webby/Filters/CodeRay.html can be found in the source documentation.
330
+ Options are passed to the haml filter by setting the "haml_options" in the page meta-data -- the hash of options defined under the "haml_options" attribute will be passed to the haml filter engine when it is run. Please refer to the HAML documentation for the list of available options.
362
331
 
363
- p(column span-2). *Require*:
332
+ p(last). Options are passed to the sass filter by setting the "sass_options" in the page meta-data -- the hash of options defined under the "sass_options" attribute will be passed to the sass filter engine when it is run. Please refer to the SASS documentation for the list of available options.
364
333
 
365
- p(column span-13). The @coderay@ gem must be installed on your system in order to use the coderay filter. Be sure to include the coderay stylesheet in your layout.
334
+ </div>
366
335
 
367
- h3(#graphviz). Graphviz
336
+ <div class="label">Require</div>
337
+ <div class="desc">
338
+ The @haml@ gem must be installed on your system in order to use the haml filter or the sass filter.
339
+ </div>
368
340
 
369
- "Graphviz":http://www.graphviz.org/ is open source graph visualization software. Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. The Graphviz layout programs take descriptions of graphs in a simple text language, and make diagrams in several useful formats. The graphviz filter allows you to embed Graphviz scripts into a page and generate an image in the page.
341
+ h3. Outline
370
342
 
371
- The graphviz filter does not operate on the entire contents of a page. Only text between <code><notextile>&lt;graphviz&gt;...&lt;/graphviz&gt;</notextile></code> tags will be run through the graphviz filter. The resulting image will be inserted into the page using a standard @img@ tag. If the Graphviz script contains references to URLs, then an image map will also be generated and inserted into the page. This results in an image with clickable regions.
343
+ The Outline filter is used to insert outline numbering into HTML heading tags (h1, h2, h3, etc.) and to generate a table of contents based on the heading tags. The table of contents is inserted into the page at the location of the @<toc />@ tag. If there is no @<toc />@ tag, then a table of contents will not be created but outline numbering will still take place.
372
344
 
373
- The graphviz filter is controlled by setting attributes on the graphviz tags in the content of the page. These attributes tell the Graphviz renderer where to store the generated image, the type of image to create, etc.
345
+ If a table of contents is desired without outline numbers being inserted into the heading tags, this can be specified in the attibutes of the @<toc />@ tag itself.
374
346
 
375
347
  <pre>
376
- <notextile>&lt;graphviz path="images" alt="hello world graph"&gt;
377
- digraph hello_world {
378
- rankdir = LR;
379
- Hello -> World;
380
- }
381
- &lt;/graphviz&gt;</notextile>
348
+ <toc numbering="off" />
382
349
  </pre>
383
350
 
384
- <% graphviz :path => "images", :alt => "hello world graph" do %>
385
- digraph hello_world {
386
- rankdir = LR;
387
- Hello -> World;
388
- }
389
- <% end %>
390
-
391
- p(column span-2). *Usage*:
392
-
393
- p(column span-13). Include "graphviz" in the filter list of the page or layout that contains Graphviz scripts.
394
-
395
- p(column span-2). *Options*:
396
-
397
- p(column span-13). The full list of "graphviz options":/rdoc/classes/Webby/Filters/Graphviz.html can be found in the source documentation.
351
+ This will generate a table of contents, but not insert outline numbering into the heading tags. The full list of "TOC attributes":/rdoc/classes/Webby/Filters/Outline.html can be found in the source documentation.
398
352
 
399
- p(column span-2). *Require*:
400
-
401
- p(column span-13). The Graphviz application must be installed on your system, and the Graphviz executables must be available on the path.
353
+ The Outline filter will only work on valid HTML or XHTML pages. Therefore it should be used after any markup langauge filters (textile, markdown, etc.).
402
354
 
403
355
  h3. BasePath
404
356
 
@@ -406,26 +358,31 @@ The basepath filter is used to rewrite the base path location for all URLs in a
406
358
 
407
359
  The basepath filter only works on HTML/XHTML text, and therefore, it should be one of the last (if not the last) filter applied to your content. It is recommended to only include the basepath filter in your layout(s). The basepath filter should appear before the tidy filter.
408
360
 
409
- p(column span-2). *Usage*:
361
+ <div class="label">Usage</div>
362
+ <div class="desc">
410
363
 
411
- p(column span-13){margin-bottom:0}. Include "basepath" in the filter list of your layout(s). Specify the new base path to use either as a command line argument or as an option configured in the _Rakefile_. The base path specified on the command line takes precedence over the base path specified in the Rakefile.
364
+ Include "basepath" in the filter list of your layout(s). Specify the new base path to use either as a command line argument or as an option configured in the _Rakefile_. The base path specified on the command line takes precedence over the base path specified in the Rakefile.
412
365
 
413
- <pre class="option">
366
+ <pre style="margin-bottom:0">
414
367
  $ rake rebuild BASE='http://your.website.com/path/to/your/site'
415
368
  </pre>
369
+ </div>
416
370
 
417
- p(column span-2). *Options*:
371
+ <div class="label">Options</div>
372
+ <div class="desc">
418
373
 
419
- p(column span-13){margin-bottom:0}. Options can be passed to the basepath filter by specifying them in the project _Rakefile_.
374
+ Options can be passed to the basepath filter by specifying them in the project _Rakefile_.
420
375
 
421
- <pre class="option">
376
+ <pre style="margin-bottom:0">
422
377
  SITE.xpaths << '/html/body//img[@usemap]'
423
378
  SITE.base = 'http://webby.rubyforge.org'
424
379
  </pre>
380
+ </div>
425
381
 
426
- p(column span-2). *Require*:
427
-
428
- p(column span-13). none
382
+ <div class="label">Require</div>
383
+ <div class="desc">
384
+ none
385
+ </div>
429
386
 
430
387
  h3(#tidy). Tidy
431
388
 
@@ -435,21 +392,25 @@ bq. When editing HTML it's easy to make mistakes. Wouldn't it be nice if there w
435
392
 
436
393
  The tidy program only works on HTML/XHTML text, and therefore, tidy should be one of the last (if not the last) filter applied to your content. It is recommended to only include the tidy filter in your layout(s).
437
394
 
438
- p(column span-2). *Usage*:
439
-
440
- p(column span-13). Include "tidy" as the last item in the filter list of your layout(s).
395
+ <div class="label">Usage</div>
396
+ <div class="desc">
397
+ Include "tidy" as the last item in the filter list of your layout(s).
398
+ </div>
441
399
 
442
- p(column span-2). *Options*:
400
+ <div class="label">Options</div>
401
+ <div class="desc">
443
402
 
444
- p(column span-13){margin-bottom:0}. Options can be passed to the tidy program by specifying them in the project _Rakefile_. These are the command line options that will be passed to the tidy program when it is run.
403
+ Options can be passed to the tidy program by specifying them in the project _Rakefile_. These are the command line options that will be passed to the tidy program when it is run.
445
404
 
446
- <pre class="option">
405
+ <pre style="margin-bottom:0">
447
406
  SITE.tidy_options = '-indent -wrap 80'
448
407
  </pre>
408
+ </div>
449
409
 
450
- p(column span-2). *Require*:
451
-
452
- p(column span-13). The HTML Tidy application must be installed on your system, and the @tidy@ executable must be available on the path.
410
+ <div class="label">Require</div>
411
+ <div class="desc">
412
+ The HTML Tidy application must be installed on your system, and the @tidy@ executable must be available on the path.
413
+ </div>
453
414
 
454
415
  h2. Using Rake
455
416
 
@@ -5,6 +5,9 @@ filter:
5
5
  - erb
6
6
  - textile
7
7
  - outline
8
+ content_for_head: |
9
+ <link rel="stylesheet" href="/css/coderay.css" type="text/css" media="screen, projection" />
10
+ <link rel="stylesheet" href="/css/uv/twilight.css" type="text/css" media="screen, projection" />
8
11
  ---
9
12
  <div class="toc push-1">
10
13
 
@@ -26,32 +29,174 @@ h3. Attributes
26
29
 
27
30
  Attributes are defined in the meta-data section of pages and layouts.
28
31
 
29
- table(reference).
30
- | *destination* | Defines the path in the output directory where the rendered page should be stored. |
31
- | *dirty* | The dirty flag is used to determine whether the page should rendered or not. Normally this is automatically determined by the filter engine, but it can be overridden by setting this attribute. If the dirty flag is set to _true_ then the page will always be rendered. If the dirty flag is set to _false_ then the page will never be rendered. |
32
- | *extension* | Defines the extension that will be appended to the filename of the rendered page in the output folder. The extension is determined by looking at the following:
32
+ <div class="label">destination</div>
33
+ <div class="desc">
34
+ Defines the path in the output directory where the rendered page should be stored.
35
+ </div>
36
+
37
+ <div class="label">dirty</div>
38
+ <div class="desc">
39
+ The dirty flag is used to determine whether the page should rendered or not. Normally this is automatically determined by the filter engine, but it can be overridden by setting this attribute. If the dirty flag is set to _true_ then the page will always be rendered. If the dirty flag is set to _false_ then the page will never be rendered.
40
+ </div>
41
+
42
+ <div class="label">extension</div>
43
+ <div class="desc">
44
+ Defines the extension that will be appended to the filename of the rendered page in the output folder. The extension is determined by looking at the following:
45
+
33
46
  * the meta-data of the current page for an @extension@ attribute
34
47
  * the meta-data of layout file of the current page for an @extension@ attribute
35
- * the extension of this page file in the _content_ folder |
36
- | *filter* | Defines the list of filters that will be applied to the contents of this page. If left blank, then the default filter will be applied to the page contents. |
37
- | *layout* | Defines the layout that the page contents will be rendered into. The default layout will be used if this attribute is not defined. The value of @nil@ should be specified if the page should not be rendered into any layout. |
48
+ * the extension of this page file in the _content_ folder
49
+
50
+ </div>
51
+
52
+ <div class="label">filter</div>
53
+ <div class="desc">
54
+ Defines the list of filters that will be applied to the contents of this page. If left blank, then the default filter will be applied to the page contents.
55
+ </div>
56
+
57
+ <div class="label">layout</div>
58
+ <div class="desc">
59
+ Defines the layout that the page contents will be rendered into. The default layout will be used if this attribute is not defined. The value of @nil@ should be specified if the page should not be rendered into any layout.
60
+ </div>
38
61
 
39
62
  The following attributes are defined for each page in the content folder. These attributes cannot be changed in the page's meta-data section. However, they are available to the ERB filter when rendering the contents of a page.
40
63
 
41
- table(reference).
42
- | *path* | The full path to the file in the _content_ folder |
43
- | *dir* | The relative directory in the output folder where the page will be rendered |
44
- | *filename* | The name of the file in the _content_ folder excluding any path information |
45
- | *ext* | The extension of the file in the _content_ folder |
46
- | *mtime* | The modification time of the file in the _content_ folder |
47
- | *number* | Reserved variable used for multi-page content |
48
- | *url* | A URL suitable for creating a link to the page |
49
- | *render* | Returns the contents of the page as rendered by the Webby filter engine |
64
+ <div class="label">path</div>
65
+ <div class="desc">
66
+ The full path to the file in the _content_ folder
67
+ </div>
68
+
69
+ <div class="label">dir</div>
70
+ <div class="desc">
71
+ The relative directory in the output folder where the page will be rendered
72
+ </div>
73
+
74
+ <div class="label">filename </div>
75
+ <div class="desc">
76
+ The name of the file in the _content_ folder excluding any path information and extension
77
+ </div>
78
+
79
+ <div class="label">ext</div>
80
+ <div class="desc">
81
+ The extension of the file in the _content_ folder
82
+ </div>
83
+
84
+ <div class="label">mtime</div>
85
+ <div class="desc">
86
+ The modification time of the file in the _content_ folder
87
+ </div>
88
+
89
+ <div class="label">number</div>
90
+ <div class="desc">
91
+ Reserved variable used for multi-page content
92
+ </div>
93
+
94
+ <div class="label">url</div>
95
+ <div class="desc">
96
+ A URL suitable for creating a link to the page
97
+ </div>
98
+
99
+ <div class="label">render</div>
100
+ <div class="desc">
101
+ Returns the contents of the page as rendered by the Webby filter engine
102
+ </div>
50
103
 
51
104
  h3. Filters
52
105
 
53
106
  h3. ERB Variables & Methods
54
107
 
108
+ h4. coderay
109
+
110
+ The coderay method is used to generate syntax highlighting on a block of code. You will need to have the coderay gem installed on your system, and you will need to include the coderay CSS stylesheet in your pages for the syntax highlighting markup to take effect.
111
+
112
+ The full list of "coderay options":/rdoc/classes/Webby/Helpers/CodeRayHelper.html can be found in the source documentation.
113
+
114
+ <pre>
115
+ <%% coderay :lang => 'ruby', :line_numbers => 'inline' do -%>
116
+ class Object
117
+ def returning( r )
118
+ yield r if block_given?
119
+ r
120
+ end
121
+ end
122
+ <%% end -%>
123
+ </pre>
124
+
125
+ <% coderay :lang => "ruby", :line_numbers => "inline" do -%>
126
+ class Object
127
+ def returning( r )
128
+ yield r if block_given?
129
+ r
130
+ end
131
+ end
132
+ <% end -%>
133
+
134
+
135
+ h4. graphviz
136
+
137
+ The graphviz method is used to convert a DOT script into an image and insert the image into the page. If the DOT script contains URL references, then an image map will also be generated. The resulting image will then have "clickable" regions that link to the URLs specified.
138
+
139
+ "Graphviz":http://www.graphviz.org/ needs to be installed on your system in order to use the graphviz method. The full list of "graphviz options":/rdoc/classes/Webby/Helpers/GraphvizHelper.html can be found in the source documentation.
140
+
141
+ <pre>
142
+ <%% graphviz :path => 'images', :alt => 'hello world graph' do -%>
143
+ digraph hello_world {
144
+ rankdir = LR;
145
+ Hello -> World;
146
+ }
147
+ <%% end -%>
148
+ </pre>
149
+
150
+ <% graphviz :path => "images", :alt => "hello world graph" do -%>
151
+ digraph hello_world {
152
+ rankdir = LR;
153
+ Hello -> World;
154
+ }
155
+ <% end -%>
156
+
157
+
158
+ h4. tex2img
159
+
160
+ The tex2img method is used to convert a LaTeX script into an image and insert the image into the page. "LaTeX":http://www.latex-project.org/ and "ImageMagick":http://www.imagemagick.org/script/index.php need to be instaled on your system in order to use the tex2img maethod.
161
+
162
+ The full list of "tex2img options":/rdoc/classes/Webby/Helpers/TexImgHelper.html can be found in the source documentation.
163
+
164
+ <pre>
165
+ <%% tex2img 'wave_eq', :path => 'images', :alt => 'wave equation' do -%>
166
+ $\psi_{tot}(x,-t_0,r) = \frac{1}{(2\pi)^2} \int\!\!\!\int
167
+ \tilde\Psi_{tot}\left(k_x,\frac{c}{2}\sqrt{k_x^2 + k_r^2},r=0\right)$
168
+ <%% end -%>
169
+ </pre>
170
+
171
+ <% tex2img 'wave_eq', :path => 'images', :alt => 'wave equation' do -%>
172
+ $\psi_{tot}(x,-t_0,r) = \frac{1}{(2\pi)^2} \int\!\!\!\int
173
+ \tilde\Psi_{tot}\left(k_x,\frac{c}{2}\sqrt{k_x^2 + k_r^2},r=0\right)$
174
+ <% end -%>
175
+
176
+
177
+ h4. uv
178
+
179
+ The uv method is used to generate syntax highlighting on a block of code. You will need to have the "Ultraviolet":http://ultraviolet.rubyforge.org/ gem installed on your system, and you will need to include the desired CSS stylesheet in your pages for the syntax highlighting markup to take effect.
180
+
181
+ The full list of "ultraviolet options":/rdoc/classes/Webby/Helpers/UltraVioletHelper.html can be found in the source documentation.
182
+
183
+ <pre>
184
+ <%% uv :lang => "ruby", :line_numbers => true do -%>
185
+ # Initializer for the class.
186
+ def initialize( string )
187
+ @str = string
188
+ end
189
+ <%% end -%>
190
+ </pre>
191
+
192
+ <% uv :lang => "ruby", :line_numbers => true, :theme => 'twilight' do -%>
193
+ # Initializer for the class.
194
+ def initialize( string )
195
+ @str = string
196
+ end
197
+ <% end -%>
198
+
199
+
55
200
  h3. Rake Tasks
56
201
 
57
202
  h3. Site Defaults