webgen 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. data/ChangeLog +870 -0
  2. data/Rakefile +37 -36
  3. data/VERSION +1 -1
  4. data/data/webgen/resources.yaml +2 -2
  5. data/data/webgen/webgui/app.rb +11 -0
  6. data/data/webgen/webgui/controller/main.rb +30 -26
  7. data/data/webgen/webgui/{view/page.xhtml → layout/default.xhtml} +8 -8
  8. data/data/webgen/webgui/start.rb +9 -0
  9. data/data/webgen/webgui/view/create_website.xhtml +6 -14
  10. data/data/webgen/webgui/view/manage_website.xhtml +2 -2
  11. data/data/webgen/website_bundles/default/README +6 -0
  12. data/data/webgen/website_bundles/default/src/index.page +15 -0
  13. data/data/webgen/{website_styles → website_bundles/style}/1024px/README +0 -0
  14. data/data/webgen/{website_styles → website_bundles/style}/1024px/src/default.css +0 -0
  15. data/data/webgen/{website_styles → website_bundles/style}/1024px/src/default.template +0 -0
  16. data/data/webgen/{website_styles → website_bundles/style}/1024px/src/images/background.gif +0 -0
  17. data/data/webgen/{website_styles → website_bundles/style}/andreas00/README +0 -0
  18. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/default.css +0 -0
  19. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/default.template +0 -0
  20. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/bg.gif +0 -0
  21. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/front.jpg +0 -0
  22. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/menubg.gif +0 -0
  23. data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/menubg2.gif +0 -0
  24. data/data/webgen/{website_styles → website_bundles/style}/andreas01/README +0 -0
  25. data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/default.css +0 -0
  26. data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/default.template +0 -0
  27. data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/images/bg.gif +0 -0
  28. data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/images/front.jpg +0 -0
  29. data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/print.css +0 -0
  30. data/data/webgen/{website_styles → website_bundles/style}/andreas03/README +0 -0
  31. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/default.css +0 -0
  32. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/default.template +0 -0
  33. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/bodybg.png +0 -0
  34. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/contbg.png +0 -0
  35. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/footerbg.png +0 -0
  36. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/gradient1.png +0 -0
  37. data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/gradient2.png +0 -0
  38. data/data/webgen/{website_styles → website_bundles/style}/andreas04/README +0 -0
  39. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/default.css +0 -0
  40. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/default.template +0 -0
  41. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/blinkarrow.gif +0 -0
  42. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/bodybg.png +0 -0
  43. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/contentbg.png +0 -0
  44. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/entrybg.png +0 -0
  45. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/flash.gif +0 -0
  46. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/flash2.gif +0 -0
  47. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/globe.gif +0 -0
  48. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/globebottom.gif +0 -0
  49. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/linkarrow.gif +0 -0
  50. data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/menuhover.png +0 -0
  51. data/data/webgen/{website_styles → website_bundles/style}/andreas05/README +0 -0
  52. data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/default.css +0 -0
  53. data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/default.template +0 -0
  54. data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/images/bodybg.gif +0 -0
  55. data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/images/front.png +0 -0
  56. data/data/webgen/{website_styles → website_bundles/style}/andreas06/README +0 -0
  57. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/default.css +6 -4
  58. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/default.template +2 -2
  59. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/bodybg.gif +0 -0
  60. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/boxbg.gif +0 -0
  61. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/greypx.gif +0 -0
  62. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/header.jpg +0 -0
  63. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/innerbg.gif +0 -0
  64. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/leaves.jpg +0 -0
  65. data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/tabs.gif +0 -0
  66. data/data/webgen/{website_styles → website_bundles/style}/andreas07/README +0 -0
  67. data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/browserfix.css +0 -0
  68. data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/default.css +0 -0
  69. data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/default.template +0 -0
  70. data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/images/bodybg.gif +0 -0
  71. data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/images/sidebarbg.gif +0 -0
  72. data/data/webgen/{website_styles → website_bundles/style}/andreas08/README +0 -0
  73. data/data/webgen/{website_styles → website_bundles/style}/andreas08/src/default.css +0 -0
  74. data/data/webgen/{website_styles → website_bundles/style}/andreas08/src/default.template +0 -0
  75. data/data/webgen/{website_styles → website_bundles/style}/andreas09/README +0 -0
  76. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/default.css +0 -0
  77. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/default.template +0 -0
  78. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-black.jpg +0 -0
  79. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-green.jpg +0 -0
  80. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-orange.jpg +0 -0
  81. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-purple.jpg +0 -0
  82. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-red.jpg +0 -0
  83. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg.jpg +0 -0
  84. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/footerbg.jpg +0 -0
  85. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-black.jpg +0 -0
  86. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-green.jpg +0 -0
  87. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-orange.jpg +0 -0
  88. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-purple.jpg +0 -0
  89. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-red.jpg +0 -0
  90. data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover.jpg +0 -0
  91. data/data/webgen/{website_styles → website_bundles/style}/simple/README +0 -0
  92. data/data/webgen/{website_styles → website_bundles/style}/simple/src/default.css +0 -0
  93. data/data/webgen/{website_styles → website_bundles/style}/simple/src/default.template +0 -0
  94. data/data/webgen/website_skeleton/README +1 -1
  95. data/data/webgen/website_skeleton/config.yaml +5 -4
  96. data/doc/contentprocessor/blocks.page +43 -10
  97. data/doc/contentprocessor/builder.page +1 -1
  98. data/doc/contentprocessor/erb.page +12 -11
  99. data/doc/contentprocessor/redcloth.page +3 -1
  100. data/doc/extensions.page +3 -3
  101. data/doc/faq.page +13 -10
  102. data/doc/getting_started.page +12 -15
  103. data/doc/index.page +7 -1
  104. data/doc/manual.page +78 -27
  105. data/doc/reference_configuration.page +166 -3
  106. data/doc/reference_website_styles.page +28 -0
  107. data/doc/source/filesystem.page +39 -0
  108. data/doc/source/tararchive.page +40 -0
  109. data/doc/tag/tikz.page +2 -1
  110. data/doc/webgen_page_format.page +13 -12
  111. data/doc/website_styles.metainfo +8 -0
  112. data/lib/webgen/blackboard.rb +2 -2
  113. data/lib/webgen/cache.rb +4 -4
  114. data/lib/webgen/cli.rb +29 -16
  115. data/lib/webgen/cli/apply_command.rb +66 -0
  116. data/lib/webgen/cli/create_command.rb +22 -16
  117. data/lib/webgen/cli/utils.rb +23 -0
  118. data/lib/webgen/cli/webgui_command.rb +31 -16
  119. data/lib/webgen/configuration.rb +8 -6
  120. data/lib/webgen/contentprocessor.rb +4 -5
  121. data/lib/webgen/contentprocessor/blocks.rb +2 -0
  122. data/lib/webgen/contentprocessor/builder.rb +6 -3
  123. data/lib/webgen/contentprocessor/erb.rb +6 -3
  124. data/lib/webgen/contentprocessor/erubis.rb +7 -6
  125. data/lib/webgen/contentprocessor/haml.rb +6 -3
  126. data/lib/webgen/contentprocessor/rdoc.rb +0 -1
  127. data/lib/webgen/contentprocessor/redcloth.rb +3 -1
  128. data/lib/webgen/context.rb +73 -0
  129. data/lib/webgen/context/nodes.rb +36 -0
  130. data/lib/webgen/coreext.rb +3 -2
  131. data/lib/webgen/default_config.rb +3 -1
  132. data/lib/webgen/deprecated.rb +53 -0
  133. data/lib/webgen/node.rb +24 -19
  134. data/lib/webgen/output.rb +50 -7
  135. data/lib/webgen/page.rb +45 -36
  136. data/lib/webgen/path.rb +1 -1
  137. data/lib/webgen/source.rb +32 -4
  138. data/lib/webgen/source/resource.rb +3 -3
  139. data/lib/webgen/source/stacked.rb +1 -1
  140. data/lib/webgen/source/tararchive.rb +73 -0
  141. data/lib/webgen/sourcehandler.rb +4 -4
  142. data/lib/webgen/sourcehandler/base.rb +36 -24
  143. data/lib/webgen/sourcehandler/copy.rb +1 -1
  144. data/lib/webgen/sourcehandler/feed.rb +2 -2
  145. data/lib/webgen/sourcehandler/fragment.rb +1 -1
  146. data/lib/webgen/sourcehandler/metainfo.rb +15 -6
  147. data/lib/webgen/sourcehandler/page.rb +9 -5
  148. data/lib/webgen/sourcehandler/virtual.rb +44 -7
  149. data/lib/webgen/tag/base.rb +19 -13
  150. data/lib/webgen/tag/link.rb +1 -0
  151. data/lib/webgen/version.rb +1 -1
  152. data/lib/webgen/webgentask.rb +15 -13
  153. data/lib/webgen/website.rb +42 -11
  154. data/lib/webgen/websiteaccess.rb +1 -1
  155. data/lib/webgen/websitemanager.rb +61 -66
  156. data/man/man1/webgen.1 +4 -0
  157. data/misc/default.css +13 -0
  158. data/misc/default.template +1 -1
  159. data/misc/htmldoc.metainfo +2 -1
  160. data/misc/style.page +33 -0
  161. data/test/test_cli.rb +1 -7
  162. data/test/test_common_sitemap.rb +2 -2
  163. data/test/test_contentprocessor_blocks.rb +14 -1
  164. data/test/test_contentprocessor_builder.rb +3 -1
  165. data/test/test_contentprocessor_erb.rb +3 -2
  166. data/test/test_contentprocessor_erubis.rb +3 -3
  167. data/test/test_contentprocessor_fragments.rb +3 -3
  168. data/test/test_contentprocessor_haml.rb +3 -2
  169. data/test/test_contentprocessor_maruku.rb +3 -3
  170. data/test/test_contentprocessor_rdiscount.rb +1 -1
  171. data/test/test_contentprocessor_rdoc.rb +1 -1
  172. data/test/test_contentprocessor_redcloth.rb +9 -2
  173. data/test/test_contentprocessor_sass.rb +1 -1
  174. data/test/test_contentprocessor_tags.rb +1 -1
  175. data/test/{test_contentprocessor_context.rb → test_context.rb} +9 -7
  176. data/test/test_node.rb +27 -21
  177. data/test/test_page.rb +4 -4
  178. data/test/test_source_tararchive.rb +65 -0
  179. data/test/test_sourcehandler_fragment.rb +1 -1
  180. data/test/test_sourcehandler_memory.rb +6 -6
  181. data/test/test_sourcehandler_metainfo.rb +34 -13
  182. data/test/test_sourcehandler_page.rb +8 -0
  183. data/test/test_sourcehandler_virtual.rb +51 -12
  184. data/test/test_tag_breadcrumbtrail.rb +4 -4
  185. data/test/test_tag_coderay.rb +1 -1
  186. data/test/test_tag_date.rb +1 -1
  187. data/test/test_tag_executecommand.rb +1 -1
  188. data/test/test_tag_includefile.rb +3 -3
  189. data/test/test_tag_langbar.rb +6 -6
  190. data/test/test_tag_link.rb +8 -2
  191. data/test/test_tag_menu.rb +9 -9
  192. data/test/test_tag_metainfo.rb +1 -1
  193. data/test/test_tag_relocatable.rb +1 -1
  194. data/test/test_tag_sitemap.rb +1 -1
  195. data/test/test_tag_tikz.rb +2 -2
  196. data/test/test_website.rb +17 -0
  197. data/test/test_websitemanager.rb +16 -21
  198. metadata +146 -187
  199. data/data/webgen/website_templates/default/README +0 -6
  200. data/data/webgen/website_templates/default/src/index.page +0 -8
  201. data/data/webgen/website_templates/project/README +0 -5
  202. data/data/webgen/website_templates/project/src/about.page +0 -12
  203. data/data/webgen/website_templates/project/src/download.page +0 -15
  204. data/data/webgen/website_templates/project/src/features.page +0 -8
  205. data/data/webgen/website_templates/project/src/index.page +0 -9
  206. data/data/webgen/website_templates/project/src/screenshots.page +0 -18
  207. 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/
@@ -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
  %>
@@ -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
 
@@ -7,7 +7,9 @@ This documentation is for the *repository version*{: style='color: red; font-wei
7
7
  webgen and therefore may state features that are not available in the latest released version.
8
8
 
9
9
  * The documentation for the *latest released 0.5.x*{: style='color: red; font-weight: bold'} version
10
- can be found [here](http://webgen.rubyforge.org/documentation/0.5.x/index.html)
10
+ can be found [here](http://webgen.rubyforge.org/documentation/0.5.x/index.html). This
11
+ documentation can also be generated locally by running `rake htmldoc` in the root directory of the
12
+ weben distribution.
11
13
 
12
14
  * If you are looking for the documentation of the *0.4.x*{: style='color: red; font-weight: bold'}
13
15
  series, it can be found [here](http://webgen.rubyforge.org/documentation/0.4.x/index.html).
@@ -58,6 +60,10 @@ Following is a list of all the reference documentation of webgen:
58
60
  * [**Configuration Options Reference**]({relocatable: reference_configuration.html}): Overview of all
59
61
  configuration options.
60
62
 
63
+ * [**Website Styles Reference**]({relocatable: reference_website_styles.html}): Previews of all
64
+ website styles that ship with webgen.
65
+
66
+
61
67
  # Developer Documentation
62
68
 
63
69
  webgen makes it easy to extend its functionality by writing simple extension classes. All
@@ -12,7 +12,7 @@ webgen website is structured and how content can be added and so on.
12
12
 
13
13
 
14
14
 
15
- # The `webgen` command
15
+ # The `webgen` command {#cli}
16
16
 
17
17
  The executable for webgen is called... webgen ;-) It uses a command style syntax (like Subversion's
18
18
  `svn` or Rubygem's `gem` commands) through the [cmdparse] library. To get an overview of the
@@ -20,7 +20,8 @@ possible commands run `webgen help`.
20
20
 
21
21
  The main command is the `render` command which does the actual website generation. This command uses
22
22
  either the environment variable `WEBGEN_WEBSITE` (if it is set and non-empty) or the current working
23
- directory as website directory if none was specified via the gloabl `-d` option.
23
+ directory as website directory if none was specified via the gloabl `-d` option. All other commands
24
+ that need a valid webgen website directory specified work in the same way.
24
25
 
25
26
  You can invoke a command by specifying its name after the executable name. Also counting the
26
27
  executable `webgen` as a command, the options for a command are specified directly after the command
@@ -35,10 +36,29 @@ valid:
35
36
 
36
37
  Following is a short overview of the available commands:
37
38
 
38
- * `create [-t TEMPLATE] [-s STYLE] SITE_DIR`
39
+ * `apply [-f] (BUNDLE_NAME|BUNDLE_URL)`
39
40
 
40
- Creates a basic webgen website in `SITE_DIR` using the optional template and styles. All
41
- available templates and styles are listed in the help output for the command.
41
+ The argument may either be a valid bundle name or an URL to a bundle archive (a (gzipped) tar
42
+ archive). The command applies the bundle to the given webgen website. The files that will be
43
+ written to website directory are shown and the user is asked to confirm that the shown files
44
+ should indeed be written (and sometimes overwritten). If the `-f` option is used, the files are
45
+ always written.
46
+
47
+ You can get the full list of available bundle names by running `webgen help apply`!
48
+
49
+ * `create [-b BUNDLE] SITE_DIR`
50
+
51
+ Creates a basic webgen website in `SITE_DIR` using the optionally specified bundles. The option
52
+ `-b` can be used more than once to specify more than one bundle - the bundles are applied in the
53
+ order they are specified. As with the `apply` command, `BUNDLE` may either be a valid bundle
54
+ name or a bundle URL.
55
+
56
+ > If you don't specify the `-b` option, the default value is used which applies the `default`
57
+ > and the `style-andreas07` bundles. The former only creates a simple `src/index.page` sothat
58
+ > some output can be seen and the latter applies a nice layout.
59
+ {.information}
60
+
61
+ All available bundles are listed in the help output for the command.
42
62
 
43
63
  * `help`
44
64
 
@@ -74,11 +94,11 @@ files and directories under this directory:
74
94
 
75
95
  * `src`: The source directory in which all the source files for the website are. If this directory
76
96
  should not be called `src` or you want to include additional source directories, you need to
77
- change the `sources` configuration option.
97
+ change the [`sources` configuration option]({relocatable: reference_configuration.html#sources}).
78
98
 
79
99
  * `out`: This directory is created, if it does not exist, when webgen generates the HTML files. All
80
100
  the output files are put into this directory. The name of this directory can be changed by setting
81
- the `output` configuration option.
101
+ the [`output` configuration option]({relocatable: reference_configuration.html#output}).
82
102
 
83
103
  * `ext`: The extension directory (optional). You can put self-written extensions into this directory
84
104
  so that they are used by webgen. See the [extension directory]({relocatable: '#website-ext'})
@@ -224,9 +244,10 @@ SourceHandler::Template as they are responsible for handling these page and temp
224
244
  You can naturally use any other type of file. However, be aware that some files may not be processed
225
245
  by webgen when no source handler class for them exists. For example, there is currently no source
226
246
  handler class for `.svg` files, so those files would be ignored. If you just want to have files
227
- copied from a source to the output directory (like images or CSS files), the SourceHandler::Copy
228
- class is what you need! Look through the documentation of the [availabe source handler
229
- classes]({relocatable: extensions.html}) to get a feeling of what files are handled by webgen.
247
+ copied from a source to the output directory (like images or CSS files), the
248
+ [SourceHandler::Copy]({relocatable: sourcehandler/copy.html}) class is what you need! Look through
249
+ the documentation of the [availabe source handler classes]({relocatable: extensions.html}) to get a
250
+ feeling of what files are handled by webgen.
230
251
 
231
252
 
232
253
  ## Source Paths Naming Convention {#source-naming}
@@ -289,25 +310,50 @@ the same canonical name.
289
310
  ## Canonical Name of a File ### {#source-cn}
290
311
 
291
312
  webgen provides the functionality to define the same content in more than one language, ie. to
292
- localize content. This is achieved with the _canonical name_ of a path.
313
+ localize content. This is achieved with the _canonical name_ of a path, short CN.
293
314
 
294
315
  When multiple paths share the same canonical name, webgen assumes that they have the same content
295
- but in different languages. It is also possible to specify a _language independent_ path which is
296
- used as a fallback. Therefore when a path should be resolved using a canonical name and a given
297
- language, it is first tried to get the path in the requested language. If this is not possible
298
- (ie. no such localization exists), the unlocalized path is returned if it exists.
316
+ but in different languages. It is also possible to specify a _language independent_ path (i.e. one
317
+ without a language) which is used as a fallback. Therefore when a path should be resolved using a
318
+ canonical name and a given language, it is first tried to get the path in the requested language. If
319
+ this is not possible (ie. no such localization exists), the unlocalized path is returned if it
320
+ exists.
321
+
322
+ For example, assume that we have the following `src` directory:
323
+
324
+ /test.jpg
325
+ /images/my.jpg
326
+ /images/my.de.jpg
327
+ /index.page
328
+ /index.fr.page
329
+ /index.de.page
330
+
331
+ Since the path `images/my.jpg` has no language part, it is assumed to be unlocalized. In contrast,
332
+ `images/my.de.jpg` has the "same" picture but in a German version. So, when specifying
333
+ `images/my.jpg` in `index.de.page`, the correct localized version will be returned, i.e.
334
+ `images/my.de.jpg`. When specifying `images/my.jpg` in `index.page` or in `index.fr.page`, the
335
+ unlocalized version will be returned since no localized version exists.
299
336
 
300
337
  > Directories and fragments are never localized, only files are!
301
338
  {.important}
302
339
 
303
- It is also possible to use the _localized canonical name_ of a path to resolve it. The localized
304
- canonical name is the same as the canonical name but with a language code inserted before the
305
- extension. If the localized canonical name is used to resolve a path, a possibly additionally
340
+ It is also possible to use the _localized canonical name_ of a path (short: LCN) to resolve it. The
341
+ localized canonical name is the same as the canonical name but with a language code inserted before
342
+ the extension. If the localized canonical name is used to resolve a path, a possibly additionally
306
343
  specified language is ignored as it is assumed that the user really only wants the path in the
307
344
  specified language!
308
345
 
309
- This also means that all paths are not resolved using their real source or output names but using
310
- the (localized) canonical name! This is different from previous webgen versions!
346
+ Continuing the above example, this means that `images/my.de.jpg` is always returned when one
347
+ specifies `images/my.de.jpg` in any of the index page files, e.g. in `index.fr.page`.
348
+
349
+ Both canonical and localized canonical names can be absolute (ACN and ALCN) which is done by using
350
+ the full path starting with a slash. This is especially useful when you don't exactly know in which
351
+ hierarchy level a certain canoncial name gets evaluated.
352
+
353
+ Everything said above also means that all paths are not resolved using their real source or output
354
+ names but using the (localized) canonical name! So when specifying paths for extensions, for example
355
+ when using the [relocatable tag]({relocatable: tag/relocatable.html}), you always have to use the
356
+ (absolute) (localized) canonical names. This is different from previous webgen versions!
311
357
 
312
358
 
313
359
  ## Output Path Name Construction ### {#source-output}
@@ -417,14 +463,17 @@ Here are some example path patterns:
417
463
 
418
464
  Following is the list of rules how source files are handled by webgen:
419
465
 
420
- * All path names of all sources specified in the configuration option `sources` are fetched. Prior
421
- listed sources have priority over later listed sources if both specify the same path.
466
+ * All path names of all sources specified in the configuration option [`sources`]({relocatable:
467
+ reference_configuration.html#sources}) are fetched. Prior listed sources have priority over later
468
+ listed sources if both specify the same path.
422
469
 
423
- * Those paths which match a pattern of the configuration option `sourcehandler.ignore` are excluded.
470
+ * Those paths which match a pattern of the configuration option
471
+ [`sourcehandler.ignore`]({relocatable: reference_configuration.html#sourcehandlerignore}) are excluded.
424
472
 
425
473
  * The source handler classes are invoked according to the invocation order specified in
426
- `sourcehandler.invoke` and they use only those paths that match one of their path patterns
427
- specified in `sourcehandler.patterns`.
474
+ [`sourcehandler.invoke`]({relocatable: reference_configuration.html#sourcehandlerinvoke}) and
475
+ they use only those paths that match one of their path patterns specified in
476
+ [`sourcehandler.patterns`]({relocatable: reference_configuration.html#sourcehandlerpatterns}).
428
477
 
429
478
  As you might have deduced from the processing list above, it is possible that one path is handled by
430
479
  multiple source handlers. This can be used, for example, to render an XML file as HTML and copy it
@@ -438,13 +487,15 @@ example the title of the path, if it should appear in a menu and so on. This met
438
487
  specified in several ways, including:
439
488
 
440
489
  * Source handlers can provide default meta information for their handled paths (set using the
441
- configuration option `sourcehandler.default_meta_info`)
490
+ configuration option [`sourcehandler.default_meta_info`]({relocatable:
491
+ reference_configuration.html#sourcehandlerdefault_meta_info}).
442
492
 
443
493
  * Some file types allow meta information to be specified directly in the file, for example page
444
494
  files in [Webgen Page Format]({relocatable: webgen_page_format.html}).
445
495
 
446
496
  * Meta information can also be specified in special meta information backing files. These files are
447
- handled by the source handler SourceHandler::Metainfo.
497
+ handled by the source handler [SourceHandler::Metainfo]({relocatable:
498
+ sourcehandler/metainfo.html}).
448
499
 
449
500
  There is clearly defined order in which meta information is applied to a node for a path:
450
501