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.
- data/Rakefile +37 -36
- data/data/webgen/resources.yaml +2 -2
- data/data/webgen/webgui/app.rb +11 -0
- data/data/webgen/webgui/controller/main.rb +30 -26
- data/data/webgen/webgui/{view/page.xhtml → layout/default.xhtml} +8 -8
- data/data/webgen/webgui/start.rb +9 -0
- data/data/webgen/webgui/view/create_website.xhtml +6 -14
- data/data/webgen/webgui/view/manage_website.xhtml +2 -2
- data/data/webgen/website_bundles/default/README +6 -0
- data/data/webgen/website_bundles/default/src/index.page +15 -0
- data/data/webgen/{website_styles → website_bundles/style}/1024px/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/1024px/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/1024px/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/1024px/src/images/background.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/bg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/front.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/menubg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/menubg2.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/images/bg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/images/front.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/print.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/bodybg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/contbg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/footerbg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/gradient1.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/gradient2.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/blinkarrow.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/bodybg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/contentbg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/entrybg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/flash.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/flash2.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/globe.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/globebottom.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/linkarrow.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/menuhover.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas05/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/images/bodybg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/images/front.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/default.css +6 -4
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/default.template +2 -2
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/bodybg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/boxbg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/greypx.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/header.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/innerbg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/leaves.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/tabs.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/browserfix.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/images/bodybg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/images/sidebarbg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas08/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas08/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas08/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-black.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-green.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-orange.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-purple.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-red.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/footerbg.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-black.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-green.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-orange.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-purple.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-red.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/simple/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/simple/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/simple/src/default.template +0 -0
- data/data/webgen/website_skeleton/README +1 -1
- data/data/webgen/website_skeleton/config.yaml +5 -4
- data/doc/contentprocessor/blocks.page +43 -10
- data/doc/contentprocessor/builder.page +1 -1
- data/doc/contentprocessor/erb.page +12 -11
- data/doc/contentprocessor/redcloth.page +3 -1
- data/doc/extensions.page +3 -3
- data/doc/faq.page +13 -10
- data/doc/getting_started.page +12 -15
- data/doc/index.page +7 -1
- data/doc/manual.page +78 -27
- data/doc/reference_configuration.page +166 -3
- data/doc/reference_website_styles.page +28 -0
- data/doc/source/filesystem.page +39 -0
- data/doc/source/tararchive.page +40 -0
- data/doc/tag/tikz.page +2 -1
- data/doc/webgen_page_format.page +13 -12
- data/doc/website_styles.metainfo +8 -0
- data/lib/webgen/blackboard.rb +2 -2
- data/lib/webgen/cache.rb +4 -4
- data/lib/webgen/cli.rb +29 -16
- data/lib/webgen/cli/apply_command.rb +66 -0
- data/lib/webgen/cli/create_command.rb +22 -16
- data/lib/webgen/cli/utils.rb +23 -0
- data/lib/webgen/cli/webgui_command.rb +31 -16
- data/lib/webgen/configuration.rb +8 -6
- data/lib/webgen/contentprocessor.rb +4 -5
- data/lib/webgen/contentprocessor/blocks.rb +2 -0
- data/lib/webgen/contentprocessor/builder.rb +6 -3
- data/lib/webgen/contentprocessor/erb.rb +6 -3
- data/lib/webgen/contentprocessor/erubis.rb +7 -6
- data/lib/webgen/contentprocessor/haml.rb +6 -3
- data/lib/webgen/contentprocessor/rdoc.rb +0 -1
- data/lib/webgen/contentprocessor/redcloth.rb +3 -1
- data/lib/webgen/context.rb +73 -0
- data/lib/webgen/context/nodes.rb +36 -0
- data/lib/webgen/coreext.rb +3 -2
- data/lib/webgen/default_config.rb +3 -1
- data/lib/webgen/deprecated.rb +53 -0
- data/lib/webgen/node.rb +24 -19
- data/lib/webgen/output.rb +50 -7
- data/lib/webgen/page.rb +45 -36
- data/lib/webgen/path.rb +1 -1
- data/lib/webgen/source.rb +32 -4
- data/lib/webgen/source/resource.rb +3 -3
- data/lib/webgen/source/stacked.rb +1 -1
- data/lib/webgen/source/tararchive.rb +73 -0
- data/lib/webgen/sourcehandler.rb +4 -4
- data/lib/webgen/sourcehandler/base.rb +36 -24
- data/lib/webgen/sourcehandler/copy.rb +1 -1
- data/lib/webgen/sourcehandler/feed.rb +2 -2
- data/lib/webgen/sourcehandler/fragment.rb +1 -1
- data/lib/webgen/sourcehandler/metainfo.rb +15 -6
- data/lib/webgen/sourcehandler/page.rb +9 -5
- data/lib/webgen/sourcehandler/virtual.rb +44 -7
- data/lib/webgen/tag/base.rb +19 -13
- data/lib/webgen/tag/link.rb +1 -0
- data/lib/webgen/version.rb +1 -1
- data/lib/webgen/webgentask.rb +15 -13
- data/lib/webgen/website.rb +42 -11
- data/lib/webgen/websiteaccess.rb +1 -1
- data/lib/webgen/websitemanager.rb +61 -66
- data/man/man1/webgen.1 +4 -0
- data/misc/default.css +13 -0
- data/misc/default.template +1 -1
- data/misc/htmldoc.metainfo +2 -1
- data/misc/style.page +33 -0
- data/test/test_cli.rb +1 -7
- data/test/test_common_sitemap.rb +2 -2
- data/test/test_contentprocessor_blocks.rb +14 -1
- data/test/test_contentprocessor_builder.rb +3 -1
- data/test/test_contentprocessor_erb.rb +3 -2
- data/test/test_contentprocessor_erubis.rb +3 -3
- data/test/test_contentprocessor_fragments.rb +3 -3
- data/test/test_contentprocessor_haml.rb +3 -2
- data/test/test_contentprocessor_maruku.rb +3 -3
- data/test/test_contentprocessor_rdiscount.rb +1 -1
- data/test/test_contentprocessor_rdoc.rb +1 -1
- data/test/test_contentprocessor_redcloth.rb +9 -2
- data/test/test_contentprocessor_sass.rb +1 -1
- data/test/test_contentprocessor_tags.rb +1 -1
- data/test/{test_contentprocessor_context.rb → test_context.rb} +9 -7
- data/test/test_node.rb +27 -21
- data/test/test_page.rb +4 -4
- data/test/test_source_tararchive.rb +65 -0
- data/test/test_sourcehandler_fragment.rb +1 -1
- data/test/test_sourcehandler_memory.rb +6 -6
- data/test/test_sourcehandler_metainfo.rb +34 -13
- data/test/test_sourcehandler_page.rb +8 -0
- data/test/test_sourcehandler_virtual.rb +51 -12
- data/test/test_tag_breadcrumbtrail.rb +4 -4
- data/test/test_tag_coderay.rb +1 -1
- data/test/test_tag_date.rb +1 -1
- data/test/test_tag_executecommand.rb +1 -1
- data/test/test_tag_includefile.rb +3 -3
- data/test/test_tag_langbar.rb +6 -6
- data/test/test_tag_link.rb +8 -2
- data/test/test_tag_menu.rb +9 -9
- data/test/test_tag_metainfo.rb +1 -1
- data/test/test_tag_relocatable.rb +1 -1
- data/test/test_tag_sitemap.rb +1 -1
- data/test/test_tag_tikz.rb +2 -2
- data/test/test_website.rb +17 -0
- data/test/test_websitemanager.rb +16 -21
- metadata +181 -171
- data/data/webgen/website_templates/default/README +0 -6
- data/data/webgen/website_templates/default/src/index.page +0 -8
- data/data/webgen/website_templates/project/README +0 -5
- data/data/webgen/website_templates/project/src/about.page +0 -12
- data/data/webgen/website_templates/project/src/download.page +0 -15
- data/data/webgen/website_templates/project/src/features.page +0 -8
- data/data/webgen/website_templates/project/src/index.page +0 -9
- data/data/webgen/website_templates/project/src/screenshots.page +0 -18
- data/lib/webgen/contentprocessor/context.rb +0 -89
data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/contentbg.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/globebottom.gif
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/linkarrow.gif
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/menuhover.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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
|
-
|
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>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/images/sidebarbg.gif
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-black.jpg
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-green.jpg
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-orange.jpg
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-purple.jpg
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-red.jpg
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-black.jpg
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-green.jpg
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-orange.jpg
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-purple.jpg
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-red.jpg
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover.jpg
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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.
|
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
|
13
|
+
# configuration options as strings, integers, dates, arrays, hashes and more.
|
14
14
|
#
|
15
|
-
# The available configuration options can be
|
16
|
-
#
|
17
|
-
#
|
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.
|
18
|
-
|
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.
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
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
|
-
* `
|
13
|
-
|
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
|
-
* `
|
16
|
-
|
16
|
+
* `node` (or `content_node`): The node that gets currently rendered. Should be used for retrieving
|
17
|
+
meta information.
|
17
18
|
|
18
|
-
* `node
|
19
|
-
|
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
|
22
|
-
|
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.
|
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,
|
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
|
16
|
+
content and include the `sidebar` block in your `default.template`, like this:
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
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 -
|
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
|
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
|
212
|
-
|
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
|
data/doc/getting_started.page
CHANGED
@@ -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
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
>
|
29
|
-
>
|
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
|
36
|
-
|
37
|
-
|
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
|
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
|
|