gettalong-webgen 0.5.4.20080929
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS +5 -0
- data/COPYING +10 -0
- data/GPL +340 -0
- data/Rakefile +324 -0
- data/THANKS +17 -0
- data/bin/webgen +10 -0
- data/data/webgen/resources.yaml +3 -0
- data/data/webgen/webgui/controller/main.rb +129 -0
- data/data/webgen/webgui/overrides/win32console.rb +0 -0
- data/data/webgen/webgui/public/css/jquery.autocomplete.css +50 -0
- data/data/webgen/webgui/public/css/ramaze_error.css +90 -0
- data/data/webgen/webgui/public/css/style.css +55 -0
- data/data/webgen/webgui/public/img/headerbg.jpg +0 -0
- data/data/webgen/webgui/public/img/webgen_logo.png +0 -0
- data/data/webgen/webgui/public/js/jquery.autocomplete.js +15 -0
- data/data/webgen/webgui/public/js/jquery.js +32 -0
- data/data/webgen/webgui/view/create_website.xhtml +22 -0
- data/data/webgen/webgui/view/error.xhtml +64 -0
- data/data/webgen/webgui/view/index.xhtml +22 -0
- data/data/webgen/webgui/view/manage_website.xhtml +18 -0
- data/data/webgen/webgui/view/page.xhtml +40 -0
- data/data/webgen/website_skeleton/README +10 -0
- data/data/webgen/website_skeleton/Rakefile +40 -0
- data/data/webgen/website_skeleton/config.yaml +17 -0
- data/data/webgen/website_skeleton/ext/init.rb +6 -0
- data/data/webgen/website_styles/1024px/README +13 -0
- data/data/webgen/website_styles/1024px/src/default.css +188 -0
- data/data/webgen/website_styles/1024px/src/default.template +60 -0
- data/data/webgen/website_styles/1024px/src/images/background.gif +0 -0
- data/data/webgen/website_styles/andreas00/README +13 -0
- data/data/webgen/website_styles/andreas00/src/default.css +290 -0
- data/data/webgen/website_styles/andreas00/src/default.template +60 -0
- data/data/webgen/website_styles/andreas00/src/images/bg.gif +0 -0
- data/data/webgen/website_styles/andreas00/src/images/front.jpg +0 -0
- data/data/webgen/website_styles/andreas00/src/images/menubg.gif +0 -0
- data/data/webgen/website_styles/andreas00/src/images/menubg2.gif +0 -0
- data/data/webgen/website_styles/andreas01/README +14 -0
- data/data/webgen/website_styles/andreas01/src/default.css +310 -0
- data/data/webgen/website_styles/andreas01/src/default.template +61 -0
- data/data/webgen/website_styles/andreas01/src/images/bg.gif +0 -0
- data/data/webgen/website_styles/andreas01/src/images/front.jpg +0 -0
- data/data/webgen/website_styles/andreas01/src/print.css +35 -0
- data/data/webgen/website_styles/andreas03/README +14 -0
- data/data/webgen/website_styles/andreas03/src/default.css +223 -0
- data/data/webgen/website_styles/andreas03/src/default.template +58 -0
- data/data/webgen/website_styles/andreas03/src/images/bodybg.png +0 -0
- data/data/webgen/website_styles/andreas03/src/images/contbg.png +0 -0
- data/data/webgen/website_styles/andreas03/src/images/footerbg.png +0 -0
- data/data/webgen/website_styles/andreas03/src/images/gradient1.png +0 -0
- data/data/webgen/website_styles/andreas03/src/images/gradient2.png +0 -0
- data/data/webgen/website_styles/andreas04/README +15 -0
- data/data/webgen/website_styles/andreas04/src/default.css +290 -0
- data/data/webgen/website_styles/andreas04/src/default.template +81 -0
- data/data/webgen/website_styles/andreas04/src/images/blinkarrow.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/bodybg.png +0 -0
- data/data/webgen/website_styles/andreas04/src/images/contentbg.png +0 -0
- data/data/webgen/website_styles/andreas04/src/images/entrybg.png +0 -0
- data/data/webgen/website_styles/andreas04/src/images/flash.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/flash2.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/globe.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/globebottom.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/linkarrow.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/menuhover.png +0 -0
- data/data/webgen/website_styles/andreas05/README +14 -0
- data/data/webgen/website_styles/andreas05/src/default.css +33 -0
- data/data/webgen/website_styles/andreas05/src/default.template +40 -0
- data/data/webgen/website_styles/andreas05/src/images/bodybg.gif +0 -0
- data/data/webgen/website_styles/andreas05/src/images/front.png +0 -0
- data/data/webgen/website_styles/andreas06/README +14 -0
- data/data/webgen/website_styles/andreas06/src/default.css +354 -0
- data/data/webgen/website_styles/andreas06/src/default.template +70 -0
- data/data/webgen/website_styles/andreas06/src/images/bodybg.gif +0 -0
- data/data/webgen/website_styles/andreas06/src/images/boxbg.gif +0 -0
- data/data/webgen/website_styles/andreas06/src/images/greypx.gif +0 -0
- data/data/webgen/website_styles/andreas06/src/images/header.jpg +0 -0
- data/data/webgen/website_styles/andreas06/src/images/innerbg.gif +0 -0
- data/data/webgen/website_styles/andreas06/src/images/leaves.jpg +0 -0
- data/data/webgen/website_styles/andreas06/src/images/tabs.gif +0 -0
- data/data/webgen/website_styles/andreas07/README +15 -0
- data/data/webgen/website_styles/andreas07/src/browserfix.css +7 -0
- data/data/webgen/website_styles/andreas07/src/default.css +92 -0
- data/data/webgen/website_styles/andreas07/src/default.template +42 -0
- data/data/webgen/website_styles/andreas07/src/images/bodybg.gif +0 -0
- data/data/webgen/website_styles/andreas07/src/images/sidebarbg.gif +0 -0
- data/data/webgen/website_styles/andreas08/README +14 -0
- data/data/webgen/website_styles/andreas08/src/default.css +224 -0
- data/data/webgen/website_styles/andreas08/src/default.template +51 -0
- data/data/webgen/website_styles/andreas09/README +14 -0
- data/data/webgen/website_styles/andreas09/src/default.css +308 -0
- data/data/webgen/website_styles/andreas09/src/default.template +68 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg-black.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg-green.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg-orange.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg-purple.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg-red.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/footerbg.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover-black.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover-green.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover-orange.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover-purple.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover-red.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover.jpg +0 -0
- data/data/webgen/website_styles/simple/README +6 -0
- data/data/webgen/website_styles/simple/src/default.css +84 -0
- data/data/webgen/website_styles/simple/src/default.template +36 -0
- data/data/webgen/website_templates/default/README +6 -0
- data/data/webgen/website_templates/default/src/index.page +8 -0
- data/data/webgen/website_templates/project/README +5 -0
- data/data/webgen/website_templates/project/src/about.page +12 -0
- data/data/webgen/website_templates/project/src/download.page +15 -0
- data/data/webgen/website_templates/project/src/features.page +8 -0
- data/data/webgen/website_templates/project/src/index.page +9 -0
- data/data/webgen/website_templates/project/src/screenshots.page +18 -0
- data/doc/contentprocessor.template +11 -0
- data/doc/contentprocessor/blocks.page +66 -0
- data/doc/contentprocessor/builder.page +80 -0
- data/doc/contentprocessor/erb.page +56 -0
- data/doc/contentprocessor/erubis.page +46 -0
- data/doc/contentprocessor/haml.page +47 -0
- data/doc/contentprocessor/maruku.page +41 -0
- data/doc/contentprocessor/rdiscount.page +37 -0
- data/doc/contentprocessor/rdoc.page +36 -0
- data/doc/contentprocessor/redcloth.page +39 -0
- data/doc/contentprocessor/sass.page +31 -0
- data/doc/contentprocessor/tags.page +73 -0
- data/doc/extensions.metainfo +29 -0
- data/doc/extensions.page +16 -0
- data/doc/extensions.template +17 -0
- data/doc/faq.page +214 -0
- data/doc/getting_started.page +134 -0
- data/doc/index.page +65 -0
- data/doc/manual.page +532 -0
- data/doc/reference_configuration.page +646 -0
- data/doc/reference_metainfo.page +213 -0
- data/doc/sourcehandler.template +21 -0
- data/doc/sourcehandler/copy.page +19 -0
- data/doc/sourcehandler/directory.page +27 -0
- data/doc/sourcehandler/feed.page +82 -0
- data/doc/sourcehandler/metainfo.page +41 -0
- data/doc/sourcehandler/page.page +30 -0
- data/doc/sourcehandler/sitemap.page +46 -0
- data/doc/sourcehandler/template.page +45 -0
- data/doc/sourcehandler/virtual.page +49 -0
- data/doc/tag.template +25 -0
- data/doc/tag/breadcrumbtrail.page +40 -0
- data/doc/tag/coderay.page +49 -0
- data/doc/tag/date.page +31 -0
- data/doc/tag/executecommand.page +26 -0
- data/doc/tag/includefile.page +32 -0
- data/doc/tag/langbar.page +22 -0
- data/doc/tag/menu.page +92 -0
- data/doc/tag/metainfo.page +29 -0
- data/doc/tag/relocatable.page +38 -0
- data/doc/tag/sitemap.page +31 -0
- data/doc/upgrading.page +139 -0
- data/doc/webgen_page_format.page +128 -0
- data/lib/webgen/blackboard.rb +73 -0
- data/lib/webgen/cache.rb +85 -0
- data/lib/webgen/cli.rb +118 -0
- data/lib/webgen/cli/create_command.rb +64 -0
- data/lib/webgen/cli/run_command.rb +20 -0
- data/lib/webgen/cli/utils.rb +86 -0
- data/lib/webgen/cli/webgui_command.rb +49 -0
- data/lib/webgen/common.rb +10 -0
- data/lib/webgen/common/sitemap.rb +76 -0
- data/lib/webgen/configuration.rb +147 -0
- data/lib/webgen/contentprocessor.rb +96 -0
- data/lib/webgen/contentprocessor/blocks.rb +46 -0
- data/lib/webgen/contentprocessor/builder.rb +26 -0
- data/lib/webgen/contentprocessor/context.rb +90 -0
- data/lib/webgen/contentprocessor/erb.rb +24 -0
- data/lib/webgen/contentprocessor/erubis.rb +40 -0
- data/lib/webgen/contentprocessor/haml.rb +25 -0
- data/lib/webgen/contentprocessor/maruku.rb +18 -0
- data/lib/webgen/contentprocessor/rdiscount.rb +15 -0
- data/lib/webgen/contentprocessor/rdoc.rb +17 -0
- data/lib/webgen/contentprocessor/redcloth.rb +15 -0
- data/lib/webgen/contentprocessor/sass.rb +18 -0
- data/lib/webgen/contentprocessor/tags.rb +134 -0
- data/lib/webgen/coreext.rb +10 -0
- data/lib/webgen/default_config.rb +198 -0
- data/lib/webgen/languages.rb +578 -0
- data/lib/webgen/loggable.rb +23 -0
- data/lib/webgen/logger.rb +78 -0
- data/lib/webgen/node.rb +347 -0
- data/lib/webgen/output.rb +37 -0
- data/lib/webgen/output/filesystem.rb +67 -0
- data/lib/webgen/page.rb +133 -0
- data/lib/webgen/path.rb +182 -0
- data/lib/webgen/source.rb +24 -0
- data/lib/webgen/source/filesystem.rb +58 -0
- data/lib/webgen/source/resource.rb +42 -0
- data/lib/webgen/source/stacked.rb +53 -0
- data/lib/webgen/sourcehandler.rb +202 -0
- data/lib/webgen/sourcehandler/base.rb +211 -0
- data/lib/webgen/sourcehandler/copy.rb +41 -0
- data/lib/webgen/sourcehandler/directory.rb +31 -0
- data/lib/webgen/sourcehandler/feed.rb +121 -0
- data/lib/webgen/sourcehandler/fragment.rb +71 -0
- data/lib/webgen/sourcehandler/metainfo.rb +117 -0
- data/lib/webgen/sourcehandler/page.rb +77 -0
- data/lib/webgen/sourcehandler/sitemap.rb +60 -0
- data/lib/webgen/sourcehandler/template.rb +68 -0
- data/lib/webgen/sourcehandler/virtual.rb +75 -0
- data/lib/webgen/tag.rb +23 -0
- data/lib/webgen/tag/base.rb +162 -0
- data/lib/webgen/tag/breadcrumbtrail.rb +71 -0
- data/lib/webgen/tag/coderay.rb +32 -0
- data/lib/webgen/tag/date.rb +18 -0
- data/lib/webgen/tag/executecommand.rb +29 -0
- data/lib/webgen/tag/includefile.rb +42 -0
- data/lib/webgen/tag/langbar.rb +52 -0
- data/lib/webgen/tag/menu.rb +186 -0
- data/lib/webgen/tag/metainfo.rb +25 -0
- data/lib/webgen/tag/relocatable.rb +53 -0
- data/lib/webgen/tag/sitemap.rb +42 -0
- data/lib/webgen/tree.rb +80 -0
- data/lib/webgen/version.rb +6 -0
- data/lib/webgen/webgentask.rb +148 -0
- data/lib/webgen/website.rb +214 -0
- data/lib/webgen/websiteaccess.rb +29 -0
- data/lib/webgen/websitemanager.rb +125 -0
- data/man/man1/webgen.1 +67 -0
- data/misc/default.css +360 -0
- data/misc/default.template +75 -0
- data/misc/htmldoc.metainfo +25 -0
- data/misc/htmldoc.virtual +5 -0
- data/misc/images/arrow.gif +0 -0
- data/misc/images/error.gif +0 -0
- data/misc/images/exclamation.gif +0 -0
- data/misc/images/headerbg.jpg +0 -0
- data/misc/images/information.gif +0 -0
- data/misc/images/quote.gif +0 -0
- data/setup.rb +1585 -0
- data/test/helper.rb +41 -0
- data/test/test_blackboard.rb +58 -0
- data/test/test_cache.rb +57 -0
- data/test/test_common_sitemap.rb +56 -0
- data/test/test_configuration.rb +66 -0
- data/test/test_contentprocessor.rb +31 -0
- data/test/test_contentprocessor_blocks.rb +34 -0
- data/test/test_contentprocessor_builder.rb +19 -0
- data/test/test_contentprocessor_context.rb +38 -0
- data/test/test_contentprocessor_erb.rb +20 -0
- data/test/test_contentprocessor_erubis.rb +47 -0
- data/test/test_contentprocessor_haml.rb +20 -0
- data/test/test_contentprocessor_maruku.rb +27 -0
- data/test/test_contentprocessor_rdiscount.rb +15 -0
- data/test/test_contentprocessor_rdoc.rb +16 -0
- data/test/test_contentprocessor_redcloth.rb +12 -0
- data/test/test_contentprocessor_sass.rb +20 -0
- data/test/test_contentprocessor_tags.rb +97 -0
- data/test/test_languages.rb +53 -0
- data/test/test_loggable.rb +30 -0
- data/test/test_logger.rb +73 -0
- data/test/test_node.rb +339 -0
- data/test/test_output_filesystem.rb +58 -0
- data/test/test_page.rb +203 -0
- data/test/test_path.rb +131 -0
- data/test/test_source_filesystem.rb +59 -0
- data/test/test_source_resource.rb +26 -0
- data/test/test_source_stacked.rb +34 -0
- data/test/test_sourcehandler_base.rb +92 -0
- data/test/test_sourcehandler_copy.rb +45 -0
- data/test/test_sourcehandler_directory.rb +25 -0
- data/test/test_sourcehandler_feed.rb +74 -0
- data/test/test_sourcehandler_fragment.rb +67 -0
- data/test/test_sourcehandler_metainfo.rb +93 -0
- data/test/test_sourcehandler_page.rb +70 -0
- data/test/test_sourcehandler_sitemap.rb +47 -0
- data/test/test_sourcehandler_template.rb +63 -0
- data/test/test_sourcehandler_virtual.rb +56 -0
- data/test/test_tag_base.rb +82 -0
- data/test/test_tag_breadcrumbtrail.rb +89 -0
- data/test/test_tag_coderay.rb +30 -0
- data/test/test_tag_date.rb +16 -0
- data/test/test_tag_executecommand.rb +39 -0
- data/test/test_tag_includefile.rb +48 -0
- data/test/test_tag_langbar.rb +60 -0
- data/test/test_tag_menu.rb +195 -0
- data/test/test_tag_metainfo.rb +17 -0
- data/test/test_tag_relocatable.rb +57 -0
- data/test/test_tag_sitemap.rb +44 -0
- data/test/test_tree.rb +69 -0
- data/test/test_webgentask.rb +21 -0
- data/test/test_website.rb +96 -0
- data/test/test_websiteaccess.rb +23 -0
- data/test/test_websitemanager.rb +68 -0
- metadata +575 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::Tag::Relocatable
|
3
|
+
used_options:
|
4
|
+
- tag.relocatable.path
|
5
|
+
---
|
6
|
+
## Description
|
7
|
+
|
8
|
+
This tag ensures that the relative path to the specified path is always correct.
|
9
|
+
|
10
|
+
When the tag is used, it changes the directory part of the supplied path name to a relative path to
|
11
|
+
the destination and is most often used in template files. A relocatable tag looks like this:
|
12
|
+
`\{relocatable: default.css}`. If this was put into a template and the template was used by a file
|
13
|
+
in a subdirectory, then the `relocatable` tag would put `../default.css` into the output file; thus
|
14
|
+
ensuring that the relative path to file is valid.
|
15
|
+
|
16
|
+
> You can only use the `relocatable` tag with paths that are handled by webgen. If you want to
|
17
|
+
> handle paths that are not normally handled by webgen, create a virtual path for them.
|
18
|
+
{.exclamation}
|
19
|
+
|
20
|
+
If the specified path is an absolute URL (like `http://webgen.rubyforge.org`), it will just return
|
21
|
+
it. And if you specify an URL fragment, this fragment has to exist. If you don't want to resolve a
|
22
|
+
fragment, just don't specify it in the tag but afterwards!
|
23
|
+
|
24
|
+
## Examples
|
25
|
+
|
26
|
+
<table class="examples">
|
27
|
+
<tr>
|
28
|
+
<th>Usage</th><th>Output</th>
|
29
|
+
</tr>
|
30
|
+
<tr>
|
31
|
+
<td>\{relocatable: /default.css}</td>
|
32
|
+
<td>{relocatable: /default.css}</td>
|
33
|
+
</tr>
|
34
|
+
<tr>
|
35
|
+
<td>\{relocatable: ../}</td>
|
36
|
+
<td>{relocatable: ../}</td>
|
37
|
+
</tr>
|
38
|
+
</table>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::Tag::Sitemap
|
3
|
+
used_options:
|
4
|
+
- common.sitemap.honor_in_menu
|
5
|
+
- common.sitemap.any_lang
|
6
|
+
- common.sitemap.used_kinds
|
7
|
+
---
|
8
|
+
## Description
|
9
|
+
|
10
|
+
This tag is used to display a site map of the current website. The used nodes can be customized by
|
11
|
+
setting the above mentioned configuration options accordingly.
|
12
|
+
|
13
|
+
## Examples
|
14
|
+
|
15
|
+
<table class="examples">
|
16
|
+
<tr>
|
17
|
+
<th>Usage</th><th>Output</th>
|
18
|
+
</tr>
|
19
|
+
<tr>
|
20
|
+
<td>\{sitemap: }</td>
|
21
|
+
<td>{sitemap: }</td>
|
22
|
+
</tr>
|
23
|
+
<tr>
|
24
|
+
<td>\{sitemap: {honor_in_menu: true}}</td>
|
25
|
+
<td>{sitemap: {honor_in_menu: true}}</td>
|
26
|
+
</tr>
|
27
|
+
<tr>
|
28
|
+
<td>\{sitemap: {honor_in_menu: true, used_kinds: []}}</td>
|
29
|
+
<td>{sitemap: {honor_in_menu: true, used_kinds: []}}</td>
|
30
|
+
</tr>
|
31
|
+
</table>
|
data/doc/upgrading.page
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
---
|
2
|
+
title: Upgrading from 0.4.x
|
3
|
+
---
|
4
|
+
# Upgrading
|
5
|
+
|
6
|
+
Here are step-by-step instructions on how to update your webgen website from 0.4.x to 0.5.x:
|
7
|
+
|
8
|
+
* **Update the configuration file `config.yaml`**
|
9
|
+
|
10
|
+
The configuration file syntax as well as the names of the configuration options and some defaults
|
11
|
+
changed. For example, the default processing pipeline now uses Maruku (a Markdown converter) as
|
12
|
+
markup language processor instead of Textile. You can find an overview over all available
|
13
|
+
configuration options in the [configuration option reference]({relocatable:
|
14
|
+
reference_configuration.html}). Also have a look at the [configuration file
|
15
|
+
documentation]({relocatable: manual.html#website-configfile}) for more information on the syntax
|
16
|
+
of this file and the available helpers.
|
17
|
+
|
18
|
+
* Name changes: All configuration options now use underscores to separate word parts instead of
|
19
|
+
camelCase.
|
20
|
+
* Syntax changes: The configuration options are not specific to a certain extension anymore. You
|
21
|
+
now need the full configuration option name to specify it. So instead of
|
22
|
+
|
23
|
+
Tag/Menu:
|
24
|
+
maxLevels: 4
|
25
|
+
|
26
|
+
you now use
|
27
|
+
|
28
|
+
tag.menu.max_levels: 4
|
29
|
+
|
30
|
+
* **Convert your `metainfo.yaml`**
|
31
|
+
|
32
|
+
This file is not supported anymore since webgen 0.5.x uses a more flexible way for specifying meta
|
33
|
+
information and virtual paths. You need to migrate its data to `metainfo` and `virtual` files in
|
34
|
+
the source directory. Have a look at the documentation of the [metainfo source
|
35
|
+
handler]({relocatable: sourcehandler/metainfo.html}) and the [virtual source
|
36
|
+
handler]({relocatable: sourcehandler/virtual.html}).
|
37
|
+
|
38
|
+
* **Update meta information names and values**
|
39
|
+
|
40
|
+
The names of some meta information keys have been changed. Meta information names are not
|
41
|
+
specified in camelCase anymore but with under\_scores. You can find a complete list of supported
|
42
|
+
meta information names in the [meta information reference]({relocatable:
|
43
|
+
reference_metainfo.html}). The most notable changes are:
|
44
|
+
|
45
|
+
* directoryName → routed\_title
|
46
|
+
* inMenu → in\_menu
|
47
|
+
* indexFile → index\_path
|
48
|
+
* omitIndexPath → omit\_index\_path
|
49
|
+
* outputNameStyle → output\_path\_style
|
50
|
+
* orderInfo → sort\_info
|
51
|
+
|
52
|
+
Also be aware that the syntax of some meta information keys has changed. For example, all meta
|
53
|
+
information keys that took a source path name, e.g. `index_path`, now take an localized canonical
|
54
|
+
name.
|
55
|
+
|
56
|
+
You need to change the names/value in all places where meta information can be specified:
|
57
|
+
|
58
|
+
* `metainfo` files
|
59
|
+
* `virtual` files
|
60
|
+
* page and template files
|
61
|
+
|
62
|
+
* **Files in [Webgen Page Format]({relocatable: webgen_page_format.html})**
|
63
|
+
|
64
|
+
Since the format of these files changed a little bit you may need to adapt all your files that use
|
65
|
+
it, that are primarily page and template files. The main change in the format was a different use
|
66
|
+
of the block start line. Whereas before you would write
|
67
|
+
|
68
|
+
--- content, textile
|
69
|
+
|
70
|
+
for specifying the name of the block and its processor, you now can specify any number of
|
71
|
+
options. Two options are currently used by webgen: `name` and `pipeline`. So you could change the
|
72
|
+
name and the processing pipeline of a block by using a block start line like:
|
73
|
+
|
74
|
+
--- name:other pipeline:tags,maruku,blocks
|
75
|
+
|
76
|
+
* **Block inclusion in template/page files**
|
77
|
+
|
78
|
+
The way how named blocks are included has changed. This feature is now provided by the content
|
79
|
+
processor [blocks]({relocatable: contentprocessor/blocks.html}) instead of the tag `block`. This
|
80
|
+
allows you to specify the point in the processing pipeline when a block should be included. So you
|
81
|
+
definitely need to update your `default.template` file as well as any other page/template file
|
82
|
+
where you used the `block` tag.
|
83
|
+
|
84
|
+
So you need to look for `\{block: content}` tags (where `content` is just a place holder for the
|
85
|
+
name of the block that should be included) and replace them with `<webgen:block name='content'
|
86
|
+
/>`.
|
87
|
+
|
88
|
+
* **Update tag names and parameters**
|
89
|
+
|
90
|
+
Since the names of the configuration options changed (from using camelCase to using under\_scores)
|
91
|
+
and some tags have different options, you need to change all tag parameters. You may also need to
|
92
|
+
convert old tag names to new ones (same reason: camelCase to under\_score), for example,
|
93
|
+
`includeFile` is now `include_file`.
|
94
|
+
|
95
|
+
* **Update your ERB code**
|
96
|
+
|
97
|
+
If you have any ERB code in your template or page files you will most certainly have to adapt them
|
98
|
+
to the new [API]({relocatable: api.html}). One thing that has been used often is the check if a
|
99
|
+
page file has a certain block:
|
100
|
+
|
101
|
+
<%% if node.node_info[:page_data].blocks.has_key?('NAME') %>
|
102
|
+
...
|
103
|
+
<%% end %>
|
104
|
+
|
105
|
+
This needs to be changed into the following:
|
106
|
+
|
107
|
+
<%% if context.content_node.node_info[:page].blocks.has_key?('NAME') %>
|
108
|
+
...
|
109
|
+
<%% end %>
|
110
|
+
|
111
|
+
* **Extensions development**
|
112
|
+
|
113
|
+
Since the complete core of webgen has changed you need to rewrite all your plugins for the 0.5.x
|
114
|
+
series. Howver, webgen has complete [API documentation]({relocatable: api.html}) now which
|
115
|
+
provides you with all needed information as well as examples on how to implement source handlers,
|
116
|
+
tags, content processors, ... If you still have any questions, don't hesitate to contact me or
|
117
|
+
write a mail to the mailing list!
|
118
|
+
|
119
|
+
* **Running webgen on the converted website**
|
120
|
+
|
121
|
+
You now can run webgen 0.5.x on the converted website. This helps in ironing out the remaining
|
122
|
+
errors, for example:
|
123
|
+
|
124
|
+
* If you have forgotten to change a block start line, you will get an application error and the
|
125
|
+
name of the file where the error occured.
|
126
|
+
|
127
|
+
* If you have overlooked changing a tag parameter, you will find `ERROR` and `WARN` lines in the
|
128
|
+
log output showing you what still needs to be changed.
|
129
|
+
|
130
|
+
* **Not Implement Yet**: There are several features of the 0.4.x series which are currently not
|
131
|
+
implemented in the 0.5.x series:
|
132
|
+
|
133
|
+
* source handlers: gallery, sipttra
|
134
|
+
* tags: customvar (won't be ported), download, htmlmetainfo, news (won't be ported, superceded
|
135
|
+
by blogging support), resource, wikilink
|
136
|
+
* misc: smiley replacer, html validators
|
137
|
+
* CLI commands: check, show, use
|
138
|
+
|
139
|
+
If you need any of those you have to wait till they are implemented or port them on your on.
|
@@ -0,0 +1,128 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen Page Format
|
3
|
+
---
|
4
|
+
## Webgen Page Format
|
5
|
+
|
6
|
+
The Webgen Page Format is a custom format designed primarily for page and template files. It
|
7
|
+
consists of an optional meta information block and one or more blocks of data; it is very simple and
|
8
|
+
easy to use.
|
9
|
+
|
10
|
+
## Structure
|
11
|
+
|
12
|
+
A file using the Webgen Page Format consists of one or more blocks which are the smallest units
|
13
|
+
recongnized. Blocks are separated from each other through a line containing three dashes. This is
|
14
|
+
illustrated in the following examples which are all valid files in WebPage Format:
|
15
|
+
|
16
|
+
Example 1:
|
17
|
+
|
18
|
+
Here is a block!
|
19
|
+
|
20
|
+
Example 2:
|
21
|
+
|
22
|
+
This is one block of the file
|
23
|
+
---
|
24
|
+
This is another block.
|
25
|
+
|
26
|
+
Example 3:
|
27
|
+
|
28
|
+
Block 1
|
29
|
+
--- name:block2
|
30
|
+
Block 2
|
31
|
+
--- name:block3
|
32
|
+
Block 3...
|
33
|
+
|
34
|
+
If you want to use three dashes in a block but you don't want to end the block, you have to escape
|
35
|
+
them with a backslash character, like this:
|
36
|
+
|
37
|
+
Block 1
|
38
|
+
\---
|
39
|
+
still Block 1
|
40
|
+
--- name:block2
|
41
|
+
Block 2
|
42
|
+
|
43
|
+
All of the above examples show one kind of block, the content block. However, there may also be
|
44
|
+
another type of block: the meta information block. Following is a short description of both kinds,
|
45
|
+
starting with the meta information block.
|
46
|
+
|
47
|
+
|
48
|
+
### Meta Information Block
|
49
|
+
|
50
|
+
Each file in Webgen Page Format can have zero or one meta information blocks. This block is
|
51
|
+
specified at the beginning of the file. To tell the parser that the first block is the meta
|
52
|
+
information block and not a content block, you have to start the file with three dashes:
|
53
|
+
|
54
|
+
---
|
55
|
+
title: The title set by Meta info
|
56
|
+
---
|
57
|
+
This is the content of the file
|
58
|
+
|
59
|
+
The above defines a meta information block and a content block. The meta information block has to be
|
60
|
+
in YAML format and should contain key-value pairs of meta information. [YAML](http://www.yaml.org)
|
61
|
+
is a simple markup language designed for ease of use and although you define structured data with
|
62
|
+
it, it feels like just writing a plain text document.
|
63
|
+
|
64
|
+
|
65
|
+
### Content Blocks
|
66
|
+
|
67
|
+
A content block is used to provide content in a specific format. Each file in Webgen Page Format
|
68
|
+
needs to have at least one content block which may be empty. However, it can have as many content
|
69
|
+
blocks as necessary. Each content block needs to have a unique name and additional options can also
|
70
|
+
be set.
|
71
|
+
|
72
|
+
The name uniquely identifies a content block and is used to access it. The only option used by
|
73
|
+
webgen is the `pipeline` option which specifies the processing pipeline for the block. The
|
74
|
+
processing pipeline is used for rendering the block by using the specified content processors in the
|
75
|
+
specified order. There are many different content processors available - have a look at the
|
76
|
+
[extensions page]({relocatable: extensions.html}) for an overview.
|
77
|
+
|
78
|
+
There are also defaults for the name and the options of a block but they can be overwritten. You can
|
79
|
+
use one of two ways to do this:
|
80
|
+
|
81
|
+
* you either specify the name and additional options of the block on the starting line with the
|
82
|
+
three dashes
|
83
|
+
|
84
|
+
* or you use the special meta information `block` to define the names and options of one or all
|
85
|
+
blocks.
|
86
|
+
|
87
|
+
The following example uses the first technique to override the name and/or the `pipeline` option:
|
88
|
+
|
89
|
+
1. content block of the file
|
90
|
+
--- name:sidebar pipeline:maruku,tags
|
91
|
+
2. content block of the file
|
92
|
+
--- name:other
|
93
|
+
3. content block of the file
|
94
|
+
|
95
|
+
The first block has no identifieres set (there is no line with three dashes and the identifieres).
|
96
|
+
Therefore the default value for the name is used: `content`. The second block is named `sidebar` and
|
97
|
+
uses the processing pipeline `maruku,tags`. As you can see, the name of a block as well as
|
98
|
+
additional options are specified by stating the key (e.g. `name` or `pipeline`) followed by a colon
|
99
|
+
and the value. Multiple options are separated via one or more spaces. The value of a block option is
|
100
|
+
parsed with YAML. For example, when specifying `use_something:true` the value `true` is
|
101
|
+
automatically converted from the string `true` to the boolean `true`.
|
102
|
+
|
103
|
+
> Only the first block gets the default name of `content`. The second and following blocks have
|
104
|
+
> numbered names like `block2`, `block3` and so on.
|
105
|
+
{.information}
|
106
|
+
|
107
|
+
You can also set the name and additional options of the content blocks by using the special `blocks`
|
108
|
+
meta information. It is a hash using the index of a block (or the special value `default`) as key
|
109
|
+
and the options as values. The above example can therefore also be written like this:
|
110
|
+
|
111
|
+
---
|
112
|
+
blocks: \{2: {name: sidebar, pipeline: maruku,tags}, 3: {name: other}}
|
113
|
+
---
|
114
|
+
1. content block of the file
|
115
|
+
---
|
116
|
+
2. content block of the file
|
117
|
+
---
|
118
|
+
3. content block of the file
|
119
|
+
|
120
|
+
When selecting a value for the name of a block or an option, the following precedence is used (from
|
121
|
+
low to high):
|
122
|
+
|
123
|
+
* global defaults set via the `default` key of the meta information `blocks`
|
124
|
+
* block defaults set via the meta information `blocks`
|
125
|
+
* the `--- line` options
|
126
|
+
|
127
|
+
As stated above, the "option" `name` is special insofar that when it is not set, an automatic name
|
128
|
+
gets generated.
|
@@ -0,0 +1,73 @@
|
|
1
|
+
module Webgen
|
2
|
+
|
3
|
+
# A blackboard object provides two features for inter-object communication:
|
4
|
+
#
|
5
|
+
# * services: An object can add a service to the blackboard which can be called by any other
|
6
|
+
# object by just specifing the service name. Therefore it is easy to change the
|
7
|
+
# underlying implementation of the service and there are no hard dependencies on
|
8
|
+
# specific class or method names.
|
9
|
+
#
|
10
|
+
# * listeners: Objects may register themselves for specific messsage names and get notified when
|
11
|
+
# such a message gets dispatched.
|
12
|
+
class Blackboard
|
13
|
+
|
14
|
+
# Create a new Blackboard object.
|
15
|
+
def initialize
|
16
|
+
@listener = {}
|
17
|
+
@services = {}
|
18
|
+
end
|
19
|
+
|
20
|
+
# Add the +callable_object+ or the given block as listener for the messages +msg_names+ (one
|
21
|
+
# message name or an array of message names).
|
22
|
+
def add_listener(msg_names = nil, callable_object = nil, &block)
|
23
|
+
callable_object = callable_object || block
|
24
|
+
if !callable_object.nil?
|
25
|
+
raise ArgumentError, "The listener needs to respond to 'call'" unless callable_object.respond_to?(:call)
|
26
|
+
[msg_names].flatten.compact.each {|name| (@listener[name] ||= []) << callable_object}
|
27
|
+
else
|
28
|
+
raise ArgumentError, "You have to provide a callback object or a block"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Remove the given object from the dispatcher queues of the message names specified in
|
33
|
+
# +msg_names+.
|
34
|
+
def del_listener(msg_names, callable_object)
|
35
|
+
[msg_names].flatten.each {|name| @listener[name].delete(callable_object) if @listener[name]}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Dispatch the message +msg_name+ to all listeners for this message, passing the given
|
39
|
+
# arguments.
|
40
|
+
def dispatch_msg(msg_name, *args)
|
41
|
+
return unless @listener[msg_name]
|
42
|
+
@listener[msg_name].each {|obj| obj.call(*args)}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Add a service named +service_name+ provided by the +callable_object+ or a block to the
|
46
|
+
# blackboard.
|
47
|
+
def add_service(service_name, callable_object = nil, &block)
|
48
|
+
callable_object = callable_object || block
|
49
|
+
if @services.has_key?(service_name)
|
50
|
+
raise "The service name '#{service_name}' is already taken"
|
51
|
+
else
|
52
|
+
raise ArgumentError, "An object providing a service needs to respond to 'call'" unless callable_object.respond_to?(:call)
|
53
|
+
@services[service_name] = callable_object
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Delete the service +service_name+.
|
58
|
+
def del_service(service_name)
|
59
|
+
@services.delete(service_name)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Invoke the service called +service_name+ with the given arguments.
|
63
|
+
def invoke(service_name, *args, &block)
|
64
|
+
if @services.has_key?(service_name)
|
65
|
+
@services[service_name].call(*args, &block)
|
66
|
+
else
|
67
|
+
raise ArgumentError, "No such service named '#{service_name}' available"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
data/lib/webgen/cache.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'set'
|
2
|
+
require 'facets/kernel/constant'
|
3
|
+
|
4
|
+
module Webgen
|
5
|
+
|
6
|
+
# A cache object provides access to various caches to speed up rendering of a website.
|
7
|
+
#
|
8
|
+
# permanent:: The permanent cache should be used for data that should be available between webgen
|
9
|
+
# runs.
|
10
|
+
#
|
11
|
+
# volatile:: The volatile cache is used for data that can easily be regenerated but might be
|
12
|
+
# expensive to do so. This cache is not stored between webgen runs.
|
13
|
+
#
|
14
|
+
# standard:: The standard cache saves data between webgen runs and returns the cached data (not
|
15
|
+
# the newly set data) if it is available. This is useful, for example, to store file
|
16
|
+
# modifcation times and check if a file has been changed between runs.
|
17
|
+
#
|
18
|
+
# The standard cache should be accessed through the <tt>[]</tt> method which returns the correct
|
19
|
+
# value and the <tt>[]=</tt> method should be used for setting the new value. However, if you
|
20
|
+
# really need to access a particular value of the old or new standard cache, you can use the
|
21
|
+
# accessors +old_data+ and +new_data+.
|
22
|
+
class Cache
|
23
|
+
|
24
|
+
# The permanent cache hash.
|
25
|
+
attr_reader :permanent
|
26
|
+
|
27
|
+
# The volatile cache hash.
|
28
|
+
attr_reader :volatile
|
29
|
+
|
30
|
+
# The cache data stored in the previous webgen run.
|
31
|
+
attr_reader :old_data
|
32
|
+
|
33
|
+
# The cache data stored in the current webgen run.
|
34
|
+
attr_reader :new_data
|
35
|
+
|
36
|
+
# Create a new cache object.
|
37
|
+
def initialize()
|
38
|
+
@old_data = {}
|
39
|
+
@new_data = {}
|
40
|
+
@volatile = {}
|
41
|
+
@permanent = {:classes => []}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Return the cached data (or, if it is not available, the new data) identified by +key+ from the
|
45
|
+
# standard cache.
|
46
|
+
def [](key)
|
47
|
+
if @old_data.has_key?(key)
|
48
|
+
@old_data[key]
|
49
|
+
else
|
50
|
+
@new_data[key]
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Store +value+ identified by +key+ in the standard cache.
|
55
|
+
def []=(key, value)
|
56
|
+
@new_data[key] = value
|
57
|
+
end
|
58
|
+
|
59
|
+
# Restore the caches from +data+ and recreate all cached instances (see #instance).
|
60
|
+
def restore(data)
|
61
|
+
@old_data, @permanent = *data
|
62
|
+
@permanent[:classes].each {|klass| instance(klass)}
|
63
|
+
end
|
64
|
+
|
65
|
+
# Return all caches that should be available between webgen runs.
|
66
|
+
def dump
|
67
|
+
[@old_data.merge(@new_data), @permanent]
|
68
|
+
end
|
69
|
+
|
70
|
+
# Reset the volatile cache.
|
71
|
+
def reset_volatile_cache
|
72
|
+
@volatile = {:classes => @volatile[:classes]}
|
73
|
+
end
|
74
|
+
|
75
|
+
# Return the unique instance of the class +name+. This method should be used when it is
|
76
|
+
# essential that webgen uses only one object of a class or when an object should automatically
|
77
|
+
# be recreated upon cache restoration (see #restore).
|
78
|
+
def instance(name)
|
79
|
+
@permanent[:classes] << name unless @permanent[:classes].include?(name)
|
80
|
+
(@volatile[:classes] ||= {})[name] ||= constant(name).new
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|