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
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,84 @@
|
|
1
|
+
#all { background-color: #CCCCCC; }
|
2
|
+
|
3
|
+
#header {
|
4
|
+
border-bottom: 1px solid black;
|
5
|
+
padding: 1ex;
|
6
|
+
background-color: #888888;
|
7
|
+
}
|
8
|
+
|
9
|
+
#header h1 {
|
10
|
+
margin: 0ex;
|
11
|
+
font-size: 300%;
|
12
|
+
font-style: italic;
|
13
|
+
font-weight: normal;
|
14
|
+
}
|
15
|
+
|
16
|
+
#headerbar { border-bottom: 1px solid black; }
|
17
|
+
#footer { border-top: 1px solid black; }
|
18
|
+
|
19
|
+
#body {
|
20
|
+
margin-left: 250px;
|
21
|
+
margin-right: 20px;
|
22
|
+
padding: 10px;
|
23
|
+
}
|
24
|
+
|
25
|
+
#menu {
|
26
|
+
float: left;
|
27
|
+
width: 230px;
|
28
|
+
padding: 20px 0px 0px 2px;
|
29
|
+
}
|
30
|
+
|
31
|
+
.bar {
|
32
|
+
clear: both;
|
33
|
+
padding: 3px;
|
34
|
+
text-align: center;
|
35
|
+
font-size: 90%;
|
36
|
+
background-color: #AAAAAA;
|
37
|
+
}
|
38
|
+
|
39
|
+
.left, .right {
|
40
|
+
padding: 0px 1em;
|
41
|
+
}
|
42
|
+
|
43
|
+
.left {
|
44
|
+
float: left;
|
45
|
+
text-align: left;
|
46
|
+
}
|
47
|
+
|
48
|
+
.right {
|
49
|
+
float: right;
|
50
|
+
text-align: right;
|
51
|
+
}
|
52
|
+
|
53
|
+
/* styling the menu */
|
54
|
+
|
55
|
+
#menu a, #menu span {
|
56
|
+
text-decoration: none;
|
57
|
+
font-weight: bold;
|
58
|
+
font-size: 130%;
|
59
|
+
}
|
60
|
+
|
61
|
+
#menu a:hover {
|
62
|
+
text-decoration: underline;
|
63
|
+
}
|
64
|
+
|
65
|
+
#menu .webgen-menu-item-selected {
|
66
|
+
border-left: 3px solid black;
|
67
|
+
}
|
68
|
+
|
69
|
+
#menu ul {
|
70
|
+
list-style-type: none;
|
71
|
+
padding: 0px;
|
72
|
+
margin-left: 10px;
|
73
|
+
}
|
74
|
+
|
75
|
+
#menu li > ul {
|
76
|
+
font-size: 95%;
|
77
|
+
}
|
78
|
+
|
79
|
+
#menu li {
|
80
|
+
margin: 0.0em 0px;
|
81
|
+
padding: 2px 0px;
|
82
|
+
padding-left: 5px;
|
83
|
+
border-left: 3px solid #CCCCCC;
|
84
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang:}">
|
4
|
+
<head>
|
5
|
+
<title>{title: }</title>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<meta name="description" content="Your description goes here..." />
|
8
|
+
<meta name="keywords" content="your,keywords,goes,here" />
|
9
|
+
<meta name="author" content="Your Name" />
|
10
|
+
<meta name="generator" content="webgen - http://webgen.rubyforge.com/" />
|
11
|
+
<link href="{relocatable: default.css}" rel="stylesheet" type="text/css" />
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<div id="header">
|
15
|
+
<h1>{title: }</h1>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div id="headerbar" class="bar">
|
19
|
+
<span class="left">Location: {breadcrumb_trail: }</span>
|
20
|
+
<span class="right">Language: {langbar: }</span>
|
21
|
+
<div style="clear:both"></div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div id="menu">
|
25
|
+
{menu: {used_nodes: files}}
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div id="body">
|
29
|
+
<webgen:block name="content" />
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div id="footer" class="bar">
|
33
|
+
Generated by <a href="http://webgen.rubyforge.org">webgen</a> on <b>{date: }</b>
|
34
|
+
</div>
|
35
|
+
</body>
|
36
|
+
</html>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
template: extensions.template
|
3
|
+
--- name:summary pipeline:erb,tags,maruku,blocks
|
4
|
+
|
5
|
+
As short name for the content processor (used, for example, in the `pipeline` option of a block in a
|
6
|
+
file in [Webgen Page Format]({relocatable: webgen_page_format.html})) one of the following can be
|
7
|
+
used: `<%= context.website.config['contentprocessor.map'].select {|k,v| v ==
|
8
|
+
context.content_node['title']}.map {|k,v| k}.join(', ') %>`.
|
9
|
+
|
10
|
+
--- name:content
|
11
|
+
<webgen:block name='content' />
|
@@ -0,0 +1,129 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::Blocks
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This processor replaces a special xml tag with rendered blocks. It is used, for example, in
|
7
|
+
templates to define the place where the actual page content should be.
|
8
|
+
|
9
|
+
The general syntax is as follows:
|
10
|
+
|
11
|
+
<webgen:block name='BLOCK_NAME' chain='(L)CN;(L)CN;...' node='next|first|current' notfound='ignore' />
|
12
|
+
|
13
|
+
So it is basically an XML tag with the mandatory attribute `name` and the optional attributes
|
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:
|
39
|
+
|
40
|
+
* The `name` attribute is the only mandatory attribute and it specifies the name of the block that
|
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.
|
43
|
+
|
44
|
+
* The optional attribute `chain` specifies the node chain that should be used for rendering the
|
45
|
+
block. Its value needs to be a list of (localized) canonical names of nodes separated by
|
46
|
+
semicolons that should be used as node chain. If this attribute is not specified the default node
|
47
|
+
chain is used.
|
48
|
+
|
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}
|
64
|
+
|
65
|
+
* If the optional attribute `notfound` has a value of `ignore`, all errors that can occur are
|
66
|
+
ignored. This is especially useful when used in templates to include blocks that may not be
|
67
|
+
defined in all page files.
|
68
|
+
|
69
|
+
All this is more easily explained with examples. Assume that we have a `default.template` file, a
|
70
|
+
`page.template` file and a `my.page` file with the following contents:
|
71
|
+
|
72
|
+
The `default.template` file:
|
73
|
+
|
74
|
+
--- name:content pipeline:blocks
|
75
|
+
before default
|
76
|
+
<webgen:block name='content' />
|
77
|
+
after default 1
|
78
|
+
<webgen:block name='content' chain='page.template;my.html' />
|
79
|
+
after default 2
|
80
|
+
<webgen:block name='optional' chain='page.template;my.html' node='first' />
|
81
|
+
after default 3
|
82
|
+
<webgen:block name='invalid' notfound='ignore' />
|
83
|
+
after default 4
|
84
|
+
|
85
|
+
The `page.template` file:
|
86
|
+
|
87
|
+
--- name:content pipeline:blocks
|
88
|
+
before page 1
|
89
|
+
<webgen:block name='content' />
|
90
|
+
after page 1
|
91
|
+
|
92
|
+
And the `my.page` file:
|
93
|
+
|
94
|
+
--- name:content pipeline:
|
95
|
+
The content of the page file.
|
96
|
+
--- name:optional pipeline:
|
97
|
+
Optional content.
|
98
|
+
|
99
|
+
When `my.page` gets rendered to `my.html`, the node chain looks like this by default:
|
100
|
+
|
101
|
+
default.template ---> my.html
|
102
|
+
|
103
|
+
The first webgen block tag just inserts the rendered block named `content` of `my.page`. The second
|
104
|
+
block tag uses a custom node chain. Therefore the block named `content` of `page.template` gets
|
105
|
+
rendered using the node chain:
|
106
|
+
|
107
|
+
page.template ---> my.html
|
108
|
+
|
109
|
+
and then inserted. The third block tag uses the same custom node chain but for a block named
|
110
|
+
`optional`. This block does not exist in `page.template` but it does exist in `my.page`. Since the
|
111
|
+
`node` attribute is set to `first`, the first node `page.template` in the node chain is ignored and
|
112
|
+
the block is found in `my.page` (if the `node` attribute is not specified, an error will be raised).
|
113
|
+
|
114
|
+
The fourth block tag specifies a block name that does not occur in `my.page`. However, since the
|
115
|
+
optional attribute `notfound` is set to `ignore`, this error is ignored.
|
116
|
+
|
117
|
+
Summing up the above, the rendered file `my.html` will then look like this:
|
118
|
+
|
119
|
+
before default 1
|
120
|
+
The content of the page file.
|
121
|
+
after default 1
|
122
|
+
before page 1
|
123
|
+
The content of the page file.
|
124
|
+
after page 1
|
125
|
+
after default 2
|
126
|
+
Optional content.
|
127
|
+
after default 3
|
128
|
+
|
129
|
+
after default 4
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::ContentProcessor::Builder
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This content processor can be used to programatically create XHTML/XML documents
|
7
|
+
([Reference][1]). The top builder object is provided through the `xml` object. There are also other
|
8
|
+
objects provided by webgen available - have a look at the [erb documentation]({relocatable:
|
9
|
+
erb.html}).
|
10
|
+
|
11
|
+
> This extension is only available if you have installed the [builder][1] library. The preferred way
|
12
|
+
> to do this is via Rubygems:
|
13
|
+
>
|
14
|
+
> gem install builder
|
15
|
+
{.warning}
|
16
|
+
|
17
|
+
|
18
|
+
## Examples
|
19
|
+
|
20
|
+
Here is a short sample of content that is valid Ruby and uses the special `xml` object:
|
21
|
+
|
22
|
+
xml.h1("This a h1 header", :id => 'myid')
|
23
|
+
|
24
|
+
xml.p do |p|
|
25
|
+
p.text! "You can just write "
|
26
|
+
p.b "your"
|
27
|
+
p.text! "paragraphs here and"
|
28
|
+
p.a("link", :href => "http://someurl.com")
|
29
|
+
p.text! "them below. This is also a"
|
30
|
+
p.i "nice"
|
31
|
+
p.text! "format!"
|
32
|
+
end
|
33
|
+
|
34
|
+
xml.blockquote(:class => 'information') do |bq|
|
35
|
+
bq.text! "Citations are easy too."
|
36
|
+
bq.text! "Really. And you can assign them attributes."
|
37
|
+
end
|
38
|
+
|
39
|
+
xml.ul do |ul|
|
40
|
+
ul.li "Lists"
|
41
|
+
ul.li "aren't"
|
42
|
+
ul.li "difficult"
|
43
|
+
ul.li "either."
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
Following is a complete example which shows how to use this extension in a page file which generates
|
48
|
+
a custom XML document (the `content` block has to be valid Ruby!):
|
49
|
+
|
50
|
+
---
|
51
|
+
output_path_style: [:parent, :cnbase, ['.', :lang], '.xml']
|
52
|
+
title: Person Object
|
53
|
+
template: ~
|
54
|
+
--- pipeline:builder
|
55
|
+
xml.persons(:path => node.absolute_lcn) do |p|
|
56
|
+
p.person do |b|
|
57
|
+
b.firstname('Thomas')
|
58
|
+
b.lastname('Leitner')
|
59
|
+
end
|
60
|
+
p.person do |b|
|
61
|
+
b.firstname('Other first')
|
62
|
+
b.lastname('Other last')
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
The above will produce the following output:
|
67
|
+
|
68
|
+
<persons path="/test.xml">
|
69
|
+
<person>
|
70
|
+
<firstname>Thomas</firstname>
|
71
|
+
<lastname>Leitner</lastname>
|
72
|
+
</person>
|
73
|
+
<person>
|
74
|
+
<firstname>Other first</firstname>
|
75
|
+
<lastname>Other last</lastname>
|
76
|
+
</person>
|
77
|
+
</persons>
|
78
|
+
|
79
|
+
|
80
|
+
[1]: http://builder.rubyforge.org "Homepage of builder library"
|