gettalong-webgen 0.5.7.20090227 → 0.5.8.20090507

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. data/Rakefile +37 -36
  2. data/data/webgen/resources.yaml +2 -2
  3. data/data/webgen/webgui/app.rb +11 -0
  4. data/data/webgen/webgui/controller/main.rb +30 -26
  5. data/data/webgen/webgui/{view/page.xhtml → layout/default.xhtml} +8 -8
  6. data/data/webgen/webgui/start.rb +9 -0
  7. data/data/webgen/webgui/view/create_website.xhtml +6 -14
  8. data/data/webgen/webgui/view/manage_website.xhtml +2 -2
  9. data/data/webgen/website_bundles/default/README +6 -0
  10. data/data/webgen/website_bundles/default/src/index.page +15 -0
  11. data/data/webgen/{website_styles → website_bundles/style}/1024px/README +0 -0
  12. data/data/webgen/{website_styles → website_bundles/style}/1024px/src/default.css +0 -0
  13. data/data/webgen/{website_styles → website_bundles/style}/1024px/src/default.template +0 -0
  14. data/data/webgen/{website_styles → website_bundles/style}/1024px/src/images/background.gif +0 -0
  15. data/data/webgen/{website_styles → website_bundles/style}/andreas00/README +0 -0
  16. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/default.css +0 -0
  17. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/default.template +0 -0
  18. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/bg.gif +0 -0
  19. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/front.jpg +0 -0
  20. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/menubg.gif +0 -0
  21. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/menubg2.gif +0 -0
  22. data/data/webgen/{website_styles → website_bundles/style}/andreas01/README +0 -0
  23. data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/default.css +0 -0
  24. data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/default.template +0 -0
  25. data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/images/bg.gif +0 -0
  26. data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/images/front.jpg +0 -0
  27. data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/print.css +0 -0
  28. data/data/webgen/{website_styles → website_bundles/style}/andreas03/README +0 -0
  29. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/default.css +0 -0
  30. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/default.template +0 -0
  31. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/bodybg.png +0 -0
  32. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/contbg.png +0 -0
  33. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/footerbg.png +0 -0
  34. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/gradient1.png +0 -0
  35. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/gradient2.png +0 -0
  36. data/data/webgen/{website_styles → website_bundles/style}/andreas04/README +0 -0
  37. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/default.css +0 -0
  38. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/default.template +0 -0
  39. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/blinkarrow.gif +0 -0
  40. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/bodybg.png +0 -0
  41. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/contentbg.png +0 -0
  42. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/entrybg.png +0 -0
  43. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/flash.gif +0 -0
  44. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/flash2.gif +0 -0
  45. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/globe.gif +0 -0
  46. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/globebottom.gif +0 -0
  47. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/linkarrow.gif +0 -0
  48. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/menuhover.png +0 -0
  49. data/data/webgen/{website_styles → website_bundles/style}/andreas05/README +0 -0
  50. data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/default.css +0 -0
  51. data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/default.template +0 -0
  52. data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/images/bodybg.gif +0 -0
  53. data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/images/front.png +0 -0
  54. data/data/webgen/{website_styles → website_bundles/style}/andreas06/README +0 -0
  55. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/default.css +6 -4
  56. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/default.template +2 -2
  57. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/bodybg.gif +0 -0
  58. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/boxbg.gif +0 -0
  59. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/greypx.gif +0 -0
  60. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/header.jpg +0 -0
  61. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/innerbg.gif +0 -0
  62. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/leaves.jpg +0 -0
  63. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/tabs.gif +0 -0
  64. data/data/webgen/{website_styles → website_bundles/style}/andreas07/README +0 -0
  65. data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/browserfix.css +0 -0
  66. data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/default.css +0 -0
  67. data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/default.template +0 -0
  68. data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/images/bodybg.gif +0 -0
  69. data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/images/sidebarbg.gif +0 -0
  70. data/data/webgen/{website_styles → website_bundles/style}/andreas08/README +0 -0
  71. data/data/webgen/{website_styles → website_bundles/style}/andreas08/src/default.css +0 -0
  72. data/data/webgen/{website_styles → website_bundles/style}/andreas08/src/default.template +0 -0
  73. data/data/webgen/{website_styles → website_bundles/style}/andreas09/README +0 -0
  74. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/default.css +0 -0
  75. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/default.template +0 -0
  76. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-black.jpg +0 -0
  77. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-green.jpg +0 -0
  78. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-orange.jpg +0 -0
  79. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-purple.jpg +0 -0
  80. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-red.jpg +0 -0
  81. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg.jpg +0 -0
  82. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/footerbg.jpg +0 -0
  83. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-black.jpg +0 -0
  84. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-green.jpg +0 -0
  85. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-orange.jpg +0 -0
  86. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-purple.jpg +0 -0
  87. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-red.jpg +0 -0
  88. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover.jpg +0 -0
  89. data/data/webgen/{website_styles → website_bundles/style}/simple/README +0 -0
  90. data/data/webgen/{website_styles → website_bundles/style}/simple/src/default.css +0 -0
  91. data/data/webgen/{website_styles → website_bundles/style}/simple/src/default.template +0 -0
  92. data/data/webgen/website_skeleton/README +1 -1
  93. data/data/webgen/website_skeleton/config.yaml +5 -4
  94. data/doc/contentprocessor/blocks.page +43 -10
  95. data/doc/contentprocessor/builder.page +1 -1
  96. data/doc/contentprocessor/erb.page +12 -11
  97. data/doc/contentprocessor/redcloth.page +3 -1
  98. data/doc/extensions.page +3 -3
  99. data/doc/faq.page +13 -10
  100. data/doc/getting_started.page +12 -15
  101. data/doc/index.page +7 -1
  102. data/doc/manual.page +78 -27
  103. data/doc/reference_configuration.page +166 -3
  104. data/doc/reference_website_styles.page +28 -0
  105. data/doc/source/filesystem.page +39 -0
  106. data/doc/source/tararchive.page +40 -0
  107. data/doc/tag/tikz.page +2 -1
  108. data/doc/webgen_page_format.page +13 -12
  109. data/doc/website_styles.metainfo +8 -0
  110. data/lib/webgen/blackboard.rb +2 -2
  111. data/lib/webgen/cache.rb +4 -4
  112. data/lib/webgen/cli.rb +29 -16
  113. data/lib/webgen/cli/apply_command.rb +66 -0
  114. data/lib/webgen/cli/create_command.rb +22 -16
  115. data/lib/webgen/cli/utils.rb +23 -0
  116. data/lib/webgen/cli/webgui_command.rb +31 -16
  117. data/lib/webgen/configuration.rb +8 -6
  118. data/lib/webgen/contentprocessor.rb +4 -5
  119. data/lib/webgen/contentprocessor/blocks.rb +2 -0
  120. data/lib/webgen/contentprocessor/builder.rb +6 -3
  121. data/lib/webgen/contentprocessor/erb.rb +6 -3
  122. data/lib/webgen/contentprocessor/erubis.rb +7 -6
  123. data/lib/webgen/contentprocessor/haml.rb +6 -3
  124. data/lib/webgen/contentprocessor/rdoc.rb +0 -1
  125. data/lib/webgen/contentprocessor/redcloth.rb +3 -1
  126. data/lib/webgen/context.rb +73 -0
  127. data/lib/webgen/context/nodes.rb +36 -0
  128. data/lib/webgen/coreext.rb +3 -2
  129. data/lib/webgen/default_config.rb +3 -1
  130. data/lib/webgen/deprecated.rb +53 -0
  131. data/lib/webgen/node.rb +24 -19
  132. data/lib/webgen/output.rb +50 -7
  133. data/lib/webgen/page.rb +45 -36
  134. data/lib/webgen/path.rb +1 -1
  135. data/lib/webgen/source.rb +32 -4
  136. data/lib/webgen/source/resource.rb +3 -3
  137. data/lib/webgen/source/stacked.rb +1 -1
  138. data/lib/webgen/source/tararchive.rb +73 -0
  139. data/lib/webgen/sourcehandler.rb +4 -4
  140. data/lib/webgen/sourcehandler/base.rb +36 -24
  141. data/lib/webgen/sourcehandler/copy.rb +1 -1
  142. data/lib/webgen/sourcehandler/feed.rb +2 -2
  143. data/lib/webgen/sourcehandler/fragment.rb +1 -1
  144. data/lib/webgen/sourcehandler/metainfo.rb +15 -6
  145. data/lib/webgen/sourcehandler/page.rb +9 -5
  146. data/lib/webgen/sourcehandler/virtual.rb +44 -7
  147. data/lib/webgen/tag/base.rb +19 -13
  148. data/lib/webgen/tag/link.rb +1 -0
  149. data/lib/webgen/version.rb +1 -1
  150. data/lib/webgen/webgentask.rb +15 -13
  151. data/lib/webgen/website.rb +42 -11
  152. data/lib/webgen/websiteaccess.rb +1 -1
  153. data/lib/webgen/websitemanager.rb +61 -66
  154. data/man/man1/webgen.1 +4 -0
  155. data/misc/default.css +13 -0
  156. data/misc/default.template +1 -1
  157. data/misc/htmldoc.metainfo +2 -1
  158. data/misc/style.page +33 -0
  159. data/test/test_cli.rb +1 -7
  160. data/test/test_common_sitemap.rb +2 -2
  161. data/test/test_contentprocessor_blocks.rb +14 -1
  162. data/test/test_contentprocessor_builder.rb +3 -1
  163. data/test/test_contentprocessor_erb.rb +3 -2
  164. data/test/test_contentprocessor_erubis.rb +3 -3
  165. data/test/test_contentprocessor_fragments.rb +3 -3
  166. data/test/test_contentprocessor_haml.rb +3 -2
  167. data/test/test_contentprocessor_maruku.rb +3 -3
  168. data/test/test_contentprocessor_rdiscount.rb +1 -1
  169. data/test/test_contentprocessor_rdoc.rb +1 -1
  170. data/test/test_contentprocessor_redcloth.rb +9 -2
  171. data/test/test_contentprocessor_sass.rb +1 -1
  172. data/test/test_contentprocessor_tags.rb +1 -1
  173. data/test/{test_contentprocessor_context.rb → test_context.rb} +9 -7
  174. data/test/test_node.rb +27 -21
  175. data/test/test_page.rb +4 -4
  176. data/test/test_source_tararchive.rb +65 -0
  177. data/test/test_sourcehandler_fragment.rb +1 -1
  178. data/test/test_sourcehandler_memory.rb +6 -6
  179. data/test/test_sourcehandler_metainfo.rb +34 -13
  180. data/test/test_sourcehandler_page.rb +8 -0
  181. data/test/test_sourcehandler_virtual.rb +51 -12
  182. data/test/test_tag_breadcrumbtrail.rb +4 -4
  183. data/test/test_tag_coderay.rb +1 -1
  184. data/test/test_tag_date.rb +1 -1
  185. data/test/test_tag_executecommand.rb +1 -1
  186. data/test/test_tag_includefile.rb +3 -3
  187. data/test/test_tag_langbar.rb +6 -6
  188. data/test/test_tag_link.rb +8 -2
  189. data/test/test_tag_menu.rb +9 -9
  190. data/test/test_tag_metainfo.rb +1 -1
  191. data/test/test_tag_relocatable.rb +1 -1
  192. data/test/test_tag_sitemap.rb +1 -1
  193. data/test/test_tag_tikz.rb +2 -2
  194. data/test/test_website.rb +17 -0
  195. data/test/test_websitemanager.rb +16 -21
  196. metadata +181 -171
  197. data/data/webgen/website_templates/default/README +0 -6
  198. data/data/webgen/website_templates/default/src/index.page +0 -8
  199. data/data/webgen/website_templates/project/README +0 -5
  200. data/data/webgen/website_templates/project/src/about.page +0 -12
  201. data/data/webgen/website_templates/project/src/download.page +0 -15
  202. data/data/webgen/website_templates/project/src/features.page +0 -8
  203. data/data/webgen/website_templates/project/src/index.page +0 -9
  204. data/data/webgen/website_templates/project/src/screenshots.page +0 -18
  205. data/lib/webgen/contentprocessor/context.rb +0 -89
@@ -259,7 +259,7 @@ margin: 0px;
259
259
  padding: 0px;
260
260
  }
261
261
 
262
- .nav, #leftside #submenu ul a {
262
+ .nav, #leftside #submenu ul a, #leftside #submenu ul span {
263
263
  color:#d04a10;
264
264
  display:block;
265
265
  font-size:1.1em;
@@ -271,20 +271,22 @@ text-decoration:none;
271
271
  width:125px;
272
272
  }
273
273
 
274
- .nav:hover, #leftside #submenu ul a:hover {
274
+ .nav:hover, #leftside #submenu ul a:hover, #leftside #submenu ul span:hover,
275
+ #leftside #submenu ul li.webgen-menu-item-selected a, #leftside #submenu ul li.webgen-menu-item-selected span {
275
276
  border:1px solid #fa9035;
276
277
  color:#505050;
277
278
  padding:1px 1px 1px 9px;
278
279
  }
279
280
 
280
- .sub, #leftside #submenu ul ul a {
281
+ .sub, #leftside #submenu ul ul a, #leftside #submenu ul ul span {
281
282
  font-size:0.9em;
282
283
  margin-left:20px;
283
284
  padding:1px 1px 1px 6px;
284
285
  width:105px;
285
286
  }
286
287
 
287
- .sub:hover, #leftside #submenu ul ul a {
288
+ .sub:hover, #leftside #submenu ul ul a:hover, #leftside #submenu ul ul span:hover,
289
+ #leftside #submenu ul ul li.webgen-menu-item-selected a, #leftside #submenu ul ul li.webgen-menu-item-selected span {
288
290
  border:1px solid #fa9035;
289
291
  color:#505050;
290
292
  padding:0 0 0 5px;
@@ -37,8 +37,8 @@
37
37
  <div id="leftside">
38
38
  <a id="sectionmenu"></a>
39
39
  <p class="soft">Some text here, maybe a website description</p>
40
- <% if node.level > 1 %>
41
- <h1>Site menu:</h1>
40
+ <% if context.node.level > 1 %>
41
+ <h1>Site menu:</h1>
42
42
  <div id="submenu">{menu: {start_level: 2, max_levels: 2}}</div>
43
43
  <% end %>
44
44
  </div>
@@ -5,6 +5,6 @@ description:
5
5
  When using the standard settings, the sources are in the directory `src` and
6
6
  the generated output goes into `out`. Extensions can be placed under `ext`.
7
7
 
8
- For configuration purposes, use the config.rb or config.yaml files.
8
+ For configuration purposes, use the config.yaml file.
9
9
  ---
10
10
  note: This file can be deleted!
@@ -10,8 +10,9 @@
10
10
  #
11
11
  # Have a look at the documentation of the individual configuration options to see
12
12
  # the allowed format of the values. Since this is a YAML file, you can easily set
13
- # configuration options to strings, integers, dates, arrays, hashes and more.
13
+ # configuration options as strings, integers, dates, arrays, hashes and more.
14
14
  #
15
- # The available configuration options can be listed using the `webgen config`
16
- # command, for example: `webgen config sourcehandler` will list all options starting
17
- # with sourcehandler.
15
+ # The available configuration options can be found on the homepage in the
16
+ # Configuration Option Reference at
17
+ #
18
+ # http://webgen.rubyforge.org/documentation/reference_configuration.html
@@ -8,26 +8,59 @@ templates to define the place where the actual page content should be.
8
8
 
9
9
  The general syntax is as follows:
10
10
 
11
- <webgen:block name='BLOCK_NAME' chain='(L)CN;(L)CN;...' node='first' notfound='ignore' />
11
+ <webgen:block name='BLOCK_NAME' chain='(L)CN;(L)CN;...' node='next|first|current' notfound='ignore' />
12
12
 
13
13
  So it is basically an XML tag with the mandatory attribute `name` and the optional attributes
14
- `chain`, `node` and `notfound`:
14
+ `chain`, `node` and `notfound`. The attributes are explained below but first comes a small
15
+ explanation of how this tag works.
16
+
17
+ webgen uses a node chain when rendering a page file. The default node chain is automatically
18
+ determined via the `template` meta information (see [SourceHandler::Template]({relocatable:
19
+ ../sourcehandler/template.html})) and the important thing to keep in mind is that the first node in
20
+ the node chain is always the currently rendered template/page.
21
+
22
+ For example, consider a `default.template` with a block tag of `<webgen:block name='content' />` and
23
+ an `index.page` that should be rendered. This would result in a node chain of (note that the CN of a
24
+ page file has the extension `html`)
25
+
26
+ default.template ---> index.html
27
+
28
+ During the rendering of the `index.page`, the node chain like shown above is created and rendering
29
+ is started at the *first* node in the chain, in this case at `default.template`. When the block tag
30
+ is encountered, it is replaced by the block named `content`, after rendering it according to its
31
+ render pipeline, of the `index.page`. If such a block tag was not in the template, then the content
32
+ of the `index.page` file would never be inserted into the output file! The behaviour of the block
33
+ tag can be customized by using the various attributes.
34
+
35
+ Summing up: the `template` meta information is used to create a node chain which is then used by the
36
+ block tag to render the appropriate blocks.
37
+
38
+ Following is the documentation for the available attributes of the tag:
15
39
 
16
40
  * The `name` attribute is the only mandatory attribute and it specifies the name of the block that
17
- should be rendered in place of the block tag. The next node in the used node chain (if there is
18
- only one node left in the node chain that node is used) needs to have a block that has such a name
19
- (this behaviour can be changed with the `node` attribute), otherwise an error is raised. The
20
- block is rendered according to its render pipeline and then inserted.
41
+ should be rendered in place of the block tag. If the used node (see the `node` attribute) has no
42
+ such named block, an error is raised.
21
43
 
22
44
  * The optional attribute `chain` specifies the node chain that should be used for rendering the
23
45
  block. Its value needs to be a list of (localized) canonical names of nodes separated by
24
46
  semicolons that should be used as node chain. If this attribute is not specified the default node
25
47
  chain is used.
26
48
 
27
- * The optional attribute `node` specifies which node in the node chain should be used. If this
28
- attribute is not specified, the next node in the node chain is used. If it is specified with the
29
- value `first`, then the node chain is traversed till a node is found that has a block with the
30
- specified name. If no such node is in the node chain, an error is raised.
49
+ * The optional attribute `node` specifies which node in the node chain should be used.
50
+
51
+ * If this attribute is not specified or its value is `next`, the next node in the node chain (i.e.
52
+ the second node) is used. If there is only one node left in the node chain that node is used.
53
+
54
+ * If the attribute has a value of `first`, then the node chain is traversed till a node is found
55
+ that has a block with the specified name. If no such node is in the node chain, an error is
56
+ raised. If the attribute `chain` is also used, then the search starts at the first node of the
57
+ node chain. Otherwise it starts at the second node.
58
+
59
+ * If the attribute has a value of `current`, the currently processed node is used (i.e. the first
60
+ node in the node chain).
61
+
62
+ > Note that the attribute `chain` is not used in this situation!
63
+ {.important}
31
64
 
32
65
  * If the optional attribute `notfound` has a value of `ignore`, all errors that can occur are
33
66
  ignored. This is especially useful when used in templates to include blocks that may not be
@@ -52,7 +52,7 @@ a custom XML document (the `content` block has to be valid Ruby!):
52
52
  title: Person Object
53
53
  template: ~
54
54
  --- pipeline:builder
55
- xml.persons(:path => node.absolute_lcn) do |p|
55
+ xml.persons(:path => context.node.absolute_lcn) do |p|
56
56
  p.person do |b|
57
57
  b.firstname('Thomas')
58
58
  b.lastname('Leitner')
@@ -7,19 +7,20 @@ This processer uses ERB (embedded Ruby) to process content. For detailed informa
7
7
  a look at its documentation by executing `ri ERB` or the [ruby documentation
8
8
  site](http://www.ruby-doc.org/)!
9
9
 
10
- You can use the following special objects in your ERB code:
10
+ You can use the special object `context` in your ERB code which provides the whole rendering context
11
+ and the following useful methods:
11
12
 
12
- * `context`: This object provides the whole rendering context, the following objects are just for
13
- backwards compatibility.
13
+ * `website`: Provides access to the `Webgen::Website` object which can be used to access all aspects
14
+ of the currently rendered website.
14
15
 
15
- * `ref_node` (or `context.ref_node`): The reference node which is the source of the ERB code that is
16
- executed. Should be used, for example, for resolving paths.
16
+ * `node` (or `content_node`): The node that gets currently rendered. Should be used for retrieving
17
+ meta information.
17
18
 
18
- * `node` (or `context.content_node`): The node that gets currently rendered. Should be used for
19
- retrieving meta information.
19
+ * `ref_node`: The reference node which is the source of the ERB code that is executed. Should be
20
+ used, for example, for resolving paths.
20
21
 
21
- * `dest_node` (or `context.dest_node`): The node in which the result gets inserted. Should be used
22
- for calculating relative paths.
22
+ * `dest_node`: The node in which the result gets inserted. Should be used for calculating relative
23
+ paths.
23
24
 
24
25
  Here is a small usage example. The following put in a page file
25
26
 
@@ -29,7 +30,7 @@ Here is a small usage example. The following put in a page file
29
30
  <%% end %>
30
31
 
31
32
  Outputting all meta information:
32
- <%% node.meta_info.each do |k,v| %>
33
+ <%% context.node.meta_info.each do |k,v| %>
33
34
  * <%%= k %> = <%%= v %>
34
35
  <%% end %>
35
36
 
@@ -41,7 +42,7 @@ Here is a small usage example. The following put in a page file
41
42
  <% end %>
42
43
 
43
44
  Outputting all meta information:
44
- <% node.meta_info.each do |k,v| %>
45
+ <% context.node.meta_info.each do |k,v| %>
45
46
  * <%= k %> = <%= v %>
46
47
  <% end %>
47
48
 
@@ -12,6 +12,8 @@ RedCloth library. For detailed information about Textile have a look at the [Tex
12
12
  > gem install RedCloth
13
13
  {.warning}
14
14
 
15
+ You can use the configuration option `contentprocessor.redcloth.hard_breaks` to enable/disable the
16
+ conversion of single newlines into HTML break tags.
15
17
 
16
18
  Example
17
19
  -------
@@ -36,4 +38,4 @@ Here is a short sample of a text in Textile markup:
36
38
 
37
39
 
38
40
  [1]: http://hobix.com/textile/
39
- [2]: http://whytheluckystiff.net/ruby/redcloth/
41
+ [2]: http://whytheluckystiff.net/ruby/redcloth/
data/doc/extensions.page CHANGED
@@ -6,11 +6,11 @@ title: Extensions
6
6
  Following is a listing of all available extensions:
7
7
 
8
8
  <%
9
- pattern = /#{File.join(node.parent.absolute_lcn, '/')}(contentprocessor|output|source|sourcehandler|tag|)\/.*html$/
10
- context.content_node.tree.node_access[:alcn].select {|alcn, n| alcn =~ pattern}.sort.each do |alcn, n|
9
+ pattern = /#{File.join(context.node.parent.absolute_lcn, '/')}(contentprocessor|output|source|sourcehandler|tag|)\/.*html$/
10
+ context.node.tree.node_access[:alcn].select {|alcn, n| alcn =~ pattern}.sort.each do |alcn, n|
11
11
  next if n.is_fragment?
12
12
  %>
13
- * <%= dest_node.link_to(n) %>
13
+ * <%= context.dest_node.link_to(n) %>
14
14
  <%
15
15
  end
16
16
  %>
data/doc/faq.page CHANGED
@@ -10,14 +10,17 @@ title: FAQ
10
10
 
11
11
  * **Why can I specify multiple blocks in a page/template file?**
12
12
 
13
- This allows you to provide different content parts for one page. For example, image you have a
13
+ This allows you to provide different content parts for one page. For example, imagine you have a
14
14
  layout with a sidebar and you want to have page specific sidebar contents. The easiest way to
15
15
  achieve that is to add a `sidebar` block to the page files that provide a page specific sidebar
16
- content and conditionally include the `sidebar` block in your `default.template`, like this:
16
+ content and include the `sidebar` block in your `default.template`, like this:
17
17
 
18
- <%% if node.node_info[:page].blocks.has_key?('sidebar') %>
19
- \<webgen:block name='sidebar' />
20
- <%% end %>
18
+ <webgen:block name='sidebar' notfound="ignore" chain="first" />
19
+
20
+ By using `notfound="ignore"` we tell webgen to ignore errors when such a block is not found and
21
+ the `chain="first"` attribute tells webgen to search through the whole node chain for such a
22
+ block. The latter is needed when nested templates are used because by default only the next node
23
+ in the chain is inspected.
21
24
 
22
25
  * **What do I have to do to use the extensions?**
23
26
 
@@ -43,9 +46,9 @@ questions.
43
46
 
44
47
  Use the `webgen` command to create the needed directories
45
48
 
46
- webgen create -t project -s andreas07 my_site
49
+ webgen create -b default -b andreas07 my_site
47
50
 
48
- This will create a webgen website in the directory `my_site` using the specified template and style.
51
+ This will create a webgen website in the directory `my_site` using the specified bundles.
49
52
 
50
53
  ### ... set configuration options?
51
54
 
@@ -176,7 +179,7 @@ There are many ways to accomplish this, I will show only one way here using bloc
176
179
  following to the sidebar part in your `default.template` (ensure that you haven't disabled `erb` in
177
180
  the processing pipeline):
178
181
 
179
- <%% if node.node_info[:page].blocks.has_key?('sidebar') %>
182
+ <%% if context.node.node_info[:page].blocks.has_key?('sidebar') %>
180
183
  <webgen:block name='sidebar' />
181
184
  <%% end %>
182
185
 
@@ -208,8 +211,8 @@ having menu entries that point to the same page and links to external pages.
208
211
 
209
212
  ### ... use short menu title?
210
213
 
211
- You can use a special of the meta information `link_attrs` to achieve that. Just use the following
212
- in the meta information block of the page file for which you want a short menu title:
214
+ You can use the special meta information key `link_attrs` to achieve that. Just use the following in
215
+ the meta information block of the page file for which you want a short menu title:
213
216
 
214
217
  link_attrs:
215
218
  :link_text: Short title
@@ -21,21 +21,18 @@ The directory in which these directories are in is called the *website directory
21
21
 
22
22
  Don't worry too much about these directories since webgen is able to create the correct directory
23
23
  structure for you. By running the command `webgen create sample_site`, the website directory
24
- `sample_site` is created with the default website template and website style. You can naturally use
25
- any available template or style by passing their names to the respective options of the `create`
26
- command.
27
-
28
- > A *website template* provides a starting point for your website. For example, the `project`
29
- > template defines several pages including a features and about page.
30
- >
31
- > A *website style* defines the look and feel of your website. webgen comes with many predefined
32
- > styles (nearly all of them are converted open source web design styles).
24
+ `sample_site` is created with the default website bundles applied. You can naturally use any
25
+ available bundles by passing their names to the `-b` option of the `create` command.
26
+
27
+ > A *website bundle* defines some starting content for a website. The `default` bundle defines just
28
+ > a sample content file sothat some output can be viewed after webgen is run. All other bundles are
29
+ > style bundles which define the look and feel of your website. webgen comes with many predefined
30
+ > style bundles and nearly all of them are converted open source web design styles.
33
31
  {.information}
34
32
 
35
- Don't worry if you don't like the used website style - you can easily change it later. Have a look
36
- at [the examples section](0.4.x/examples/website_styles/index.html) (note: these are still the
37
- example from the previous version of webgen but the styles haven't changed) to see demonstrations
38
- for all shipped website templates and styles!
33
+ Don't worry if you don't like the used website style - you can easily change it later using the
34
+ `webgen apply` command. Have a look at the [Website Styles Reference]({relocatable:
35
+ reference_website_styles.html}) to see demonstrations for all shipped website templates and styles!
39
36
 
40
37
  Since the basic parts are now in place, you can generate the HTML files. There are two
41
38
  possibilities:
@@ -47,11 +44,11 @@ possibilities:
47
44
 
48
45
  Easy! webgen has used all files in the `src` directory and created the HTML output in the directory
49
46
  `out`. Now you just need to open the `out/index.html` file to view your website! However, as we did
50
- not write any content yet, there is not much to see (only the default pages). So let's do that now!
47
+ not write any content yet, there is not much to see (only the default page). So let's do that now!
51
48
 
52
49
  > Since webgen automatically creates relative links, you will have a fully functional website
53
50
  > without needing a web server! This also implies that you can deploy your website to any directory
54
- > on your web server and it will just work!
51
+ > on your web server and it will *just work*!
55
52
  {.information}
56
53
 
57
54