thewoolleyman-webgen 0.5.8.20090419
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +8 -0
- data/COPYING +10 -0
- data/GPL +340 -0
- data/Rakefile +334 -0
- data/THANKS +18 -0
- data/bin/webgen +12 -0
- data/data/webgen/resources.yaml +3 -0
- data/data/webgen/webgui/controller/main.rb +135 -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 +10 -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 +62 -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 +129 -0
- data/doc/contentprocessor/builder.page +80 -0
- data/doc/contentprocessor/erb.page +59 -0
- data/doc/contentprocessor/erubis.page +46 -0
- data/doc/contentprocessor/fragments.page +25 -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 +219 -0
- data/doc/getting_started.page +135 -0
- data/doc/index.page +65 -0
- data/doc/manual.page +589 -0
- data/doc/reference_configuration.page +959 -0
- data/doc/reference_metainfo.page +222 -0
- data/doc/source/filesystem.page +39 -0
- data/doc/source/tararchive.page +40 -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 +105 -0
- data/doc/sourcehandler/metainfo.page +41 -0
- data/doc/sourcehandler/page.page +14 -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 +44 -0
- data/doc/tag/link.page +44 -0
- data/doc/tag/menu.page +106 -0
- data/doc/tag/metainfo.page +29 -0
- data/doc/tag/relocatable.page +38 -0
- data/doc/tag/sitemap.page +31 -0
- data/doc/tag/tikz.page +158 -0
- data/doc/upgrading.page +139 -0
- data/doc/webgen_page_format.page +129 -0
- data/lib/webgen/blackboard.rb +78 -0
- data/lib/webgen/cache.rb +87 -0
- data/lib/webgen/cli.rb +124 -0
- data/lib/webgen/cli/apply_command.rb +64 -0
- data/lib/webgen/cli/create_command.rb +66 -0
- data/lib/webgen/cli/run_command.rb +22 -0
- data/lib/webgen/cli/utils.rb +88 -0
- data/lib/webgen/cli/webgui_command.rb +72 -0
- data/lib/webgen/common.rb +21 -0
- data/lib/webgen/common/sitemap.rb +83 -0
- data/lib/webgen/configuration.rb +153 -0
- data/lib/webgen/contentprocessor.rb +99 -0
- data/lib/webgen/contentprocessor/blocks.rb +60 -0
- data/lib/webgen/contentprocessor/builder.rb +30 -0
- data/lib/webgen/contentprocessor/context.rb +89 -0
- data/lib/webgen/contentprocessor/erb.rb +28 -0
- data/lib/webgen/contentprocessor/erubis.rb +40 -0
- data/lib/webgen/contentprocessor/fragments.rb +25 -0
- data/lib/webgen/contentprocessor/haml.rb +30 -0
- data/lib/webgen/contentprocessor/maruku.rb +20 -0
- data/lib/webgen/contentprocessor/rdiscount.rb +17 -0
- data/lib/webgen/contentprocessor/rdoc.rb +19 -0
- data/lib/webgen/contentprocessor/redcloth.rb +17 -0
- data/lib/webgen/contentprocessor/sass.rb +20 -0
- data/lib/webgen/contentprocessor/tags.rb +136 -0
- data/lib/webgen/coreext.rb +13 -0
- data/lib/webgen/default_config.rb +215 -0
- data/lib/webgen/languages.rb +589 -0
- data/lib/webgen/loggable.rb +25 -0
- data/lib/webgen/logger.rb +97 -0
- data/lib/webgen/node.rb +391 -0
- data/lib/webgen/output.rb +82 -0
- data/lib/webgen/output/filesystem.rb +69 -0
- data/lib/webgen/page.rb +153 -0
- data/lib/webgen/path.rb +194 -0
- data/lib/webgen/source.rb +54 -0
- data/lib/webgen/source/filesystem.rb +61 -0
- data/lib/webgen/source/resource.rb +44 -0
- data/lib/webgen/source/stacked.rb +55 -0
- data/lib/webgen/source/tararchive.rb +73 -0
- data/lib/webgen/sourcehandler.rb +226 -0
- data/lib/webgen/sourcehandler/base.rb +248 -0
- data/lib/webgen/sourcehandler/copy.rb +43 -0
- data/lib/webgen/sourcehandler/directory.rb +36 -0
- data/lib/webgen/sourcehandler/feed.rb +117 -0
- data/lib/webgen/sourcehandler/fragment.rb +68 -0
- data/lib/webgen/sourcehandler/memory.rb +43 -0
- data/lib/webgen/sourcehandler/metainfo.rb +128 -0
- data/lib/webgen/sourcehandler/page.rb +59 -0
- data/lib/webgen/sourcehandler/sitemap.rb +60 -0
- data/lib/webgen/sourcehandler/template.rb +66 -0
- data/lib/webgen/sourcehandler/virtual.rb +110 -0
- data/lib/webgen/tag.rb +27 -0
- data/lib/webgen/tag/base.rb +170 -0
- data/lib/webgen/tag/breadcrumbtrail.rb +70 -0
- data/lib/webgen/tag/coderay.rb +31 -0
- data/lib/webgen/tag/date.rb +18 -0
- data/lib/webgen/tag/executecommand.rb +30 -0
- data/lib/webgen/tag/includefile.rb +42 -0
- data/lib/webgen/tag/langbar.rb +52 -0
- data/lib/webgen/tag/link.rb +26 -0
- data/lib/webgen/tag/menu.rb +207 -0
- data/lib/webgen/tag/metainfo.rb +25 -0
- data/lib/webgen/tag/relocatable.rb +54 -0
- data/lib/webgen/tag/sitemap.rb +41 -0
- data/lib/webgen/tag/tikz.rb +119 -0
- data/lib/webgen/tree.rb +90 -0
- data/lib/webgen/version.rb +8 -0
- data/lib/webgen/webgentask.rb +152 -0
- data/lib/webgen/website.rb +342 -0
- data/lib/webgen/websiteaccess.rb +31 -0
- data/lib/webgen/websitemanager.rb +127 -0
- data/man/man1/webgen.1 +73 -0
- data/misc/default.css +384 -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.png +0 -0
- data/misc/images/headerbg.jpg +0 -0
- data/misc/images/important.png +0 -0
- data/misc/images/information.png +0 -0
- data/misc/images/quote.gif +0 -0
- data/misc/images/warning.png +0 -0
- data/setup.rb +1585 -0
- data/test/helper.rb +45 -0
- data/test/test_blackboard.rb +60 -0
- data/test/test_cache.rb +59 -0
- data/test/test_cli.rb +21 -0
- data/test/test_common.rb +18 -0
- data/test/test_common_sitemap.rb +58 -0
- data/test/test_configuration.rb +68 -0
- data/test/test_contentprocessor.rb +33 -0
- data/test/test_contentprocessor_blocks.rb +68 -0
- data/test/test_contentprocessor_builder.rb +23 -0
- data/test/test_contentprocessor_context.rb +40 -0
- data/test/test_contentprocessor_erb.rb +23 -0
- data/test/test_contentprocessor_erubis.rb +49 -0
- data/test/test_contentprocessor_fragments.rb +42 -0
- data/test/test_contentprocessor_haml.rb +23 -0
- data/test/test_contentprocessor_maruku.rb +29 -0
- data/test/test_contentprocessor_rdiscount.rb +17 -0
- data/test/test_contentprocessor_rdoc.rb +18 -0
- data/test/test_contentprocessor_redcloth.rb +15 -0
- data/test/test_contentprocessor_sass.rb +22 -0
- data/test/test_contentprocessor_tags.rb +99 -0
- data/test/test_languages.rb +67 -0
- data/test/test_loggable.rb +32 -0
- data/test/test_logger.rb +94 -0
- data/test/test_node.rb +367 -0
- data/test/test_output_filesystem.rb +60 -0
- data/test/test_page.rb +214 -0
- data/test/test_path.rb +165 -0
- data/test/test_source_filesystem.rb +76 -0
- data/test/test_source_resource.rb +28 -0
- data/test/test_source_stacked.rb +36 -0
- data/test/test_source_tararchive.rb +65 -0
- data/test/test_sourcehandler_base.rb +123 -0
- data/test/test_sourcehandler_copy.rb +47 -0
- data/test/test_sourcehandler_directory.rb +42 -0
- data/test/test_sourcehandler_feed.rb +77 -0
- data/test/test_sourcehandler_fragment.rb +69 -0
- data/test/test_sourcehandler_memory.rb +44 -0
- data/test/test_sourcehandler_metainfo.rb +118 -0
- data/test/test_sourcehandler_page.rb +65 -0
- data/test/test_sourcehandler_sitemap.rb +49 -0
- data/test/test_sourcehandler_template.rb +65 -0
- data/test/test_sourcehandler_virtual.rb +87 -0
- data/test/test_tag_base.rb +85 -0
- data/test/test_tag_breadcrumbtrail.rb +91 -0
- data/test/test_tag_coderay.rb +32 -0
- data/test/test_tag_date.rb +18 -0
- data/test/test_tag_executecommand.rb +41 -0
- data/test/test_tag_includefile.rb +50 -0
- data/test/test_tag_langbar.rb +72 -0
- data/test/test_tag_link.rb +69 -0
- data/test/test_tag_menu.rb +207 -0
- data/test/test_tag_metainfo.rb +19 -0
- data/test/test_tag_relocatable.rb +59 -0
- data/test/test_tag_sitemap.rb +47 -0
- data/test/test_tag_tikz.rb +69 -0
- data/test/test_tree.rb +70 -0
- data/test/test_webgentask.rb +23 -0
- data/test/test_website.rb +98 -0
- data/test/test_websiteaccess.rb +25 -0
- data/test/test_websitemanager.rb +70 -0
- metadata +613 -0
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::Erb
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This processer uses ERB (embedded Ruby) to process content. For detailed information about ERB have
|
7
|
+
a look at its documentation by executing `ri ERB` or the [ruby documentation
|
8
|
+
site](http://www.ruby-doc.org/)!
|
9
|
+
|
10
|
+
You can use the following special objects in your ERB code:
|
11
|
+
|
12
|
+
* `website`: Provides access to the `Webgen::Website` object which can be used to access all aspects
|
13
|
+
of the currently rendered website.
|
14
|
+
|
15
|
+
* `context`: This object provides the whole rendering context, the following objects are just for
|
16
|
+
backwards compatibility.
|
17
|
+
|
18
|
+
* `ref_node` (or `context.ref_node`): The reference node which is the source of the ERB code that is
|
19
|
+
executed. Should be used, for example, for resolving paths.
|
20
|
+
|
21
|
+
* `node` (or `context.content_node`): The node that gets currently rendered. Should be used for
|
22
|
+
retrieving meta information.
|
23
|
+
|
24
|
+
* `dest_node` (or `context.dest_node`): The node in which the result gets inserted. Should be used
|
25
|
+
for calculating relative paths.
|
26
|
+
|
27
|
+
Here is a small usage example. The following put in a page file
|
28
|
+
|
29
|
+
Counting 5 items dynamically:
|
30
|
+
<%% for i in 1..5 %>
|
31
|
+
* item <%%= i %>
|
32
|
+
<%% end %>
|
33
|
+
|
34
|
+
Outputting all meta information:
|
35
|
+
<%% node.meta_info.each do |k,v| %>
|
36
|
+
* <%%= k %> = <%%= v %>
|
37
|
+
<%% end %>
|
38
|
+
|
39
|
+
... will give the result:
|
40
|
+
|
41
|
+
Counting 5 items dynamically:
|
42
|
+
<% for i in 1..5 %>
|
43
|
+
* item <%= i %>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
Outputting all meta information:
|
47
|
+
<% node.meta_info.each do |k,v| %>
|
48
|
+
* <%= k %> = <%= v %>
|
49
|
+
<% end %>
|
50
|
+
|
51
|
+
The second line shows the first form of the ERB tags which executes Ruby code but does not output
|
52
|
+
anything: it just starts a `for` loop. On the third line the second form of ERB tags is used to
|
53
|
+
output the result of the Ruby code (note the equation sign!). And the fourth line completes the
|
54
|
+
`for` loop by adding the needed `end` keyword.
|
55
|
+
|
56
|
+
> You may need to ensure that the ERB start and end tags are not processed by the content
|
57
|
+
> processor. For example, when using the RedCloth content processor, you may need to surround the
|
58
|
+
> ERB code with `<textile>` tags!
|
59
|
+
{.important}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::Erubis
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This processor uses the [Erubis][1] library to process embedded Ruby statements. Erubis is quite a
|
7
|
+
bit faster than the standard ERB library that is shipped with Ruby and provides many other useful
|
8
|
+
options.
|
9
|
+
|
10
|
+
> This extension is only available if you have installed the [erubis][1] library. The preferred
|
11
|
+
> way to do this is via Rubygems:
|
12
|
+
>
|
13
|
+
> gem install erubis
|
14
|
+
{.warning}
|
15
|
+
|
16
|
+
[1]: http://www.kuwata-lab.com/erubis/ "Erubis Homepage"
|
17
|
+
|
18
|
+
You can use some special objects provided by webgen in your embedded Ruby code. These are the same
|
19
|
+
objects that are available to the `erb` processor, have a look at its [documentation
|
20
|
+
page]({relocatable: erb.html}).
|
21
|
+
|
22
|
+
The default mode of Erubis works like ERB. So everyting said on the [erb page]({relocatable:
|
23
|
+
erb.html}) is also true for Erubis. However, you can customize how this processor works by using the
|
24
|
+
following configuration options:
|
25
|
+
|
26
|
+
* `contentprocessor.erubis.use_pi`: Use processing instructions instead of ERB like
|
27
|
+
instructions. Normally you use statements like `<%% result = some_method_call(opts) %>` or `<%%=
|
28
|
+
context.content_node.absolute_lcn %>` in your content. When setting this option to `true`, you can
|
29
|
+
use XML processing instructions instead, like this: `<?rb result = some_method_call(opts) ?>` or
|
30
|
+
`@{context.content_node.absolute_lcn}@`.
|
31
|
+
|
32
|
+
* `contentprocessor.erubis.options`: This is hash which is passed to the Erubis interpreter and
|
33
|
+
which can be used to set additional options.
|
34
|
+
|
35
|
+
For more information on the additional options or on how to use the processing instructions mode of
|
36
|
+
Erubis, have a look at the [Erubis User Guide](http://www.kuwata-lab.com/erubis/users-guide.html)!
|
37
|
+
|
38
|
+
You can also use block options to modify the behavior of Erubis. The block option `erubis_use_pi` is
|
39
|
+
used instead of the configuration option `contentprocessor.erubis.use_pi` and all other block
|
40
|
+
options starting with `erubis_` are added the options hash that is passed to the Erubis
|
41
|
+
interpreter. For example, the following page tells the Erubis interpreter to use the processing
|
42
|
+
instructions mode and to trim spaces:
|
43
|
+
|
44
|
+
--- erubis_use_pi:true erubis_trim:true
|
45
|
+
Here are the numbers from 1 to 5:
|
46
|
+
<?rb for i in [1,2,3,4,5] ?>@{i}@<?rb end ?>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::Fragments
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This processor generates nested fragment nodes from all headers `h1` to `h6` which have an `id`
|
7
|
+
attribute set.
|
8
|
+
|
9
|
+
> This is only done for the block named `content` or if no block is associated with the given render
|
10
|
+
> context! This is to ensure that fragment nodes are not created from multiple block of one page
|
11
|
+
> file. So this content processor has no effect when used in the pipeline of blocks except if the
|
12
|
+
> block is named `content`.
|
13
|
+
{.warning}
|
14
|
+
|
15
|
+
The default markup language Maruku automatically generates an `id` attribute for all headers. If you
|
16
|
+
use another markup language or plain old HTML, you might need to set the `id` attributes by hand.
|
17
|
+
|
18
|
+
> The reason why only header tags with an `id` attribute are used is that only those can be
|
19
|
+
> referenced and linked to later.
|
20
|
+
{.information}
|
21
|
+
|
22
|
+
The generated fragment nodes can be used like any other node. So you can link to them and use them
|
23
|
+
in a menu. Concerning the menu, there is a setting for the `tag.menu.used_nodes` option called
|
24
|
+
`fragments` which only uses the fragment node of the current page to generate a menu. This allows to
|
25
|
+
generate a nice overview of the page.
|
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::Haml
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This processor converts the content, which is assumed to be in the Haml markup language, to valid
|
7
|
+
XHTML by using the Haml library. For detailed information about Haml have a look at the [Haml
|
8
|
+
Homepage][1]!
|
9
|
+
|
10
|
+
You can use some special objects provided by webgen in your Haml markup. These are the same objects
|
11
|
+
that are available to the `erb` processor, have a look at its [documentation page]({relocatable:
|
12
|
+
erb.html}).
|
13
|
+
|
14
|
+
> This extension is only available if you have installed the [haml][1] library. The preferred way to
|
15
|
+
> do this is via Rubygems:
|
16
|
+
>
|
17
|
+
> gem install haml
|
18
|
+
{.warning}
|
19
|
+
|
20
|
+
|
21
|
+
## Example
|
22
|
+
|
23
|
+
Here is a short sample of a text in Haml markup:
|
24
|
+
|
25
|
+
%h1#myid This a h1 header
|
26
|
+
|
27
|
+
%p
|
28
|
+
You can just write
|
29
|
+
%b your
|
30
|
+
paragraphs here and
|
31
|
+
%a{:href => 'http://someurl.com'} link
|
32
|
+
them below. This is a
|
33
|
+
%strong nice
|
34
|
+
format!
|
35
|
+
|
36
|
+
%blockquote.information
|
37
|
+
Citations are easy too.
|
38
|
+
Really. And you can assign them attributes.
|
39
|
+
|
40
|
+
%ul
|
41
|
+
%li Lists
|
42
|
+
%li aren't
|
43
|
+
%li difficult
|
44
|
+
%li either.
|
45
|
+
|
46
|
+
|
47
|
+
[1]: http://haml.hamptoncatlin.com/
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::Maruku
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This processor converts the content, which is assumed to be in Markdown markup, to HTML by using the
|
7
|
+
Maruku library. Maruku is a Markdown processor which supports a superset of Markdown, including
|
8
|
+
support for assigning ids and classes to every element, support for Markdown inside HTML elements
|
9
|
+
and footnotes.
|
10
|
+
|
11
|
+
For detailed information about Maruku have a look at the [Maruku Homepage][1]. There you will find
|
12
|
+
information about the general Markdown syntax as well as information about the extras added by
|
13
|
+
Maruku.
|
14
|
+
|
15
|
+
> Maruku is the default markup content processor for webgen as its markup syntax is easy to learn
|
16
|
+
> and nice to look at. Give it a try!
|
17
|
+
{.info}
|
18
|
+
|
19
|
+
Example
|
20
|
+
-------
|
21
|
+
|
22
|
+
Here is a short sample of a text in Markdown+Extras markup:
|
23
|
+
|
24
|
+
# This a h1 header {#myid}
|
25
|
+
|
26
|
+
You can just write *your* paragraphs here and
|
27
|
+
[link][1] them below. This is **nice** format!
|
28
|
+
|
29
|
+
> Citations are easy too.
|
30
|
+
> Really. And you can assign them attributes.
|
31
|
+
{.information}
|
32
|
+
|
33
|
+
* Lists
|
34
|
+
* aren't
|
35
|
+
* difficult
|
36
|
+
* either.
|
37
|
+
|
38
|
+
[1]: http://someurl.com
|
39
|
+
|
40
|
+
|
41
|
+
[1]: http://maruku.rubyforge.org/
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::RDiscount
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This processor converts the content, which is assumed to be in Markdown markup, to HTML by using the
|
7
|
+
RDiscount library. This library is based on the C based discount library which provides very fast
|
8
|
+
Markdown processing. However, this processor does not support advanced features like the [Maruku
|
9
|
+
Markdown processor]({relocatable: maruku.html}) does.
|
10
|
+
|
11
|
+
> This extension is only available if you have installed the [rdiscount][1] library. The preferred
|
12
|
+
> way to do this is via Rubygems:
|
13
|
+
>
|
14
|
+
> gem install rdiscount
|
15
|
+
{.warning}
|
16
|
+
|
17
|
+
[1]: http://github.com/rtomayko/rdiscount
|
18
|
+
|
19
|
+
Example
|
20
|
+
-------
|
21
|
+
|
22
|
+
Here is a short sample of a text in Markdown markup:
|
23
|
+
|
24
|
+
# This a h1 header
|
25
|
+
|
26
|
+
You can just write *your* paragraphs here and
|
27
|
+
[link][1] them below. This is **nice** format!
|
28
|
+
|
29
|
+
> Citations are easy too.
|
30
|
+
> Really. And you can assign them attributes.
|
31
|
+
|
32
|
+
* Lists
|
33
|
+
* aren't
|
34
|
+
* difficult
|
35
|
+
* either.
|
36
|
+
|
37
|
+
[1]: http://someurl.com
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::RDoc
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This content processors converts content written in RDoc markup (the default documentation format
|
7
|
+
for Ruby source files, [reference][1]) to HTML.
|
8
|
+
|
9
|
+
> This extension needs the [new RDoc implementation][2] and is not compatible with the
|
10
|
+
> implementation included in the Ruby distribution. The preferred way to install the new
|
11
|
+
> implementation is via Rubygems:
|
12
|
+
>
|
13
|
+
> gem install rdoc
|
14
|
+
{.warning}
|
15
|
+
|
16
|
+
[1]: http://rdoc.rubyforge.org/rdoc/ "RDoc Reference"
|
17
|
+
[2]: http://rubyforge.org/projects/rdoc/ "New RDoc implementation"
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
21
|
+
Here is a short sample of a text in RDoc markup:
|
22
|
+
|
23
|
+
= This a h1 header
|
24
|
+
|
25
|
+
You can just write *your* paragraphs here and <a href="http://someurl.com">link</a> them below.
|
26
|
+
This is also a _nice_ format!
|
27
|
+
|
28
|
+
<blockquote class='information>
|
29
|
+
Citations are easy too.
|
30
|
+
Really. And you can assign them attributes.
|
31
|
+
</blockquote>
|
32
|
+
|
33
|
+
* Lists
|
34
|
+
* aren't
|
35
|
+
* difficult
|
36
|
+
* either.
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::RedCloth
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This processor converts the content, which is assumed to be in Textile markup, to HTML by using the
|
7
|
+
RedCloth library. For detailed information about Textile have a look at the [Textile Reference][1]!
|
8
|
+
|
9
|
+
> This extension is only available if you have installed the [redcloth][2] library. The preferred
|
10
|
+
> way to do this is via Rubygems:
|
11
|
+
>
|
12
|
+
> gem install RedCloth
|
13
|
+
{.warning}
|
14
|
+
|
15
|
+
|
16
|
+
Example
|
17
|
+
-------
|
18
|
+
|
19
|
+
Here is a short sample of a text in Textile markup:
|
20
|
+
|
21
|
+
h1(#myid). This a h1 header
|
22
|
+
|
23
|
+
You can just write *your* paragraphs here and
|
24
|
+
"link":http://someurl.com them below. This is also a
|
25
|
+
**nice** format!
|
26
|
+
|
27
|
+
<blockquote class='information>
|
28
|
+
Citations are easy too.
|
29
|
+
Really. And you can assign them attributes.
|
30
|
+
</blockquote>
|
31
|
+
|
32
|
+
* Lists
|
33
|
+
* aren't
|
34
|
+
* difficult
|
35
|
+
* either.
|
36
|
+
|
37
|
+
|
38
|
+
[1]: http://hobix.com/textile/
|
39
|
+
[2]: http://whytheluckystiff.net/ruby/redcloth/
|
@@ -0,0 +1,31 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::Sass
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This processor converts the content, which is assumed to be in the Sass meta language, to valid CSS
|
7
|
+
using the Haml library. For detailed information about Sass have a look at the [Haml Homepage][1]!
|
8
|
+
|
9
|
+
> This extension is only available if you have installed the [haml][1] library. The preferred way to
|
10
|
+
> do this is via Rubygems:
|
11
|
+
>
|
12
|
+
> gem install haml
|
13
|
+
{.warning}
|
14
|
+
|
15
|
+
|
16
|
+
## Example
|
17
|
+
|
18
|
+
Here is a short sample of a text in the Sass meta language:
|
19
|
+
|
20
|
+
#main
|
21
|
+
:width 90%
|
22
|
+
p
|
23
|
+
:border-style solid
|
24
|
+
:border-color #00f
|
25
|
+
a
|
26
|
+
:font-weight bold
|
27
|
+
a:hover
|
28
|
+
:text-decoration underline
|
29
|
+
|
30
|
+
|
31
|
+
[1]: http://haml.hamptoncatlin.com/
|
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::Tags
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This processor provides an easy method for adding dynamic content to web pages. It uses so called
|
7
|
+
webgen tags to replace special markup constructs with dynamic content. This system allows webgen to
|
8
|
+
generate menus and breadcrumb trails, include files and much more. webgen already comes with many
|
9
|
+
tags that handle simple things, like including a file, to advanced things, like generating a
|
10
|
+
menu.
|
11
|
+
|
12
|
+
Each webgen tag is defined using a unique name and handled by a tag class. A tag can have zero or
|
13
|
+
more parameters some of which are mandatory. Tag parameters map directly to configuration options,
|
14
|
+
so you can temporarily (for the rendering of the tag) override some configuration options. Since
|
15
|
+
normally only the special configuration options for the tag itself are used, a shorter form can be
|
16
|
+
used for them: just remove the tag class name part (without the `Webgen::` prefix) from the
|
17
|
+
configuration option. For example, the relocatable tag handled by Webgen::Tag::Relocatable specifies
|
18
|
+
the configuration option `tag.relocatable.path` and the short name for it (when used as parameter
|
19
|
+
for the relocatable tag, not when used for other tags) is therefore just `path`. The supported
|
20
|
+
parameters (and if they are mandatory) are listed for each tag on its documentation page. The
|
21
|
+
default mandatory parameter can be specified in a special way, see the following section. When spe
|
22
|
+
|
23
|
+
When content is parsed and a webgen tag is encountered, the registered class for this tag is
|
24
|
+
called. If no class for a tag exists there are two possibilities: if a default tag class exists,
|
25
|
+
then this default class is called. Otherwise an error is raised.
|
26
|
+
|
27
|
+
For information on how to create such a tag classes have a look at the API documentation of the
|
28
|
+
class Webgen::Tag::Base.
|
29
|
+
|
30
|
+
|
31
|
+
## Syntax for webgen Tags {#syntax}
|
32
|
+
|
33
|
+
webgen tags are defined using a special markup construct which consists of the tag name, a parameter
|
34
|
+
part and a body part.
|
35
|
+
|
36
|
+
A tag can be specified in one of the following ways:
|
37
|
+
|
38
|
+
* The simplest form of a webgen tag just consists of the tag name itself. This form can only be used
|
39
|
+
if the tag does not have any mandatory parameters.
|
40
|
+
|
41
|
+
\{tagname:}
|
42
|
+
|
43
|
+
* If a plugin has only one mandatory parameter, there is a short-cut syntax for specifying its
|
44
|
+
value.
|
45
|
+
|
46
|
+
\{tagname: value}
|
47
|
+
|
48
|
+
* If a plugin has more than one mandatory parameter or if some default parameter values should be
|
49
|
+
overwritten, one needs to use the following general form.
|
50
|
+
|
51
|
+
\{tagname: {option: value, other_option: other_value}}
|
52
|
+
|
53
|
+
> The parameters defined using this syntax are actually specified using a hash in YAML
|
54
|
+
> markup. So you can use any valid YAML construct in the YAML hash definition.
|
55
|
+
{.information}
|
56
|
+
|
57
|
+
* Additionally, you can use a body part with any of the above forms. To specify that the tag has a
|
58
|
+
body part, just use two colons instead of one after the tag name and don't forget the closing
|
59
|
+
tag.
|
60
|
+
|
61
|
+
\{tagname::}Here comes the body{tagname}
|
62
|
+
|
63
|
+
Although you can always specify a body part, only some tags actually use it - the documentation
|
64
|
+
for each tag states if the body part is used or not.
|
65
|
+
|
66
|
+
Sometimes you need to specify something which looks like a webgen tag but should not be processed
|
67
|
+
like one. In such cases, you need to escape the tag with a backslash, like this:
|
68
|
+
|
69
|
+
\\\{tagname: {key:value}}
|
70
|
+
|
71
|
+
Another solution to this is to specify a general prefix for all webgen tags using the configuration
|
72
|
+
option `contentprocessor.tags.prefix`. Let's imagine that you set the prefix to `webgen:`; then this
|
73
|
+
content processor will only process webgen tags of the form `\{webgen:tagname: {key: value}}`.
|