thewoolleyman-webgen 0.5.8.20090419
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 +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,29 @@
|
|
1
|
+
contentprocessor/:
|
2
|
+
index_path: ~
|
3
|
+
|
4
|
+
contentprocessor/*:
|
5
|
+
template: ../contentprocessor.template
|
6
|
+
|
7
|
+
sourcehandler/:
|
8
|
+
index_path: ~
|
9
|
+
|
10
|
+
sourcehandler/*:
|
11
|
+
template: ../sourcehandler.template
|
12
|
+
|
13
|
+
tag/:
|
14
|
+
index_path: ~
|
15
|
+
|
16
|
+
tag/*:
|
17
|
+
template: ../tag.template
|
18
|
+
|
19
|
+
source/:
|
20
|
+
index_path: ~
|
21
|
+
|
22
|
+
source/*:
|
23
|
+
template: ../extensions.template
|
24
|
+
|
25
|
+
output/:
|
26
|
+
index_path: ~
|
27
|
+
|
28
|
+
output/*:
|
29
|
+
template: ../extensions.template
|
data/doc/extensions.page
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
title: Extensions
|
3
|
+
---
|
4
|
+
# Extension Listing
|
5
|
+
|
6
|
+
Following is a listing of all available extensions:
|
7
|
+
|
8
|
+
<%
|
9
|
+
pattern = /#{File.join(node.parent.absolute_lcn, '/')}(contentprocessor|output|source|sourcehandler|tag|)\/.*html$/
|
10
|
+
context.content_node.tree.node_access[:alcn].select {|alcn, n| alcn =~ pattern}.sort.each do |alcn, n|
|
11
|
+
next if n.is_fragment?
|
12
|
+
%>
|
13
|
+
* <%= dest_node.link_to(n) %>
|
14
|
+
<%
|
15
|
+
end
|
16
|
+
%>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
--- pipeline:erb,tags,maruku,blocks
|
2
|
+
[Back]({relocatable: extensions.html}) to the extension listing.
|
3
|
+
{.backlink}
|
4
|
+
|
5
|
+
# {title:}
|
6
|
+
|
7
|
+
<% if (context[:chain][1] || context[:chain][0]).node_info[:page].blocks.has_key?('summary') %>
|
8
|
+
## Summary
|
9
|
+
|
10
|
+
<webgen:block name='summary' />
|
11
|
+
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<webgen:block name='content' />
|
15
|
+
|
16
|
+
[Back]({relocatable: extensions.html}) to the extension listing.
|
17
|
+
{.backlink}
|
data/doc/faq.page
ADDED
@@ -0,0 +1,219 @@
|
|
1
|
+
---
|
2
|
+
title: FAQ
|
3
|
+
---
|
4
|
+
# General Questions
|
5
|
+
|
6
|
+
* **webgen fails with an error after upgrading to a newer version - what to do?**
|
7
|
+
|
8
|
+
Delete the cache file and try again. The structure of the cache may not be valid anymore after a
|
9
|
+
version update. So it is always good to delete the cache after installing a new webgen version.
|
10
|
+
|
11
|
+
* **Why can I specify multiple blocks in a page/template file?**
|
12
|
+
|
13
|
+
This allows you to provide different content parts for one page. For example, image you have a
|
14
|
+
layout with a sidebar and you want to have page specific sidebar contents. The easiest way to
|
15
|
+
achieve that is to add a `sidebar` block to the page files that provide a page specific sidebar
|
16
|
+
content and conditionally include the `sidebar` block in your `default.template`, like this:
|
17
|
+
|
18
|
+
<%% if node.node_info[:page].blocks.has_key?('sidebar') %>
|
19
|
+
\<webgen:block name='sidebar' />
|
20
|
+
<%% end %>
|
21
|
+
|
22
|
+
* **What do I have to do to use the extensions?**
|
23
|
+
|
24
|
+
Nothing! Extensions are initialized and used automatically when needed. So, for example, if you
|
25
|
+
add a `my.feed` file to your website, the `Webgen::SourceHandler::Feed` extension gets
|
26
|
+
automatically used. The same is true for all types of extensions (source handler, content
|
27
|
+
processors, tags, ...).
|
28
|
+
|
29
|
+
* **Is there any way to add comments to my webgen website?**
|
30
|
+
|
31
|
+
Surely! There are several comment engines out there, however, the following two look very
|
32
|
+
promising:
|
33
|
+
|
34
|
+
* [JS-Kit](http://js-kit.com/comments/)
|
35
|
+
* [DISQUS](http://disqus.com)
|
36
|
+
|
37
|
+
# How to ...
|
38
|
+
|
39
|
+
This section provides quick answers and links to more information for the most commonly asked
|
40
|
+
questions.
|
41
|
+
|
42
|
+
### ... create a website?
|
43
|
+
|
44
|
+
Use the `webgen` command to create the needed directories
|
45
|
+
|
46
|
+
webgen create -t project -s andreas07 my_site
|
47
|
+
|
48
|
+
This will create a webgen website in the directory `my_site` using the specified template and style.
|
49
|
+
|
50
|
+
### ... set configuration options?
|
51
|
+
|
52
|
+
You can set any configuration options via the configuration file called `config.yaml`. For example,
|
53
|
+
say you want to set the option `website.link_to_current_page` to `true`, then you would add the
|
54
|
+
following to the configuration file:
|
55
|
+
|
56
|
+
website.link_to_current_page: true
|
57
|
+
|
58
|
+
There is a second possibility for webgen tags: you can set the options directly in the tag
|
59
|
+
definition, like this:
|
60
|
+
|
61
|
+
\{menu: {start_level: 2, min_levels: 3}}
|
62
|
+
|
63
|
+
And if you want to have complete control over the configuration options, you can use the file
|
64
|
+
`ext/init.rb`. For example, the following specifies that all page files should be in the menu by
|
65
|
+
default:
|
66
|
+
|
67
|
+
config = Webgen::WebsiteAccess.website.config
|
68
|
+
config['sourcehandler.default_meta_info']['Webgen::SourceHandler::Page']['in_menu'] = true
|
69
|
+
|
70
|
+
### ... change the default language?
|
71
|
+
|
72
|
+
To use, for example, German as the default language, put the following into the configuration file:
|
73
|
+
|
74
|
+
website.lang: de
|
75
|
+
|
76
|
+
The value needs to be a valid ISO-639-1/2 language code.
|
77
|
+
|
78
|
+
### ... use a different processing pipeline for page files?
|
79
|
+
|
80
|
+
If you want to change the processing pipeline (ie. how a page file get rendered), you need to add
|
81
|
+
the following to your configuration file:
|
82
|
+
|
83
|
+
default_processing_pipeline:
|
84
|
+
Page: erb,tags,textile,blocks
|
85
|
+
|
86
|
+
The `default_processing_pipeline` key is a special key which allows to directly set the processing
|
87
|
+
pipeline (instead of going through all the meta information).
|
88
|
+
|
89
|
+
If you just want to change the pipeline for one block, you can do it like this:
|
90
|
+
|
91
|
+
--- pipeline:erb,tags,textile,blocks
|
92
|
+
This is the content of the block
|
93
|
+
|
94
|
+
### ... set the default meta information for files created by a specific source handler?
|
95
|
+
|
96
|
+
Use the configuration file! For example, to change the meta information `in-menu` sothat it defaults
|
97
|
+
to `true` for all page files use the following in your configuration file:
|
98
|
+
|
99
|
+
default_meta_info:
|
100
|
+
Page:
|
101
|
+
inMenu: true
|
102
|
+
|
103
|
+
The key `default_meta_info` is a special key in the configuration file which allows to update the
|
104
|
+
default meta information for a source handler and not to substitute it.
|
105
|
+
|
106
|
+
### ... ignore files in the source directory?
|
107
|
+
|
108
|
+
This can be done using the `sourcehandler.ignore` configuration options. For example, to ignore all
|
109
|
+
files starting with `core`, you would put the following in the configuration file:
|
110
|
+
|
111
|
+
sourcehandler.ignore: [**/core*]
|
112
|
+
|
113
|
+
The value of this option has to be an array of path patterns. Be aware that this overwrites the
|
114
|
+
default setting.
|
115
|
+
|
116
|
+
### ... change the output name style?
|
117
|
+
|
118
|
+
You have several options of varying granularity:
|
119
|
+
|
120
|
+
* Set the meta information `output_path_style` for all source handlers:
|
121
|
+
|
122
|
+
default_meta_info:
|
123
|
+
:all:
|
124
|
+
output_path_style: [:parent, :cnbase, [., :lang], :ext]
|
125
|
+
|
126
|
+
* Set the meta information `output_path_style` for a specific source handler to only change the
|
127
|
+
output paths of this source handler (the page source handler in the following example):
|
128
|
+
|
129
|
+
default_meta_info:
|
130
|
+
Page:
|
131
|
+
output_path_style: [:parent, :cnbase, [., :lang], :ext]
|
132
|
+
|
133
|
+
* Add the meta information `output_path_style` to a single file via, for example, a meta information
|
134
|
+
backing file.
|
135
|
+
|
136
|
+
### ... modify the template chain?
|
137
|
+
|
138
|
+
To stop the template chain at a specific template or even at the page file itself, specify a
|
139
|
+
null template in the meta information, like this:
|
140
|
+
|
141
|
+
template: ~
|
142
|
+
|
143
|
+
To nest templates, you just need to specify the template, in which this template/page file should be
|
144
|
+
nested, in the meta information:
|
145
|
+
|
146
|
+
template: my_special.template
|
147
|
+
|
148
|
+
Be aware that if no `template` meta information is specified for a page or template file, the
|
149
|
+
template handler automatically searches for a default template in the directory and the parent
|
150
|
+
directories of the file!
|
151
|
+
|
152
|
+
### ... localize a directory name?
|
153
|
+
|
154
|
+
Just set the `routed_title` meta information on the correct localized directory index files.
|
155
|
+
|
156
|
+
### ... provide additional attributes on links to a file?
|
157
|
+
|
158
|
+
You can specify additional attributes for a link to a file by using the `link_attrs` meta
|
159
|
+
information. Take the following page file:
|
160
|
+
|
161
|
+
---
|
162
|
+
title: Tutorial
|
163
|
+
in_menu: true
|
164
|
+
link_attrs:
|
165
|
+
title: This is a rather large tutorial
|
166
|
+
accesskey: D
|
167
|
+
tabindex: 5
|
168
|
+
---
|
169
|
+
Yippieh, this is my tutorial!
|
170
|
+
|
171
|
+
When a link to this page is created, the specified attributes get additionally set on the link!
|
172
|
+
|
173
|
+
### ... add page specific sidebar content?
|
174
|
+
|
175
|
+
There are many ways to accomplish this, I will show only one way here using blocks. Add the
|
176
|
+
following to the sidebar part in your `default.template` (ensure that you haven't disabled `erb` in
|
177
|
+
the processing pipeline):
|
178
|
+
|
179
|
+
<%% if node.node_info[:page].blocks.has_key?('sidebar') %>
|
180
|
+
<webgen:block name='sidebar' />
|
181
|
+
<%% end %>
|
182
|
+
|
183
|
+
This will include the contents of the block `sidebar` in the sidebar if such a block exists for a
|
184
|
+
page. You can then add a sidebar block to each page file which needs it. Following is such a sample
|
185
|
+
page file:
|
186
|
+
|
187
|
+
This is the main content block
|
188
|
+
--- name:sidebar
|
189
|
+
This is the sidebar block and everything in here goes to the sidebar!
|
190
|
+
|
191
|
+
You can avoid using the ERB processor if you use the following syntax (available from version 0.5.7
|
192
|
+
upwards):
|
193
|
+
|
194
|
+
<webgen:block name='sidebar' node='first' notfound='ignore' />
|
195
|
+
|
196
|
+
### ... create XML output?
|
197
|
+
|
198
|
+
This can be achieved manually (by removing any markup processor in the processing pipeline of the
|
199
|
+
page file and then directly creating the XML elements) or by changing the processing pipeline to
|
200
|
+
include content processor `builder` which provides an easy way of programmatically creating an XML
|
201
|
+
compliant file. More information on this can be found on the documentation page of
|
202
|
+
Webgen::ContentProcessor::Builder!
|
203
|
+
|
204
|
+
### ... create a static menu?
|
205
|
+
|
206
|
+
You can use virtual nodes to define virtually any menu structure you like, including things like
|
207
|
+
having menu entries that point to the same page and links to external pages.
|
208
|
+
|
209
|
+
### ... use short menu title?
|
210
|
+
|
211
|
+
You can use a special of the meta information `link_attrs` to achieve that. Just use the following
|
212
|
+
in the meta information block of the page file for which you want a short menu title:
|
213
|
+
|
214
|
+
link_attrs:
|
215
|
+
:link_text: Short title
|
216
|
+
|
217
|
+
> Be aware that this changes not only how the page appears in a menu but also how it appears in
|
218
|
+
> breadcrumb trails and other links generated by webgen.
|
219
|
+
{.important}
|
@@ -0,0 +1,135 @@
|
|
1
|
+
---
|
2
|
+
title: Getting Started Guide
|
3
|
+
---
|
4
|
+
## Tutorial: Creating a Basic Website
|
5
|
+
|
6
|
+
|
7
|
+
### Creating the Basic Directories
|
8
|
+
|
9
|
+
webgen needs a special directory structure so that it works out of the box. Basically, you have a
|
10
|
+
website directory under which the following directories are located:
|
11
|
+
|
12
|
+
* `src`: The source directory in which all the source files for the website are.
|
13
|
+
|
14
|
+
* `out`: This directory is created, if it does not exist, when webgen generates the HTML files. All
|
15
|
+
the output files are put into this directory.
|
16
|
+
|
17
|
+
* `ext`: The extension directory (optional). You can put self-written extensions into this directory
|
18
|
+
so that they are used by webgen.
|
19
|
+
|
20
|
+
The directory in which these directories are in is called the *website directory*.
|
21
|
+
|
22
|
+
Don't worry too much about these directories since webgen is able to create the correct directory
|
23
|
+
structure for you. By running the command `webgen create sample_site`, the website directory
|
24
|
+
`sample_site` is created with the default website template and website style. You can naturally use
|
25
|
+
any available template or style by passing their names to the respective options of the `create`
|
26
|
+
command.
|
27
|
+
|
28
|
+
> A *website template* provides a starting point for your website. For example, the `project`
|
29
|
+
> template defines several pages including a features and about page.
|
30
|
+
>
|
31
|
+
> A *website style* defines the look and feel of your website. webgen comes with many predefined
|
32
|
+
> styles (nearly all of them are converted open source web design styles).
|
33
|
+
{.information}
|
34
|
+
|
35
|
+
Don't worry if you don't like the used website style - you can easily change it later using the
|
36
|
+
`webgen apply` command. Have a look at [the examples
|
37
|
+
section](0.4.x/examples/website_styles/index.html) (note: these are still the example from the
|
38
|
+
previous version of webgen but the styles haven't changed) to see demonstrations for all shipped
|
39
|
+
website templates and styles!
|
40
|
+
|
41
|
+
Since the basic parts are now in place, you can generate the HTML files. There are two
|
42
|
+
possibilities:
|
43
|
+
|
44
|
+
* Either you change into the `sample_site` directory and run the command `webgen`.
|
45
|
+
|
46
|
+
* Or you run webgen from any directory and specify the website directory using the `-d` option, for
|
47
|
+
example `webgen -d sample_site`.
|
48
|
+
|
49
|
+
Easy! webgen has used all files in the `src` directory and created the HTML output in the directory
|
50
|
+
`out`. Now you just need to open the `out/index.html` file to view your website! However, as we did
|
51
|
+
not write any content yet, there is not much to see (only the default pages). So let's do that now!
|
52
|
+
|
53
|
+
> Since webgen automatically creates relative links, you will have a fully functional website
|
54
|
+
> without needing a web server! This also implies that you can deploy your website to any directory
|
55
|
+
> on your web server and it will just work!
|
56
|
+
{.information}
|
57
|
+
|
58
|
+
|
59
|
+
### Adding Content
|
60
|
+
|
61
|
+
When using the `create` command, webgen does not only create the needed directories but it also
|
62
|
+
provides you with some default files, you will normally have at least the following ones:
|
63
|
+
|
64
|
+
* `src/default.template`: The default template for the new website.
|
65
|
+
* `src/default.css`: The default css file for the new website.
|
66
|
+
* `src/index.page`: The index file for the root directory of the website.
|
67
|
+
* `config.yaml`: The configuration file for setting configuration options.
|
68
|
+
|
69
|
+
> *Template files* and *page files* are the heart of webgen. Template files are used to define a
|
70
|
+
> general layout for web pages and page files define the real content. Both file types are written
|
71
|
+
> in [Webgen Page Format]({relocatable: webgen_page_format.html}). Page files are normally written
|
72
|
+
> in a markup language like Markdown or Textile which is easier to learn and edit for non-technical
|
73
|
+
> persons.
|
74
|
+
{.information}
|
75
|
+
|
76
|
+
The basic scaffolding is already in place. Now we only have to adapt the page file `index.page` and
|
77
|
+
add other page files.
|
78
|
+
|
79
|
+
All page files are written using the Webgen Page Format. Basically, you have an optional meta
|
80
|
+
information block at the beginning of the file and one or more content blocks. Blocks are separated
|
81
|
+
by three dashes (ie. `---`) on a separate line and if you want to have a meta information block you
|
82
|
+
need to have a block separator line at the beginning of your file.
|
83
|
+
|
84
|
+
Open the file `index.page` in your favorite text editor and change its content (ie. the first
|
85
|
+
content block). After that create a new file, `hello.page`, in the source directory with the
|
86
|
+
following content:
|
87
|
+
|
88
|
+
---
|
89
|
+
title: Sample hello page
|
90
|
+
in_menu: true
|
91
|
+
---
|
92
|
+
This is a sample page with the title "\{title:}" and it is in the menu!!!
|
93
|
+
|
94
|
+
We define two meta information items (namely `title` and `in_menu`) and added some content to the
|
95
|
+
first content block. Run webgen again and open `out/index.html` to view your changes. Add
|
96
|
+
page files and other content to your website and let it grow!
|
97
|
+
|
98
|
+
|
99
|
+
### Adding Dynamic Content
|
100
|
+
|
101
|
+
A static website is, as the name implies, static. However, since we generate the website it is
|
102
|
+
possible to add some dynamicity to it. For example, it gets very tedious to update menu links every
|
103
|
+
time we add a file that should be in the menu.
|
104
|
+
|
105
|
+
Therefore webgen provides two ways to add dynamic content out of the box:
|
106
|
+
|
107
|
+
* *ERB*: This term stands for "embedded ruby". It means that you can embed ruby statements in page
|
108
|
+
and templates files that get evaluated when the files are rendered.
|
109
|
+
|
110
|
+
* *webgen tags*: These are a way to add dynamic content without knowing a programming language
|
111
|
+
(although limiting you to the existing tags). You just state what tag you want to use and it does
|
112
|
+
its job. For example, there exists a very flexible menu generation tag.
|
113
|
+
|
114
|
+
You have already encountered a webgen tag in the last section when you created the `hello.page`
|
115
|
+
file: the `\{title:}` part. webgen tags can generally be specified like this: `\{tagname: {param:
|
116
|
+
value, param2: value2}}`. For detailed information on tags have a look at the
|
117
|
+
[Webgen::ContentProcessor::Tags]({relocatable: contentprocessor/tags.html}) documentation.
|
118
|
+
|
119
|
+
|
120
|
+
### Setting configuration options
|
121
|
+
|
122
|
+
webgen provides a default configuration out of the box. If you can live with that, you do not need
|
123
|
+
to change any configuration option. However, most users need to change some configuration option
|
124
|
+
sometime. The configuration file is called `config.yaml` and has to be placed directly under the
|
125
|
+
website directory. It uses YAML as file format.
|
126
|
+
|
127
|
+
> Have a look at the [Configuration Options Reference]({relocatable: reference_configuration.html})
|
128
|
+
> to get an overview over all available configuration options.
|
129
|
+
{.information}
|
130
|
+
|
131
|
+
Each configuration option can be set in the configuration file by specifing the configuration option
|
132
|
+
name and the new value as a key/value pair. A sample configuration file looks like this:
|
133
|
+
|
134
|
+
website.lang: de
|
135
|
+
website.link_to_current_page: true
|
data/doc/index.page
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
title: Overview
|
3
|
+
in_menu: false
|
4
|
+
---
|
5
|
+
|
6
|
+
This documentation is for the *repository version*{: style='color: red; font-weight: bold'} of
|
7
|
+
webgen and therefore may state features that are not available in the latest released version.
|
8
|
+
|
9
|
+
* The documentation for the *latest released 0.5.x*{: style='color: red; font-weight: bold'} version
|
10
|
+
can be found [here](http://webgen.rubyforge.org/documentation/0.5.x/index.html)
|
11
|
+
|
12
|
+
* If you are looking for the documentation of the *0.4.x*{: style='color: red; font-weight: bold'}
|
13
|
+
series, it can be found [here](http://webgen.rubyforge.org/documentation/0.4.x/index.html).
|
14
|
+
|
15
|
+
If you don't find an answer to your questions in the documentation, there are also:
|
16
|
+
|
17
|
+
* [forums][forum] hosted on Rubyforge
|
18
|
+
* [mailing lists][ml] hosted on Rubyforge (the `webgen-users` mailing list is mirrored to the
|
19
|
+
[webgen-users google group][google-group])
|
20
|
+
* the IRC channel `#webgen` on Freenode where I can be found whenever I'm online.
|
21
|
+
|
22
|
+
[forum]: http://rubyforge.org/forum/?group_id=296
|
23
|
+
[ml]: http://rubyforge.org/mail/?group_id=296
|
24
|
+
[google-group]: http://groups.google.com/group/webgen-users/
|
25
|
+
|
26
|
+
# User Documentation
|
27
|
+
|
28
|
+
Depending on whether you are new to webgen, you want more information about a specific topic or read
|
29
|
+
a reference, go to one of the following pages:
|
30
|
+
|
31
|
+
* [**Getting Started Guide**]({relocatable: getting_started.html}): If you are new to webgen, this
|
32
|
+
should be your first read. It explains the usage of the CLI command and how to create your first
|
33
|
+
website with webgen.
|
34
|
+
|
35
|
+
* [**Manual**]({relocatable: manual.html}): Detailed information about how webgen works can be found
|
36
|
+
here. After reading the Getting Started Guide, this should be the next read. Have a look at the
|
37
|
+
section headers to get a quick overview of what can be found here.
|
38
|
+
|
39
|
+
* [**FAQ**]({relocatable: faq.html}): If you want to do something with webgen, but you don't know
|
40
|
+
how, this page is exactly for you. It provides answers to frequently asked questions and
|
41
|
+
HowTos. If you have a question which you think should be added, just mail me.
|
42
|
+
|
43
|
+
* [**Upgrade information**]({relocatable: upgrading.html}): This document provides some information
|
44
|
+
on upgrading a website from the 0.4.x to the 0.5.x series.
|
45
|
+
|
46
|
+
|
47
|
+
Following is a list of all the reference documentation of webgen:
|
48
|
+
|
49
|
+
* [**Extensions Documentation**]({relocatable: extensions.html}): Detailed information on every usage
|
50
|
+
related extension class (**source handlers, tags, content processors**, ...)
|
51
|
+
|
52
|
+
* [**Webgen Page Format**]({relocatable: webgen_page_format.html}): Information about/Specification of
|
53
|
+
the format used, for example, by page and template files
|
54
|
+
|
55
|
+
* [**Meta Information Reference**]({relocatable: reference_metainfo.html}): Descriptions for every
|
56
|
+
meta information key that is used by webgen.
|
57
|
+
|
58
|
+
* [**Configuration Options Reference**]({relocatable: reference_configuration.html}): Overview of all
|
59
|
+
configuration options.
|
60
|
+
|
61
|
+
# Developer Documentation
|
62
|
+
|
63
|
+
webgen makes it easy to extend its functionality by writing simple extension classes. All
|
64
|
+
information about how to do this is provided in the [API documentation](rdoc/index.html). You will
|
65
|
+
also find examples for all existing extension types there.
|