gettalong-webgen 0.5.4.20080929
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +5 -0
- data/COPYING +10 -0
- data/GPL +340 -0
- data/Rakefile +324 -0
- data/THANKS +17 -0
- data/bin/webgen +10 -0
- data/data/webgen/resources.yaml +3 -0
- data/data/webgen/webgui/controller/main.rb +129 -0
- data/data/webgen/webgui/overrides/win32console.rb +0 -0
- data/data/webgen/webgui/public/css/jquery.autocomplete.css +50 -0
- data/data/webgen/webgui/public/css/ramaze_error.css +90 -0
- data/data/webgen/webgui/public/css/style.css +55 -0
- data/data/webgen/webgui/public/img/headerbg.jpg +0 -0
- data/data/webgen/webgui/public/img/webgen_logo.png +0 -0
- data/data/webgen/webgui/public/js/jquery.autocomplete.js +15 -0
- data/data/webgen/webgui/public/js/jquery.js +32 -0
- data/data/webgen/webgui/view/create_website.xhtml +22 -0
- data/data/webgen/webgui/view/error.xhtml +64 -0
- data/data/webgen/webgui/view/index.xhtml +22 -0
- data/data/webgen/webgui/view/manage_website.xhtml +18 -0
- data/data/webgen/webgui/view/page.xhtml +40 -0
- data/data/webgen/website_skeleton/README +10 -0
- data/data/webgen/website_skeleton/Rakefile +40 -0
- data/data/webgen/website_skeleton/config.yaml +17 -0
- data/data/webgen/website_skeleton/ext/init.rb +6 -0
- data/data/webgen/website_styles/1024px/README +13 -0
- data/data/webgen/website_styles/1024px/src/default.css +188 -0
- data/data/webgen/website_styles/1024px/src/default.template +60 -0
- data/data/webgen/website_styles/1024px/src/images/background.gif +0 -0
- data/data/webgen/website_styles/andreas00/README +13 -0
- data/data/webgen/website_styles/andreas00/src/default.css +290 -0
- data/data/webgen/website_styles/andreas00/src/default.template +60 -0
- data/data/webgen/website_styles/andreas00/src/images/bg.gif +0 -0
- data/data/webgen/website_styles/andreas00/src/images/front.jpg +0 -0
- data/data/webgen/website_styles/andreas00/src/images/menubg.gif +0 -0
- data/data/webgen/website_styles/andreas00/src/images/menubg2.gif +0 -0
- data/data/webgen/website_styles/andreas01/README +14 -0
- data/data/webgen/website_styles/andreas01/src/default.css +310 -0
- data/data/webgen/website_styles/andreas01/src/default.template +61 -0
- data/data/webgen/website_styles/andreas01/src/images/bg.gif +0 -0
- data/data/webgen/website_styles/andreas01/src/images/front.jpg +0 -0
- data/data/webgen/website_styles/andreas01/src/print.css +35 -0
- data/data/webgen/website_styles/andreas03/README +14 -0
- data/data/webgen/website_styles/andreas03/src/default.css +223 -0
- data/data/webgen/website_styles/andreas03/src/default.template +58 -0
- data/data/webgen/website_styles/andreas03/src/images/bodybg.png +0 -0
- data/data/webgen/website_styles/andreas03/src/images/contbg.png +0 -0
- data/data/webgen/website_styles/andreas03/src/images/footerbg.png +0 -0
- data/data/webgen/website_styles/andreas03/src/images/gradient1.png +0 -0
- data/data/webgen/website_styles/andreas03/src/images/gradient2.png +0 -0
- data/data/webgen/website_styles/andreas04/README +15 -0
- data/data/webgen/website_styles/andreas04/src/default.css +290 -0
- data/data/webgen/website_styles/andreas04/src/default.template +81 -0
- data/data/webgen/website_styles/andreas04/src/images/blinkarrow.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/bodybg.png +0 -0
- data/data/webgen/website_styles/andreas04/src/images/contentbg.png +0 -0
- data/data/webgen/website_styles/andreas04/src/images/entrybg.png +0 -0
- data/data/webgen/website_styles/andreas04/src/images/flash.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/flash2.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/globe.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/globebottom.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/linkarrow.gif +0 -0
- data/data/webgen/website_styles/andreas04/src/images/menuhover.png +0 -0
- data/data/webgen/website_styles/andreas05/README +14 -0
- data/data/webgen/website_styles/andreas05/src/default.css +33 -0
- data/data/webgen/website_styles/andreas05/src/default.template +40 -0
- data/data/webgen/website_styles/andreas05/src/images/bodybg.gif +0 -0
- data/data/webgen/website_styles/andreas05/src/images/front.png +0 -0
- data/data/webgen/website_styles/andreas06/README +14 -0
- data/data/webgen/website_styles/andreas06/src/default.css +354 -0
- data/data/webgen/website_styles/andreas06/src/default.template +70 -0
- data/data/webgen/website_styles/andreas06/src/images/bodybg.gif +0 -0
- data/data/webgen/website_styles/andreas06/src/images/boxbg.gif +0 -0
- data/data/webgen/website_styles/andreas06/src/images/greypx.gif +0 -0
- data/data/webgen/website_styles/andreas06/src/images/header.jpg +0 -0
- data/data/webgen/website_styles/andreas06/src/images/innerbg.gif +0 -0
- data/data/webgen/website_styles/andreas06/src/images/leaves.jpg +0 -0
- data/data/webgen/website_styles/andreas06/src/images/tabs.gif +0 -0
- data/data/webgen/website_styles/andreas07/README +15 -0
- data/data/webgen/website_styles/andreas07/src/browserfix.css +7 -0
- data/data/webgen/website_styles/andreas07/src/default.css +92 -0
- data/data/webgen/website_styles/andreas07/src/default.template +42 -0
- data/data/webgen/website_styles/andreas07/src/images/bodybg.gif +0 -0
- data/data/webgen/website_styles/andreas07/src/images/sidebarbg.gif +0 -0
- data/data/webgen/website_styles/andreas08/README +14 -0
- data/data/webgen/website_styles/andreas08/src/default.css +224 -0
- data/data/webgen/website_styles/andreas08/src/default.template +51 -0
- data/data/webgen/website_styles/andreas09/README +14 -0
- data/data/webgen/website_styles/andreas09/src/default.css +308 -0
- data/data/webgen/website_styles/andreas09/src/default.template +68 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg-black.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg-green.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg-orange.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg-purple.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg-red.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/bodybg.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/footerbg.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover-black.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover-green.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover-orange.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover-purple.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover-red.jpg +0 -0
- data/data/webgen/website_styles/andreas09/src/images/menuhover.jpg +0 -0
- data/data/webgen/website_styles/simple/README +6 -0
- data/data/webgen/website_styles/simple/src/default.css +84 -0
- data/data/webgen/website_styles/simple/src/default.template +36 -0
- data/data/webgen/website_templates/default/README +6 -0
- data/data/webgen/website_templates/default/src/index.page +8 -0
- data/data/webgen/website_templates/project/README +5 -0
- data/data/webgen/website_templates/project/src/about.page +12 -0
- data/data/webgen/website_templates/project/src/download.page +15 -0
- data/data/webgen/website_templates/project/src/features.page +8 -0
- data/data/webgen/website_templates/project/src/index.page +9 -0
- data/data/webgen/website_templates/project/src/screenshots.page +18 -0
- data/doc/contentprocessor.template +11 -0
- data/doc/contentprocessor/blocks.page +66 -0
- data/doc/contentprocessor/builder.page +80 -0
- data/doc/contentprocessor/erb.page +56 -0
- data/doc/contentprocessor/erubis.page +46 -0
- data/doc/contentprocessor/haml.page +47 -0
- data/doc/contentprocessor/maruku.page +41 -0
- data/doc/contentprocessor/rdiscount.page +37 -0
- data/doc/contentprocessor/rdoc.page +36 -0
- data/doc/contentprocessor/redcloth.page +39 -0
- data/doc/contentprocessor/sass.page +31 -0
- data/doc/contentprocessor/tags.page +73 -0
- data/doc/extensions.metainfo +29 -0
- data/doc/extensions.page +16 -0
- data/doc/extensions.template +17 -0
- data/doc/faq.page +214 -0
- data/doc/getting_started.page +134 -0
- data/doc/index.page +65 -0
- data/doc/manual.page +532 -0
- data/doc/reference_configuration.page +646 -0
- data/doc/reference_metainfo.page +213 -0
- data/doc/sourcehandler.template +21 -0
- data/doc/sourcehandler/copy.page +19 -0
- data/doc/sourcehandler/directory.page +27 -0
- data/doc/sourcehandler/feed.page +82 -0
- data/doc/sourcehandler/metainfo.page +41 -0
- data/doc/sourcehandler/page.page +30 -0
- data/doc/sourcehandler/sitemap.page +46 -0
- data/doc/sourcehandler/template.page +45 -0
- data/doc/sourcehandler/virtual.page +49 -0
- data/doc/tag.template +25 -0
- data/doc/tag/breadcrumbtrail.page +40 -0
- data/doc/tag/coderay.page +49 -0
- data/doc/tag/date.page +31 -0
- data/doc/tag/executecommand.page +26 -0
- data/doc/tag/includefile.page +32 -0
- data/doc/tag/langbar.page +22 -0
- data/doc/tag/menu.page +92 -0
- data/doc/tag/metainfo.page +29 -0
- data/doc/tag/relocatable.page +38 -0
- data/doc/tag/sitemap.page +31 -0
- data/doc/upgrading.page +139 -0
- data/doc/webgen_page_format.page +128 -0
- data/lib/webgen/blackboard.rb +73 -0
- data/lib/webgen/cache.rb +85 -0
- data/lib/webgen/cli.rb +118 -0
- data/lib/webgen/cli/create_command.rb +64 -0
- data/lib/webgen/cli/run_command.rb +20 -0
- data/lib/webgen/cli/utils.rb +86 -0
- data/lib/webgen/cli/webgui_command.rb +49 -0
- data/lib/webgen/common.rb +10 -0
- data/lib/webgen/common/sitemap.rb +76 -0
- data/lib/webgen/configuration.rb +147 -0
- data/lib/webgen/contentprocessor.rb +96 -0
- data/lib/webgen/contentprocessor/blocks.rb +46 -0
- data/lib/webgen/contentprocessor/builder.rb +26 -0
- data/lib/webgen/contentprocessor/context.rb +90 -0
- data/lib/webgen/contentprocessor/erb.rb +24 -0
- data/lib/webgen/contentprocessor/erubis.rb +40 -0
- data/lib/webgen/contentprocessor/haml.rb +25 -0
- data/lib/webgen/contentprocessor/maruku.rb +18 -0
- data/lib/webgen/contentprocessor/rdiscount.rb +15 -0
- data/lib/webgen/contentprocessor/rdoc.rb +17 -0
- data/lib/webgen/contentprocessor/redcloth.rb +15 -0
- data/lib/webgen/contentprocessor/sass.rb +18 -0
- data/lib/webgen/contentprocessor/tags.rb +134 -0
- data/lib/webgen/coreext.rb +10 -0
- data/lib/webgen/default_config.rb +198 -0
- data/lib/webgen/languages.rb +578 -0
- data/lib/webgen/loggable.rb +23 -0
- data/lib/webgen/logger.rb +78 -0
- data/lib/webgen/node.rb +347 -0
- data/lib/webgen/output.rb +37 -0
- data/lib/webgen/output/filesystem.rb +67 -0
- data/lib/webgen/page.rb +133 -0
- data/lib/webgen/path.rb +182 -0
- data/lib/webgen/source.rb +24 -0
- data/lib/webgen/source/filesystem.rb +58 -0
- data/lib/webgen/source/resource.rb +42 -0
- data/lib/webgen/source/stacked.rb +53 -0
- data/lib/webgen/sourcehandler.rb +202 -0
- data/lib/webgen/sourcehandler/base.rb +211 -0
- data/lib/webgen/sourcehandler/copy.rb +41 -0
- data/lib/webgen/sourcehandler/directory.rb +31 -0
- data/lib/webgen/sourcehandler/feed.rb +121 -0
- data/lib/webgen/sourcehandler/fragment.rb +71 -0
- data/lib/webgen/sourcehandler/metainfo.rb +117 -0
- data/lib/webgen/sourcehandler/page.rb +77 -0
- data/lib/webgen/sourcehandler/sitemap.rb +60 -0
- data/lib/webgen/sourcehandler/template.rb +68 -0
- data/lib/webgen/sourcehandler/virtual.rb +75 -0
- data/lib/webgen/tag.rb +23 -0
- data/lib/webgen/tag/base.rb +162 -0
- data/lib/webgen/tag/breadcrumbtrail.rb +71 -0
- data/lib/webgen/tag/coderay.rb +32 -0
- data/lib/webgen/tag/date.rb +18 -0
- data/lib/webgen/tag/executecommand.rb +29 -0
- data/lib/webgen/tag/includefile.rb +42 -0
- data/lib/webgen/tag/langbar.rb +52 -0
- data/lib/webgen/tag/menu.rb +186 -0
- data/lib/webgen/tag/metainfo.rb +25 -0
- data/lib/webgen/tag/relocatable.rb +53 -0
- data/lib/webgen/tag/sitemap.rb +42 -0
- data/lib/webgen/tree.rb +80 -0
- data/lib/webgen/version.rb +6 -0
- data/lib/webgen/webgentask.rb +148 -0
- data/lib/webgen/website.rb +214 -0
- data/lib/webgen/websiteaccess.rb +29 -0
- data/lib/webgen/websitemanager.rb +125 -0
- data/man/man1/webgen.1 +67 -0
- data/misc/default.css +360 -0
- data/misc/default.template +75 -0
- data/misc/htmldoc.metainfo +25 -0
- data/misc/htmldoc.virtual +5 -0
- data/misc/images/arrow.gif +0 -0
- data/misc/images/error.gif +0 -0
- data/misc/images/exclamation.gif +0 -0
- data/misc/images/headerbg.jpg +0 -0
- data/misc/images/information.gif +0 -0
- data/misc/images/quote.gif +0 -0
- data/setup.rb +1585 -0
- data/test/helper.rb +41 -0
- data/test/test_blackboard.rb +58 -0
- data/test/test_cache.rb +57 -0
- data/test/test_common_sitemap.rb +56 -0
- data/test/test_configuration.rb +66 -0
- data/test/test_contentprocessor.rb +31 -0
- data/test/test_contentprocessor_blocks.rb +34 -0
- data/test/test_contentprocessor_builder.rb +19 -0
- data/test/test_contentprocessor_context.rb +38 -0
- data/test/test_contentprocessor_erb.rb +20 -0
- data/test/test_contentprocessor_erubis.rb +47 -0
- data/test/test_contentprocessor_haml.rb +20 -0
- data/test/test_contentprocessor_maruku.rb +27 -0
- data/test/test_contentprocessor_rdiscount.rb +15 -0
- data/test/test_contentprocessor_rdoc.rb +16 -0
- data/test/test_contentprocessor_redcloth.rb +12 -0
- data/test/test_contentprocessor_sass.rb +20 -0
- data/test/test_contentprocessor_tags.rb +97 -0
- data/test/test_languages.rb +53 -0
- data/test/test_loggable.rb +30 -0
- data/test/test_logger.rb +73 -0
- data/test/test_node.rb +339 -0
- data/test/test_output_filesystem.rb +58 -0
- data/test/test_page.rb +203 -0
- data/test/test_path.rb +131 -0
- data/test/test_source_filesystem.rb +59 -0
- data/test/test_source_resource.rb +26 -0
- data/test/test_source_stacked.rb +34 -0
- data/test/test_sourcehandler_base.rb +92 -0
- data/test/test_sourcehandler_copy.rb +45 -0
- data/test/test_sourcehandler_directory.rb +25 -0
- data/test/test_sourcehandler_feed.rb +74 -0
- data/test/test_sourcehandler_fragment.rb +67 -0
- data/test/test_sourcehandler_metainfo.rb +93 -0
- data/test/test_sourcehandler_page.rb +70 -0
- data/test/test_sourcehandler_sitemap.rb +47 -0
- data/test/test_sourcehandler_template.rb +63 -0
- data/test/test_sourcehandler_virtual.rb +56 -0
- data/test/test_tag_base.rb +82 -0
- data/test/test_tag_breadcrumbtrail.rb +89 -0
- data/test/test_tag_coderay.rb +30 -0
- data/test/test_tag_date.rb +16 -0
- data/test/test_tag_executecommand.rb +39 -0
- data/test/test_tag_includefile.rb +48 -0
- data/test/test_tag_langbar.rb +60 -0
- data/test/test_tag_menu.rb +195 -0
- data/test/test_tag_metainfo.rb +17 -0
- data/test/test_tag_relocatable.rb +57 -0
- data/test/test_tag_sitemap.rb +44 -0
- data/test/test_tree.rb +69 -0
- data/test/test_webgentask.rb +21 -0
- data/test/test_website.rb +96 -0
- data/test/test_websiteaccess.rb +23 -0
- data/test/test_websitemanager.rb +68 -0
- metadata +575 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
module Webgen
|
2
|
+
|
3
|
+
# Mixed into modules/classes that need access to the current website object.
|
4
|
+
module WebsiteAccess
|
5
|
+
|
6
|
+
# The methods of this module are available on classes that include WebsiteAccess.
|
7
|
+
module ClassMethods
|
8
|
+
|
9
|
+
# See WebsiteAccess.website
|
10
|
+
def website
|
11
|
+
WebsiteAccess.website
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.included(klass) #:nodoc:
|
17
|
+
super
|
18
|
+
klass.extend(ClassMethods)
|
19
|
+
end
|
20
|
+
|
21
|
+
# Return the current website object or +nil+.
|
22
|
+
def website
|
23
|
+
Thread.current[:webgen_website]
|
24
|
+
end
|
25
|
+
module_function :website
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'webgen/website'
|
4
|
+
|
5
|
+
module Webgen
|
6
|
+
|
7
|
+
# This class is used for managing webgen websites. It provides access to website templates and
|
8
|
+
# styles defined as resources and makes it easy to apply them to a webgen website.
|
9
|
+
#
|
10
|
+
# = General information
|
11
|
+
#
|
12
|
+
# Currently, the following actions are supported:
|
13
|
+
#
|
14
|
+
# * creating a website based on a website template (#create_website)
|
15
|
+
# * applying a template to an existing website (#apply_template)
|
16
|
+
# * applying a style to an existing website (#apply_style)
|
17
|
+
#
|
18
|
+
# A website template defines some initial pages which should be filled with real data. For
|
19
|
+
# example, the @project@ template defines several pages which are useful for software projects
|
20
|
+
# including a features and about page.
|
21
|
+
#
|
22
|
+
# A style defines, for example, the basic page layout (in the case of website styles) or how image
|
23
|
+
# galleries should look like (in the case of gallery styles). So styles are basically used to
|
24
|
+
# change the appearance of parts (or the whole) website. This makes them a powerful tool as this
|
25
|
+
# plugin makes it easy to change a style later!
|
26
|
+
#
|
27
|
+
# = website template and style resource naming convention
|
28
|
+
#
|
29
|
+
# Styles and website templates are defined using resources. Each such resource has to be a
|
30
|
+
# directory containing an optional README file in YAML format in which key-value pairs provide
|
31
|
+
# additional information about the style or website template. All other files/directories in the
|
32
|
+
# directory are copied to the root of the destination webgen website when the style or website
|
33
|
+
# template is used.
|
34
|
+
#
|
35
|
+
# This class uses a special naming convention to recognize website templates and styles:
|
36
|
+
#
|
37
|
+
# * A resource named <tt>webgen-website-template-TEMPLATE_NAME</tt> is considered to be a website
|
38
|
+
# template called TEMPLATE_NAME and can be later accessed using this name.
|
39
|
+
#
|
40
|
+
# * A resource named <tt>webgen-website-style-CATEGORY-STYLE_NAME</tt> is considered to be a style
|
41
|
+
# in the category CATEGORY called STYLE_NAME. There are no fixed categories, one can use
|
42
|
+
# anything here! Again, the style can later be accessed by providing the category and style
|
43
|
+
# name.
|
44
|
+
#
|
45
|
+
# Website template names have to be unique and style names have to be unique in respect to their
|
46
|
+
# categories!
|
47
|
+
#
|
48
|
+
# Note: All styles without a category or which are in the category 'website' are website styles.
|
49
|
+
class WebsiteManager
|
50
|
+
|
51
|
+
# A hash with the available website templates (mapping name to infos).
|
52
|
+
attr_reader :templates
|
53
|
+
|
54
|
+
# A hash with the available website styles (mapping name to infos).
|
55
|
+
attr_reader :styles
|
56
|
+
|
57
|
+
# The used Website object.
|
58
|
+
attr_reader :website
|
59
|
+
|
60
|
+
# Create a new WebsiteManager for the website +dir+.
|
61
|
+
def initialize(dir)
|
62
|
+
@website = Webgen::Website.new(dir)
|
63
|
+
@website.init
|
64
|
+
@styles = {}
|
65
|
+
@templates = {}
|
66
|
+
|
67
|
+
@website.execute_in_env do
|
68
|
+
[['webgen-website-style-', @styles], ['webgen-website-template-', @templates]].each do |prefix, var|
|
69
|
+
@website.config['resources'].select {|name, data| name =~ /^#{prefix}/}.each do |name, data|
|
70
|
+
paths = Webgen::Source::Resource.new(name).paths
|
71
|
+
readme = paths.select {|path| path == '/README' }.first
|
72
|
+
paths.delete(readme) if readme
|
73
|
+
infos = OpenStruct.new(readme.nil? ? {} : YAML::load(readme.io.data))
|
74
|
+
infos.paths = paths
|
75
|
+
var[name.sub(prefix, '')] = infos
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Create the basic website skeleton (without any template or style applied).
|
82
|
+
def create_website
|
83
|
+
raise "Directory <#{@website.directory}> does already exist!" if File.exists?(@website.directory)
|
84
|
+
@website.execute_in_env { write_paths(Webgen::Source::Resource.new('webgen-website-skeleton').paths) }
|
85
|
+
end
|
86
|
+
|
87
|
+
# Apply the given +template+ to the website by copying the template files.
|
88
|
+
def apply_template(name)
|
89
|
+
write_paths_to_website(@templates[name], 'template')
|
90
|
+
end
|
91
|
+
|
92
|
+
# Apply the given website style +name+ to the website by copying the styles files.
|
93
|
+
def apply_style(name)
|
94
|
+
write_paths_to_website(@styles[name], 'style')
|
95
|
+
end
|
96
|
+
|
97
|
+
#######
|
98
|
+
private
|
99
|
+
#######
|
100
|
+
|
101
|
+
# Do some sanity checks and write the +paths+ from +infos+ to the website directory.
|
102
|
+
def write_paths_to_website(infos, infos_type)
|
103
|
+
raise ArgumentError.new("Invalid #{infos_type} name") if infos.nil?
|
104
|
+
raise "Directory <#{@website.directory}> does not exist!" unless File.exists?(@website.directory)
|
105
|
+
write_paths(infos.paths)
|
106
|
+
end
|
107
|
+
|
108
|
+
# Write the paths to the website directory.
|
109
|
+
def write_paths(paths)
|
110
|
+
paths.each do |path|
|
111
|
+
output_path = File.join(@website.directory, path.path)
|
112
|
+
if path.path =~ /\/$/
|
113
|
+
FileUtils.mkdir_p(output_path)
|
114
|
+
else
|
115
|
+
FileUtils.mkdir_p(File.dirname(output_path))
|
116
|
+
path.io.stream do |source|
|
117
|
+
File.open(output_path, 'wb') {|f| FileUtils.copy_stream(source, f) }
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
124
|
+
|
125
|
+
end
|
data/man/man1/webgen.1
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
.TH "WEBGEN" 1 "July 2008"
|
2
|
+
.SH NAME
|
3
|
+
webgen \- a fast, powerful and extensible static website generator
|
4
|
+
.SH SYNOPSIS
|
5
|
+
.B webgen
|
6
|
+
[\fIglobal options\fR]
|
7
|
+
\fIcommand\fR
|
8
|
+
[\fIcommand arguments\fR] [command [command arguments] ...] [args]
|
9
|
+
.SH DESCRIPTION
|
10
|
+
webgen is used to generate static websites from content files written in a markup language and
|
11
|
+
template files. You create one template file in which you define the layout of your pages and where
|
12
|
+
the content should go. After that you create content files called page files in which you only
|
13
|
+
define the content. webgen merges the page's content into the template and generates the final HTML
|
14
|
+
output. During the last step so called webgen tags are substituted so that, for example, menus can
|
15
|
+
automatically be generated.
|
16
|
+
.SH GLOBAL OPTIONS
|
17
|
+
.TP
|
18
|
+
.B \-d, \-\-directory DIR
|
19
|
+
Set the website directectory. if none specified, the current directory is used.
|
20
|
+
.TP
|
21
|
+
.B \-v, \-\-verbose
|
22
|
+
Show more output by default.
|
23
|
+
.TP
|
24
|
+
.B \-q, \-\-quiet
|
25
|
+
Show less output by default. If this option is specified, then no output is shown during rendering
|
26
|
+
of a website.
|
27
|
+
.TP
|
28
|
+
.B \-l, \-\-log-level LEVEL
|
29
|
+
Set the logging level to LEVEL which can be a number between 0 (debug output) and 3 (only error
|
30
|
+
output).
|
31
|
+
.TP
|
32
|
+
.B \-h, \-\-help
|
33
|
+
Show generic help.
|
34
|
+
.TP
|
35
|
+
.B \-\-version
|
36
|
+
Show the version of the program and exit.
|
37
|
+
.SH COMMANDS
|
38
|
+
.TP
|
39
|
+
\fBcreate\fR
|
40
|
+
Creates the basic directories and files for webgen. This includes the source and
|
41
|
+
output directories as well as an empty extensions directory. Also, a basic template plus a CSS and
|
42
|
+
an index file are created. Takes the \fIdirectory\fR to create the webgen structure in as an
|
43
|
+
argument.
|
44
|
+
.TP
|
45
|
+
\fBhelp\fR
|
46
|
+
Provides help for the individual commands.
|
47
|
+
.TP
|
48
|
+
\fBrender\fR
|
49
|
+
Runs webgen which will result in the generation of the HTML data in the output
|
50
|
+
directory from the files in the source directory. This command is used as the default command when
|
51
|
+
no command was issued.
|
52
|
+
.TP
|
53
|
+
\fBversion\fR
|
54
|
+
Shows the version of the program and exit.
|
55
|
+
.TP
|
56
|
+
\fBwebgui\fR
|
57
|
+
Starts the webgen webgui, a browser based graphical user interface for manging webgen websites.
|
58
|
+
.SH SEE ALSO
|
59
|
+
The webgen website, http://webgen.rubyforge.org/ for more information.
|
60
|
+
.SH AUTHOR
|
61
|
+
webgen was written by Thomas Leitner <t_leitner@gmx.at>
|
62
|
+
.PP
|
63
|
+
This manual page was written by Paul van Tilburg <paulvt@debian.org> for the Debian project (but may
|
64
|
+
be used by others). This manual page was update to reflect webgen 0.4 change by Arnaud Cornet
|
65
|
+
<arnaud.cornet@gmail.com>. This manual page was updated to reflect webgen 0.5.x changes by Thomas
|
66
|
+
Leitner <t_leitner@gmx.at>.
|
67
|
+
|
data/misc/default.css
ADDED
@@ -0,0 +1,360 @@
|
|
1
|
+
/********************************************
|
2
|
+
AUTHOR: Erwin Aligam
|
3
|
+
WEBSITE: http://www.styleshout.com/
|
4
|
+
TEMPLATE NAME: ablaze
|
5
|
+
TEMPLATE CODE: S-0009
|
6
|
+
VERSION: 2.1
|
7
|
+
*******************************************/
|
8
|
+
|
9
|
+
/********************************************
|
10
|
+
HTML ELEMENTS
|
11
|
+
|
12
|
+
********************************************/
|
13
|
+
|
14
|
+
/* top elements */
|
15
|
+
* {
|
16
|
+
padding: 0;
|
17
|
+
margin: 0;
|
18
|
+
}
|
19
|
+
|
20
|
+
body {
|
21
|
+
margin: 0;
|
22
|
+
padding: 0;
|
23
|
+
font: normal .80em/1.5em Tahoma, 'Trebuchet MS', sans-serif;
|
24
|
+
color: #000;
|
25
|
+
text-align: center;
|
26
|
+
background-color: #FCFFF5;
|
27
|
+
}
|
28
|
+
|
29
|
+
/* links */
|
30
|
+
a {
|
31
|
+
color: #3E606F;
|
32
|
+
background-color: inherit;
|
33
|
+
text-decoration: underline;
|
34
|
+
}
|
35
|
+
|
36
|
+
a:hover {
|
37
|
+
color: #193441;
|
38
|
+
background-color: #D1DBBD;
|
39
|
+
}
|
40
|
+
|
41
|
+
/* headers */
|
42
|
+
h1, h2, h3, h4, h5, h6 {
|
43
|
+
font: bold 1.3em 'Trebuchet MS', Arial, Sans-serif;
|
44
|
+
color: #CE900A;
|
45
|
+
}
|
46
|
+
h1 { font-size: 1.6em; }
|
47
|
+
h2 { font-size: 1.4em; color: #A0080D }
|
48
|
+
h3 { font-size: 1.3em; }
|
49
|
+
|
50
|
+
#main h1 {
|
51
|
+
color: #193441;
|
52
|
+
padding-top: 15px;
|
53
|
+
}
|
54
|
+
|
55
|
+
#sidebar h1 {
|
56
|
+
font: bold 1.4em 'Trebuchet MS', Arial, Sans-serif;
|
57
|
+
background: url(images/arrow.gif) no-repeat 0px .6em;
|
58
|
+
padding: 7px 0 7px 25px;
|
59
|
+
color: #193441;
|
60
|
+
}
|
61
|
+
|
62
|
+
p, h1, h2, h3 {
|
63
|
+
margin: 0;
|
64
|
+
padding: 5px 0px;
|
65
|
+
}
|
66
|
+
|
67
|
+
ul, ol {
|
68
|
+
margin: 10px 0px;
|
69
|
+
padding: 0 15px;
|
70
|
+
color: #000; /* #3E606F; */
|
71
|
+
}
|
72
|
+
|
73
|
+
/* images */
|
74
|
+
img {
|
75
|
+
border: none;
|
76
|
+
}
|
77
|
+
|
78
|
+
pre {
|
79
|
+
margin: 5px 0px;
|
80
|
+
padding: 5px;
|
81
|
+
text-align: left;
|
82
|
+
overflow: auto;
|
83
|
+
font: 'Lucida Console', 'courier new', monospace;
|
84
|
+
color: #193441;
|
85
|
+
background: #D1DBBD;
|
86
|
+
border-bottom: 1px solid #91AA9D;
|
87
|
+
border-top: 1px solid #91AA9D;
|
88
|
+
}
|
89
|
+
|
90
|
+
code {
|
91
|
+
font: 'Lucida Console', 'courier new', monospace;
|
92
|
+
color: #193441;
|
93
|
+
font-size: 115%;
|
94
|
+
}
|
95
|
+
|
96
|
+
acronym {
|
97
|
+
cursor: help;
|
98
|
+
border-bottom: 1px solid #777;
|
99
|
+
}
|
100
|
+
|
101
|
+
blockquote.exclamation, blockquote.error, blockquote.information {
|
102
|
+
margin: 10px 0px;
|
103
|
+
padding: 0 0 0 40px;
|
104
|
+
min-height: 40px;
|
105
|
+
border: 1px solid #91AA9D;
|
106
|
+
font: 'Trebuchet MS', Sans-serif;
|
107
|
+
background-color: #D1DBBD;
|
108
|
+
background-image: url(images/quote.gif);
|
109
|
+
background-repeat: no-repeat;
|
110
|
+
background-position: 5px 5px;
|
111
|
+
}
|
112
|
+
|
113
|
+
blockquote.exclamation {
|
114
|
+
background-image: url(images/exclamation.gif);
|
115
|
+
}
|
116
|
+
|
117
|
+
blockquote.error {
|
118
|
+
background-image: url(images/error.gif);
|
119
|
+
}
|
120
|
+
|
121
|
+
blockquote.information {
|
122
|
+
background-image: url(images/information.gif);
|
123
|
+
}
|
124
|
+
|
125
|
+
blockquote pre {
|
126
|
+
border: none;
|
127
|
+
}
|
128
|
+
|
129
|
+
/***********************
|
130
|
+
LAYOUT
|
131
|
+
************************/
|
132
|
+
|
133
|
+
#header-content, #content {
|
134
|
+
width: 100%;
|
135
|
+
}
|
136
|
+
|
137
|
+
/* header */
|
138
|
+
#header {
|
139
|
+
background: #444 url(images/headerbg.jpg) repeat-x 0 0;
|
140
|
+
height: 120px;
|
141
|
+
text-align: left;
|
142
|
+
}
|
143
|
+
|
144
|
+
#header-content {
|
145
|
+
position: relative;
|
146
|
+
margin: 0 auto;
|
147
|
+
padding: 0;
|
148
|
+
}
|
149
|
+
|
150
|
+
#header-content #logo {
|
151
|
+
position: absolute;
|
152
|
+
font: bold 50px Verdana, 'Trebuchet Ms', Sans-serif;
|
153
|
+
letter-spacing: -2px;
|
154
|
+
color: #FCFFF5;
|
155
|
+
margin: 0; padding: 0;
|
156
|
+
|
157
|
+
top: 5px; left: 20px;
|
158
|
+
}
|
159
|
+
|
160
|
+
#header-content #slogan {
|
161
|
+
position: absolute;
|
162
|
+
font: bold 16px 'Trebuchet Ms', Sans-serif;
|
163
|
+
text-transform: none;
|
164
|
+
color: #CCC;
|
165
|
+
margin: 0; padding: 0;
|
166
|
+
|
167
|
+
top: 65px; left: 35px;
|
168
|
+
}
|
169
|
+
|
170
|
+
/* header menu */
|
171
|
+
#header-content ul {
|
172
|
+
position: absolute;
|
173
|
+
right: 20px; top: 75px;
|
174
|
+
font: bolder 1.3em 'Trebuchet MS', sans-serif;
|
175
|
+
color: #FCFFF5;
|
176
|
+
list-style: none;
|
177
|
+
margin: 0; padding: 0;
|
178
|
+
}
|
179
|
+
#header-content li {
|
180
|
+
float: left;
|
181
|
+
display: block;
|
182
|
+
color: #FCFFF5;
|
183
|
+
text-decoration: none;
|
184
|
+
}
|
185
|
+
#header-content li a, #header-content li span {
|
186
|
+
display: block;
|
187
|
+
color: #3E606F;
|
188
|
+
text-decoration: none;
|
189
|
+
padding: 3px 12px;
|
190
|
+
}
|
191
|
+
#header-content li a:hover {
|
192
|
+
background: #FCFFF5;
|
193
|
+
color: #A0080D;
|
194
|
+
}
|
195
|
+
#header-content li.webgen-menu-item-selected, #header-content li.webgen-menu-submenu-inhierarchy {
|
196
|
+
background: #FCFFF5;
|
197
|
+
color: #A0080D;
|
198
|
+
}
|
199
|
+
|
200
|
+
/* content */
|
201
|
+
#content-wrap {
|
202
|
+
clear: both;
|
203
|
+
float: left;
|
204
|
+
width: 100%;
|
205
|
+
}
|
206
|
+
|
207
|
+
#content {
|
208
|
+
text-align: left;
|
209
|
+
padding: 0; margin: 0 auto;
|
210
|
+
background: #91AA9D;
|
211
|
+
}
|
212
|
+
|
213
|
+
/* sidebar */
|
214
|
+
#sidebar {
|
215
|
+
float: right;
|
216
|
+
width: 340px;
|
217
|
+
margin: 0; padding: 10px;
|
218
|
+
background-color: #91AA9D;
|
219
|
+
}
|
220
|
+
#sidebar p {
|
221
|
+
margin: 0px;
|
222
|
+
padding-left: 10px;
|
223
|
+
}
|
224
|
+
#sidebar ul {
|
225
|
+
list-style: inside square;
|
226
|
+
margin: 0px;
|
227
|
+
padding: 0px;
|
228
|
+
}
|
229
|
+
#sidebar ul li {
|
230
|
+
padding: 0px;
|
231
|
+
margin: 0px;
|
232
|
+
padding-left: 1em;
|
233
|
+
padding-top: 0.3em;
|
234
|
+
}
|
235
|
+
#sidebar ul a {
|
236
|
+
color: #FCFFF5;
|
237
|
+
text-decoration: none;
|
238
|
+
padding: .3em 0 .3em 3px;
|
239
|
+
line-height: 1.5ex;
|
240
|
+
}
|
241
|
+
#sidebar ul a:hover {
|
242
|
+
border-left: 5px solid #193441;
|
243
|
+
color: #193441;
|
244
|
+
}
|
245
|
+
|
246
|
+
/* main */
|
247
|
+
#main {
|
248
|
+
margin: 0 360px 0 0;
|
249
|
+
padding: 20px;
|
250
|
+
background-color: #FCFFF5;
|
251
|
+
}
|
252
|
+
|
253
|
+
/* footer */
|
254
|
+
#footer {
|
255
|
+
clear: both;
|
256
|
+
color: #FCFFF5;
|
257
|
+
margin: 0;
|
258
|
+
padding: 0;
|
259
|
+
border-top: 1px solid #3E60F6;
|
260
|
+
font-size: 95%;
|
261
|
+
text-align: left;
|
262
|
+
}
|
263
|
+
#footer h2, #footer p {
|
264
|
+
padding-left: 0;
|
265
|
+
}
|
266
|
+
#footer-content {
|
267
|
+
width: 100%;
|
268
|
+
margin: 0 auto;
|
269
|
+
position: absolute;
|
270
|
+
background-color: #193441;
|
271
|
+
}
|
272
|
+
#footer-content a {
|
273
|
+
text-decoration: none;
|
274
|
+
color: #CCC;
|
275
|
+
}
|
276
|
+
#footer-content a:hover {
|
277
|
+
text-decoration: underline;
|
278
|
+
background-color: inherit;
|
279
|
+
}
|
280
|
+
#footer-content ul {
|
281
|
+
list-style: none;
|
282
|
+
margin: 0;
|
283
|
+
padding: 0;
|
284
|
+
}
|
285
|
+
#footer-content .col {
|
286
|
+
width: 32%;
|
287
|
+
padding: 0 5px 30px 15px;
|
288
|
+
}
|
289
|
+
#footer-content .col2 {
|
290
|
+
width: 30%;
|
291
|
+
padding: 0 0 30px 0;
|
292
|
+
}
|
293
|
+
|
294
|
+
/* alignment classes */
|
295
|
+
.float-left { float: left; }
|
296
|
+
.float-right { float: right; }
|
297
|
+
.align-left { text-align: left; }
|
298
|
+
.align-right { text-align: right; }
|
299
|
+
|
300
|
+
/* additional classes */
|
301
|
+
.clear { clear: both; }
|
302
|
+
.comments {
|
303
|
+
text-align: right;
|
304
|
+
border: 1px dashed #151515;
|
305
|
+
padding: 5px 10px;
|
306
|
+
margin: 20px 15px 10px 15px;
|
307
|
+
}
|
308
|
+
.small {
|
309
|
+
font-size: 90%;
|
310
|
+
color: #666;
|
311
|
+
padding: 2px;
|
312
|
+
}
|
313
|
+
|
314
|
+
/* extensions classes */
|
315
|
+
.backlink {
|
316
|
+
float: right;
|
317
|
+
}
|
318
|
+
|
319
|
+
table.examples {
|
320
|
+
border: 1px solid black;
|
321
|
+
border-collapse: collapse;
|
322
|
+
margin-left: auto;
|
323
|
+
margin-right: auto;
|
324
|
+
width: 80%;
|
325
|
+
}
|
326
|
+
|
327
|
+
table.examples td, table.examples th {
|
328
|
+
border: 1px solid black;
|
329
|
+
padding: 3px;
|
330
|
+
}
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
/* plugin documentation classes */
|
335
|
+
.plugin-info .param-name {
|
336
|
+
color: #193441;
|
337
|
+
}
|
338
|
+
|
339
|
+
.plugin-info .param-default-value {
|
340
|
+
color: #A0080D;
|
341
|
+
}
|
342
|
+
|
343
|
+
.plugin-info p.param {
|
344
|
+
padding: 0px 0px 5px;
|
345
|
+
}
|
346
|
+
|
347
|
+
|
348
|
+
/* blog related classes */
|
349
|
+
div.blog-entry {
|
350
|
+
margin-bottom: 15px;
|
351
|
+
}
|
352
|
+
|
353
|
+
blockquote.blog-entry-details {
|
354
|
+
font-size: 80%;
|
355
|
+
margin-bottom: 5px;
|
356
|
+
}
|
357
|
+
|
358
|
+
.blog-entry-date, .blog-entry-author {
|
359
|
+
font-weight: bold;
|
360
|
+
}
|