webgen 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +1523 -97
- data/Rakefile +11 -24
- data/TODO +22 -9
- data/VERSION +1 -1
- data/bin/webgen +2 -2
- data/bin/webgen-gallery-editor +654 -0
- data/bin/webgen-gui +10 -0
- data/data/webgen/data/ISO-639-2_values_8bits.txt +492 -0
- data/data/webgen/gallery-creator/default.png +0 -0
- data/data/webgen/icon_mapping.yaml +27 -0
- data/data/webgen/resources/emoticons/bigeyes/angry.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/cool.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/cry.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/drunk.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/lol.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/oops.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/sad.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/sleep.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/smile.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/tongue.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/wink.png +0 -0
- data/data/webgen/resources/emoticons/crystal/angry.png +0 -0
- data/data/webgen/resources/emoticons/crystal/cool.png +0 -0
- data/data/webgen/resources/emoticons/crystal/cry.png +0 -0
- data/data/webgen/resources/emoticons/crystal/drunk.png +0 -0
- data/data/webgen/resources/emoticons/crystal/lol.png +0 -0
- data/data/webgen/resources/emoticons/crystal/oops.png +0 -0
- data/data/webgen/resources/emoticons/crystal/sad.png +0 -0
- data/data/webgen/resources/emoticons/crystal/sleep.png +0 -0
- data/data/webgen/resources/emoticons/crystal/smile.png +0 -0
- data/data/webgen/resources/emoticons/crystal/tongue.png +0 -0
- data/data/webgen/resources/emoticons/crystal/wink.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/angry.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/cool.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/cry.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/drunk.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/lol.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/oops.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/sad.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/sleep.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/smile.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/tongue.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/wink.png +0 -0
- data/data/webgen/resources/emoticons/glass/angry.png +0 -0
- data/data/webgen/resources/emoticons/glass/cool.png +0 -0
- data/data/webgen/resources/emoticons/glass/cry.png +0 -0
- data/data/webgen/resources/emoticons/glass/drunk.png +0 -0
- data/data/webgen/resources/emoticons/glass/lol.png +0 -0
- data/data/webgen/resources/emoticons/glass/oops.png +0 -0
- data/data/webgen/resources/emoticons/glass/sad.png +0 -0
- data/data/webgen/resources/emoticons/glass/sleep.png +0 -0
- data/data/webgen/resources/emoticons/glass/smile.png +0 -0
- data/data/webgen/resources/emoticons/glass/tongue.png +0 -0
- data/data/webgen/resources/emoticons/glass/wink.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/angry.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/cool.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/cry.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/drunk.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/lol.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/oops.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/sad.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/sleep.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/smile.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/tongue.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/wink.png +0 -0
- data/data/webgen/resources/emoticons/matrix/angry.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/cool.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/cry.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/drunk.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/lol.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/oops.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/sad.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/sleep.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/smile.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/tongue.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/wink.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/angry.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/cool.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/cry.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/drunk.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/lol.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/oops.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/sad.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/sleep.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/smile.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/tongue.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/wink.gif +0 -0
- data/data/webgen/resources/icons/compressed.png +0 -0
- data/data/webgen/resources/icons/document.png +0 -0
- data/data/webgen/resources/icons/download.png +0 -0
- data/data/webgen/resources/icons/image.png +0 -0
- data/data/webgen/resources/icons/linux.png +0 -0
- data/data/webgen/resources/icons/mac.png +0 -0
- data/data/webgen/resources/icons/pdf.png +0 -0
- data/data/webgen/resources/icons/penguin.png +0 -0
- data/data/webgen/resources/icons/quicktime.png +0 -0
- data/data/webgen/resources/icons/real.png +0 -0
- data/data/webgen/resources/icons/rpm.png +0 -0
- data/data/webgen/resources/icons/sound.png +0 -0
- data/data/webgen/resources/icons/source.png +0 -0
- data/data/webgen/resources/icons/spreadsheet.png +0 -0
- data/data/webgen/resources/icons/text.png +0 -0
- data/data/webgen/resources/icons/vcard.png +0 -0
- data/data/webgen/resources/icons/video.png +0 -0
- data/data/webgen/resources/icons/win.png +0 -0
- data/data/webgen/{images → resources/images}/generated_by_webgen.png +0 -0
- data/data/webgen/{images → resources/images}/valid-css.gif +0 -0
- data/data/webgen/{images → resources/images}/valid-xhtml11.png +0 -0
- data/data/webgen/{images → resources/images}/webgen_logo.png +0 -0
- data/data/webgen/{example/src → website_styles/default}/default.css +0 -0
- data/data/webgen/{example/src → website_styles/default}/default.template +2 -2
- data/data/webgen/website_templates/default/README +6 -0
- data/data/webgen/{example → website_templates/default}/config.yaml +0 -0
- data/data/webgen/{example → website_templates/default}/src/index.page +0 -0
- data/data/webgen/website_templates/personal_hp/README +6 -0
- data/data/webgen/website_templates/personal_hp/src/about.page +12 -0
- data/data/webgen/website_templates/personal_hp/src/index.page +9 -0
- data/data/webgen/website_templates/personal_hp/src/links.page +22 -0
- data/data/webgen/website_templates/personal_hp/src/projects.page +20 -0
- data/data/webgen/website_templates/project/README +7 -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/config.yaml +3 -0
- data/doc/plugin/clidesc.rb +18 -7
- data/doc/plugin/emoticon.rb +29 -0
- data/doc/plugin/extension.rb +15 -16
- data/doc/plugin/listpluginparameters.rb +39 -0
- data/doc/plugin/resources.rb +4 -4
- data/doc/plugin/source.rb +21 -0
- data/doc/src/default.css +7 -4
- data/doc/src/default.template +4 -2
- data/doc/src/documentation/cli.page +1 -1
- data/doc/src/documentation/extending_webgen.page +102 -0
- data/doc/src/documentation/gettingstarted.page +3 -6
- data/doc/src/documentation/index.page +1 -1
- data/doc/src/documentation/plugins/{contenthandler → contenthandlers}/html.page +0 -0
- data/doc/src/documentation/plugins/{contenthandler → contenthandlers}/index.page +0 -0
- data/doc/src/documentation/plugins/{contenthandler → contenthandlers}/markdown.page +0 -0
- data/doc/src/documentation/plugins/{contenthandler → contenthandlers}/rdoc.page +0 -0
- data/doc/src/documentation/plugins/{contenthandler → contenthandlers}/textile.page +0 -0
- data/doc/src/documentation/plugins/{system → coreplugins}/configuration.page +0 -0
- data/doc/src/documentation/plugins/coreplugins/index.page +7 -0
- data/doc/src/documentation/plugins/{system → coreplugins}/logging.page +0 -0
- data/doc/src/documentation/plugins/{resourcemanager.page → coreplugins/resourcemanager.page} +5 -1
- data/doc/src/documentation/plugins/{filehandler → filehandlers}/backing.page +1 -1
- data/doc/src/documentation/plugins/{filehandler → filehandlers}/copy.page +1 -1
- data/doc/src/documentation/plugins/{filehandler/directory.page → filehandlers/directoryhandler.page} +11 -2
- data/doc/src/documentation/plugins/{filehandler/galleryhandler.page → filehandlers/gallery.page} +20 -13
- data/doc/src/documentation/plugins/{filehandler → filehandlers}/index.page +0 -0
- data/doc/src/documentation/plugins/{filehandler/pagehandler.page → filehandlers/page.page} +6 -4
- data/doc/src/documentation/plugins/{filehandler → filehandlers}/template.page +0 -0
- data/doc/src/documentation/plugins/{gallerylayouter → gallerylayouters}/index.page +7 -3
- data/doc/src/documentation/plugins/{htmlvalidator → htmlvalidators}/index.page +0 -0
- data/doc/src/documentation/plugins/{htmlvalidator → htmlvalidators}/xmllint.page +0 -0
- data/doc/src/documentation/plugins/index.page +4 -0
- data/doc/src/documentation/plugins/menustyles/{horizontal-dropdown.page → horizontaldropdown.page} +0 -0
- data/doc/src/documentation/plugins/menustyles/{vertical-dropdown.page → verticaldropdown.page} +1 -1
- data/doc/src/documentation/plugins/miscplugins/index.page +7 -0
- data/doc/src/documentation/plugins/miscplugins/smileyreplacer.page +38 -0
- data/doc/src/documentation/plugins/tags/breadcrumbtrail.page +20 -0
- data/doc/src/documentation/plugins/tags/download.page +23 -0
- data/doc/src/documentation/plugins/tags/resource.page +1 -1
- data/doc/src/documentation/plugins/tags/sitemap.page +1 -2
- data/doc/src/documentation/references/index.page +8 -0
- data/doc/src/documentation/{meta_info_reference.page → references/meta_info_reference.page} +1 -0
- data/doc/src/documentation/references/parameter_reference.page +12 -0
- data/doc/src/documentation/webgen_gallery_editor.page +82 -0
- data/doc/src/download.page +2 -2
- data/doc/src/features.page +3 -2
- data/doc/src/images/screenshots/wge-image.png +0 -0
- data/doc/src/images/screenshots/wge-layout-preview.png +0 -0
- data/doc/src/images/screenshots/wge-main-disabled.png +0 -0
- data/doc/src/images/screenshots/wge-main.png +0 -0
- data/doc/src/index.page +30 -11
- data/doc/src/meta.info +7 -7
- data/doc/src/screenshots.gallery +33 -0
- data/install.rb +1 -1
- data/lib/webgen.rb +275 -0
- data/lib/webgen/composite.rb +1 -1
- data/lib/webgen/gui/common.rb +38 -0
- data/lib/webgen/gui/main.rb +219 -0
- data/lib/webgen/gui/new_website_dlg.rb +125 -0
- data/lib/webgen/listener.rb +1 -1
- data/lib/webgen/node.rb +4 -2
- data/lib/webgen/plugin.rb +167 -100
- data/lib/webgen/plugins/{contenthandler/defaultcontenthandler.rb → contenthandlers/default.rb} +1 -1
- data/lib/webgen/plugins/{contenthandler → contenthandlers}/html.rb +2 -2
- data/lib/webgen/plugins/{contenthandler → contenthandlers}/markdown.rb +2 -2
- data/lib/webgen/plugins/{contenthandler → contenthandlers}/rdoc.rb +2 -2
- data/lib/webgen/plugins/{contenthandler → contenthandlers}/textile.rb +2 -2
- data/lib/webgen/{configuration.rb → plugins/coreplugins/configuration.rb} +34 -14
- data/lib/webgen/{logging.rb → plugins/coreplugins/logging.rb} +4 -4
- data/lib/webgen/plugins/{resourcemanager.rb → coreplugins/resourcemanager.rb} +44 -22
- data/lib/webgen/plugins/{filehandler → filehandlers}/backing.rb +11 -11
- data/lib/webgen/plugins/{filehandler/filecopy.rb → filehandlers/copy.rb} +3 -3
- data/lib/webgen/plugins/{filehandler → filehandlers}/directory.rb +15 -10
- data/lib/webgen/plugins/{filehandler → filehandlers}/filehandler.rb +9 -7
- data/lib/webgen/plugins/{filehandler/picturegallery.rb → filehandlers/gallery.rb} +35 -28
- data/lib/webgen/plugins/{filehandler → filehandlers}/page.rb +30 -15
- data/lib/webgen/plugins/{filehandler → filehandlers}/template.rb +3 -3
- data/lib/webgen/plugins/{gallerylayouter/defaultgallerylayouter.rb → gallerylayouters/default.rb} +11 -11
- data/lib/webgen/plugins/{htmlvalidator/defaulthtmlvalidator.rb → htmlvalidators/default.rb} +1 -1
- data/lib/webgen/plugins/{htmlvalidator → htmlvalidators}/xmllint.rb +2 -2
- data/lib/webgen/plugins/menustyles/{defaultmenustyle.rb → default.rb} +2 -2
- data/lib/webgen/plugins/menustyles/horizontal.rb +2 -2
- data/lib/webgen/plugins/menustyles/horizontal_dropdown.rb +2 -2
- data/lib/webgen/plugins/menustyles/partial.rb +2 -2
- data/lib/webgen/plugins/menustyles/vertical.rb +2 -2
- data/lib/webgen/plugins/menustyles/vertical_dropdown.rb +2 -2
- data/lib/webgen/plugins/miscplugins/smileyreplacer.rb +84 -0
- data/lib/webgen/plugins/{treewalker.rb → miscplugins/treewalker.rb} +1 -1
- data/lib/webgen/plugins/tags/{navbar.rb → breadcrumbtrail.rb} +5 -9
- data/lib/webgen/plugins/tags/date.rb +2 -6
- data/lib/webgen/plugins/tags/download.rb +155 -0
- data/lib/webgen/plugins/tags/executecommand.rb +2 -6
- data/lib/webgen/plugins/tags/includefile.rb +4 -8
- data/lib/webgen/plugins/tags/langbar.rb +2 -6
- data/lib/webgen/plugins/tags/menu.rb +2 -7
- data/lib/webgen/plugins/tags/meta.rb +2 -6
- data/lib/webgen/plugins/tags/relocatable.rb +2 -6
- data/lib/webgen/plugins/tags/sitemap.rb +14 -10
- data/lib/webgen/plugins/tags/tags.rb +25 -18
- data/lib/webgen/plugins/tags/wikilink.rb +2 -6
- metadata +311 -195
- data/doc/src/design.gallery +0 -18
- data/doc/src/designs/curdesign.png +0 -0
- data/doc/src/designs/nostyle.png +0 -0
- data/doc/src/designs/old.png +0 -0
- data/doc/src/documentation/plugins/gallerylayouter/defaultlayouter.page +0 -12
- data/doc/src/documentation/plugins/system/index.page +0 -7
- data/doc/src/documentation/plugins/tags/navbar.page +0 -20
- data/lib/webgen/webgen.rb +0 -271
- data/testsite/config.yaml +0 -7
- data/testsite/src/bghack.png +0 -0
- data/testsite/src/bluecloth.page +0 -102
- data/testsite/src/default.css +0 -146
- data/testsite/src/default.template +0 -33
- data/testsite/src/home.en.page +0 -22
- data/testsite/src/home.page +0 -22
- data/testsite/src/images/bghack.png +0 -0
- data/testsite/src/index.page +0 -21
- data/testsite/src/meta.info +0 -12
- data/testsite/src/news.page +0 -20
- data/testsite/src/news_are_so-cool.de.page +0 -19
- data/testsite/src/noindex/noindex.page +0 -20
- data/testsite/src/pictures/index.page +0 -20
- data/testsite/src/projects.de.page +0 -11
- data/testsite/src/projects.es.page +0 -11
- data/testsite/src/projects.page +0 -17
- data/testsite/src/projects/00.index.de.page +0 -10
- data/testsite/src/projects/01.project2.page +0 -20
- data/testsite/src/projects/02.project1.page +0 -20
- data/testsite/src/projects/05.project3.page +0 -22
- data/testsite/src/projects/index.page +0 -20
- data/testsite/src/projects/subproj/index.page +0 -22
- data/testsite/src/projects/subproj/project3.page +0 -21
- data/testsite/src/rdoc.page +0 -12
- data/testsite/src/redcloth.page +0 -106
@@ -0,0 +1,29 @@
|
|
1
|
+
module WebgenDocuPlugins
|
2
|
+
|
3
|
+
class ShowEmoticonsTag < Tags::DefaultTag
|
4
|
+
|
5
|
+
summary "Creates a table of the existing emoticon packs"
|
6
|
+
|
7
|
+
tag 'showEmoticonPacks'
|
8
|
+
|
9
|
+
def process_tag( tag, node, refNode )
|
10
|
+
res = Webgen::Plugin.config[CorePlugins::ResourceManager].resources
|
11
|
+
packs = Dir[File.join( CorePlugins::Configuration.data_dir, 'resources', 'emoticons', '*/')].collect {|p| File.basename( p )}.sort
|
12
|
+
|
13
|
+
map = MiscPlugins::SmileyReplacer::SMILEY_MAP
|
14
|
+
output = '<table style="width: 100%; border: 1px solid black" summary="List of emoticon packs" rules="groups" frame="border">'
|
15
|
+
header = map.sort {|a,b| a[1] <=> b[1]}.collect {|s, name| "<th><code>#{s}</code><br />(#{name})</th>" }.join('')
|
16
|
+
output << "<thead><tr><th>Smiley/Pack</th>#{header}</tr></thead><tbody>"
|
17
|
+
packs.each do |pack|
|
18
|
+
output << "<tr><th>#{pack}</th>"
|
19
|
+
output << map.values.sort.collect do |v|
|
20
|
+
"<td align=\"center\"><img src=\"{resource: webgen-emoticons-#{pack}-#{v}}\" alt=\"smiley\"/></td>"
|
21
|
+
end.join('')
|
22
|
+
output << "</tr>"
|
23
|
+
end
|
24
|
+
output << "</tbody></table>"
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
data/doc/plugin/extension.rb
CHANGED
@@ -1,14 +1,10 @@
|
|
1
|
-
module
|
1
|
+
module WebgenDocuPlugins
|
2
2
|
|
3
3
|
class VersionTag < Tags::DefaultTag
|
4
4
|
|
5
5
|
summary "Shows the version number of webgen"
|
6
|
-
depends_on 'Tags'
|
7
6
|
|
8
|
-
|
9
|
-
super
|
10
|
-
register_tag( 'version' )
|
11
|
-
end
|
7
|
+
tag 'version'
|
12
8
|
|
13
9
|
def process_tag( tag, node, refNode )
|
14
10
|
Webgen::VERSION.join( '.' )
|
@@ -21,12 +17,12 @@ module OtherPlugins
|
|
21
17
|
summary "Shows options for the specified file handler"
|
22
18
|
add_param 'plugin', nil, 'The plugin which should be described'
|
23
19
|
set_mandatory 'plugin', true
|
24
|
-
|
20
|
+
|
21
|
+
tag 'describe'
|
25
22
|
|
26
23
|
def initialize
|
27
24
|
super
|
28
25
|
@processOutput = false
|
29
|
-
register_tag( 'describe' )
|
30
26
|
end
|
31
27
|
|
32
28
|
def process_tag( tag, node, refNode )
|
@@ -55,14 +51,7 @@ module OtherPlugins
|
|
55
51
|
|
56
52
|
# parameters
|
57
53
|
unless data.params.nil?
|
58
|
-
|
59
|
-
"<span style='color: red'>#{v.name}</span>" + \
|
60
|
-
( v.mandatory.nil? \
|
61
|
-
? " = <span style='color: blue'>#{CGI::escapeHTML( v.default.inspect )}</span>" \
|
62
|
-
: " (=" + ( v.mandatoryDefault ? "default " : "" ) + "mandatory parameter)" ) + \
|
63
|
-
": #{CGI::escapeHTML( v.description )}"
|
64
|
-
end
|
65
|
-
s += row['Parameters', params.join( "<br />\n" )]
|
54
|
+
s += row['Parameters', format_params( data.params )]
|
66
55
|
end
|
67
56
|
|
68
57
|
# used meta info
|
@@ -80,6 +69,16 @@ module OtherPlugins
|
|
80
69
|
s += "</table>"
|
81
70
|
end
|
82
71
|
|
72
|
+
def format_params( params )
|
73
|
+
params.sort.collect do |k,v|
|
74
|
+
"<span style='color: red'>#{v.name}</span>" + \
|
75
|
+
( v.mandatory.nil? \
|
76
|
+
? " = <span style='color: blue'>#{CGI::escapeHTML( v.default.inspect )}</span>" \
|
77
|
+
: " (=" + ( v.mandatoryDefault ? "default " : "" ) + "mandatory parameter)" ) + \
|
78
|
+
": #{CGI::escapeHTML( v.description )}"
|
79
|
+
end.join( "<br />\n" )
|
80
|
+
end
|
81
|
+
|
83
82
|
end
|
84
83
|
|
85
84
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'set'
|
2
|
+
|
3
|
+
module WebgenDocuPlugins
|
4
|
+
|
5
|
+
class ListPluginParametersTag < Tags::DefaultTag
|
6
|
+
|
7
|
+
summary "Lists all available plugin parameters"
|
8
|
+
|
9
|
+
tag 'listPluginParameters'
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
super
|
13
|
+
@processOutput = false
|
14
|
+
end
|
15
|
+
|
16
|
+
def process_tag( tag, node, refNode )
|
17
|
+
plugins = Webgen::Plugin.config.select {|k,v| k.name !~ /^WebgenDocuPlugins::/ }
|
18
|
+
|
19
|
+
mydata = {}
|
20
|
+
plugins.each do |klass, data|
|
21
|
+
next if data.params.nil?
|
22
|
+
(mydata[klass.name[/^.*?(?=::)/].gsub(/([A-Z][a-z])/, ' \1').strip] ||= []) << data
|
23
|
+
end
|
24
|
+
|
25
|
+
output = "<dl>\n"
|
26
|
+
mydata.sort.each do |cat, plugins|
|
27
|
+
output << "<dt>#{cat}</dt><dd><dl>"
|
28
|
+
plugins.sort {|a,b| a.plugin <=> b.plugin}.each do |data|
|
29
|
+
output << "<dt>#{data.plugin}</dt>\n"
|
30
|
+
output << "<dd>#{Webgen::Plugin['DescribeTag'].format_params( data.params )}</dd>\n"
|
31
|
+
end
|
32
|
+
output << "</dl></dd>"
|
33
|
+
end
|
34
|
+
output << "</dl>\n"
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
data/doc/plugin/resources.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
module
|
1
|
+
module WebgenDocuPlugins
|
2
2
|
|
3
3
|
class PredefinedResourcesTag < Tags::DefaultTag
|
4
4
|
|
5
5
|
summary "Creates a table of all predefined resources"
|
6
|
-
|
6
|
+
|
7
|
+
tag 'predefinedResources'
|
7
8
|
|
8
9
|
def initialize
|
9
10
|
super
|
10
11
|
@processOutput = false
|
11
|
-
register_tag( 'predefinedResources' )
|
12
12
|
end
|
13
13
|
|
14
14
|
def process_tag( tag, node, refNode )
|
15
|
-
res = Webgen::Plugin.config[
|
15
|
+
res = Webgen::Plugin.config[CorePlugins::ResourceManager].resources
|
16
16
|
output = '<table style="width: 100%; border: 1px solid black" summary="List of predefined resources" rules="cols" frame="border">'
|
17
17
|
output << '<thead><tr><th>Name</th><th>Type</th><th>Output path</th><th>Description</th></tr></thead>'
|
18
18
|
output << '<tbody>'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module WebgenDocuPlugins
|
2
|
+
|
3
|
+
class ShowSourceTag < Tags::DefaultTag
|
4
|
+
|
5
|
+
summary "Copy the page source and link to it"
|
6
|
+
|
7
|
+
tag 'source'
|
8
|
+
|
9
|
+
def process_tag( tag, node, refNode )
|
10
|
+
outpath = node.recursive_value( 'src' ).sub( /^#{Webgen::Plugin['Configuration']['srcDirectory']}/, Webgen::Plugin['Configuration']['outDirectory'] )
|
11
|
+
if File.exists?( node.recursive_value('src') )
|
12
|
+
FileUtils.cp( node.recursive_value( 'src' ), outpath )
|
13
|
+
"Source: <a href=\"#{node['src']}\">page source</a>"
|
14
|
+
else
|
15
|
+
""
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
data/doc/src/default.css
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
|
8
8
|
body {
|
9
9
|
margin: 0px 2em;
|
10
|
+
padding: 0px;
|
10
11
|
font-size: 12px;
|
11
12
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
12
13
|
border: 1px solid black;
|
@@ -84,8 +85,6 @@ a { color: #5C73B8; }
|
|
84
85
|
clear: both;
|
85
86
|
}
|
86
87
|
|
87
|
-
#quickmenu > div > a { border-bottom: 3px double black; }
|
88
|
-
|
89
88
|
/** styling the sample menus **/
|
90
89
|
|
91
90
|
/* horizontal menu */
|
@@ -143,6 +142,10 @@ a { color: #5C73B8; }
|
|
143
142
|
font-weight: bold;
|
144
143
|
}
|
145
144
|
|
145
|
+
.partial-menu .webgen-menu-submenu {
|
146
|
+
background: #405080;
|
147
|
+
}
|
148
|
+
|
146
149
|
.partial-menu a {
|
147
150
|
color: white;
|
148
151
|
display: block;
|
@@ -230,11 +233,11 @@ dt {
|
|
230
233
|
font-weight: bold;
|
231
234
|
}
|
232
235
|
|
233
|
-
.webgen-
|
236
|
+
.webgen-image {
|
234
237
|
text-align: center;
|
235
238
|
}
|
236
239
|
|
237
|
-
.webgen-
|
240
|
+
.webgen-image img {
|
238
241
|
border: 1px solid black;
|
239
242
|
}
|
240
243
|
|
data/doc/src/default.template
CHANGED
@@ -2,10 +2,11 @@
|
|
2
2
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang:}">
|
4
4
|
<head>
|
5
|
-
<title>webgen - {title: }</title>
|
5
|
+
<title>webgen - static website generator - {title: }</title>
|
6
6
|
<link href="{resource: webgen-css}" rel="stylesheet" />
|
7
7
|
<link href="{relocatable: default.css}" rel="stylesheet" />
|
8
8
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
9
|
+
<meta name="Keywords" content="webgen, static web site generator, ruby, HTML, dynamic tags, plugin based, static web, web generator, site generator" />
|
9
10
|
</head>
|
10
11
|
<body>
|
11
12
|
<div id="all">
|
@@ -21,9 +22,10 @@
|
|
21
22
|
</div>
|
22
23
|
|
23
24
|
<div id="headerbar" class="bar">
|
24
|
-
<span class="left">
|
25
|
+
<span class="left">Location: {breadcrumbTrail: }</span>
|
25
26
|
<span class="right">Language: {langbar: }</span>
|
26
27
|
<span class="right">Feedback: {wikilink: {rootURL: http://webgen.rubyforge.org/wiki/wiki.pl?, title: Click here}}</span>
|
28
|
+
<span class="right">{source: }</span>
|
27
29
|
<div style="clear:both"></div>
|
28
30
|
</div>
|
29
31
|
|
@@ -0,0 +1,102 @@
|
|
1
|
+
---
|
2
|
+
title: Extending webgen
|
3
|
+
inMenu: true
|
4
|
+
orderInfo: 21
|
5
|
+
---
|
6
|
+
h2. Extending webgen
|
7
|
+
|
8
|
+
h3. General
|
9
|
+
|
10
|
+
There is a logging mechanism available for informational and debugging purposes. Four different log
|
11
|
+
levels are available:
|
12
|
+
|
13
|
+
* debug
|
14
|
+
* info
|
15
|
+
* warn
|
16
|
+
* error
|
17
|
+
|
18
|
+
The methods are named after the log levels and can be invoked by using
|
19
|
+
@logger.{debug|info|warn|error}@. You need to provide a string as argument or a block which returns
|
20
|
+
a string.
|
21
|
+
|
22
|
+
h3. Normal plugins (new tags, file handlers, etc)
|
23
|
+
|
24
|
+
As webgen is plugin-based, it can be extended very easily. A simple example is shown in the
|
25
|
+
<a href="{relocatable: gettingstarted.page#simple-plugin}">Getting Started</a> guide.
|
26
|
+
|
27
|
+
If you want more sophisticated examples of plugins, have a look at webgen itself and the plugins
|
28
|
+
that get shipped with it. They can be found in the directory @lib/webgen/plugins/@!
|
29
|
+
|
30
|
+
h3. CLI Command Plugins
|
31
|
+
|
32
|
+
For this you need to write a new command class and put its file into the @plugin@ folder of the
|
33
|
+
website. Have a look at the "cmdparse API reference":http://cmdparse.rubyforge.org/rdoc/index.html
|
34
|
+
for information about how to write a command class.
|
35
|
+
|
36
|
+
There are basically two ways for a command plugin:
|
37
|
+
|
38
|
+
* Easiest one
|
39
|
+
|
40
|
+
You just declare a new class derived from @CmdParse::Command@ and include the
|
41
|
+
@Webgen::CommandPlugin@ module. After you have included this module, you can use all standard
|
42
|
+
plugin directives, like @summary@ or @add_param@. Also, this command gets automatically added to
|
43
|
+
the main @CommandParser@ class. Thus, the @initialize@ method must not take any arguments!
|
44
|
+
|
45
|
+
<pre>
|
46
|
+
class SimpleCommand < CmdParse::Command
|
47
|
+
|
48
|
+
include Webgen::CommandPlugin
|
49
|
+
|
50
|
+
summary "Describe simple command"
|
51
|
+
add_param 'firstParam', 45, 'Description of firstParam'
|
52
|
+
|
53
|
+
def initialize
|
54
|
+
super( 'simple', false )
|
55
|
+
self.short_desc = "This is a sample for a simple command."
|
56
|
+
end
|
57
|
+
|
58
|
+
def usage; "Usage: #{@options.program_name} [global options] simple"; end
|
59
|
+
|
60
|
+
def execute( args )
|
61
|
+
# do something useful
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
</pre>
|
66
|
+
|
67
|
+
* Easy one
|
68
|
+
|
69
|
+
You only need to go this way when the @initialize@ method of your command class needs to
|
70
|
+
arguments!!
|
71
|
+
|
72
|
+
Like before, you declare your new command class. This time however, you need include the
|
73
|
+
@Webgen::PluginDefs@ module and set the constant @VIRTUAL@ to true. This prevents the plugin
|
74
|
+
system from automatically instantiating an object. You then need to instantiate an object and add
|
75
|
+
it to the main @CommandParser@ class. This can be done by calling the @add_cmdparser_command@ of
|
76
|
+
the configuration plugin.
|
77
|
+
|
78
|
+
<pre>
|
79
|
+
class OtherCommand < CmdParse::Command
|
80
|
+
|
81
|
+
include Webgen::PluginDefs
|
82
|
+
|
83
|
+
VIRTUAL = true
|
84
|
+
|
85
|
+
summary "Describe other simple command"
|
86
|
+
|
87
|
+
def initialize( arg )
|
88
|
+
super( 'otherSimple', false )
|
89
|
+
@arg = arg
|
90
|
+
self.short_desc = "This is a second sample for a simple command."
|
91
|
+
end
|
92
|
+
|
93
|
+
def usage; "Usage: #{@options.program_name} [global options] otherSimple"; end
|
94
|
+
|
95
|
+
def execute( args )
|
96
|
+
# do something useful
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
Webgen::Plugin['Configuration'].add_cmdparser_command( OtherCommand.new( 5 ) )
|
102
|
+
</pre>
|
@@ -73,7 +73,7 @@ Just add page files and other content to your website and let it grow!
|
|
73
73
|
h2. Using Meta Information in Pages
|
74
74
|
|
75
75
|
Meta information is specified at the beginning of a page file. Have a look at the
|
76
|
-
<a href="{relocatable: plugins/
|
76
|
+
<a href="{relocatable: plugins/filehandlers/page.page}">documentation</a> to see how that is done
|
77
77
|
in detail!
|
78
78
|
|
79
79
|
We are now going to use meta information to customize our website! Open the file @default.template@
|
@@ -112,7 +112,7 @@ Run webgen and view the output! The tag @\{filemdate: }@ got substituted by the
|
|
112
112
|
the meta information. As we have not put any meta information in the @index.page@ file, a warning is
|
113
113
|
issued when webgen is run and no date is shown on the page!
|
114
114
|
|
115
|
-
h2. Write a Simple Plugin
|
115
|
+
h2(#simple-plugin). Write a Simple Plugin
|
116
116
|
|
117
117
|
Because we are not quite happy with our basic file modification time tag, we are going to write a
|
118
118
|
simple tag plugin.
|
@@ -129,10 +129,7 @@ module Tags
|
|
129
129
|
summary "Puts the modification time of the file on the page"
|
130
130
|
depends_on 'Tags'
|
131
131
|
|
132
|
-
|
133
|
-
super
|
134
|
-
register_tag( 'filemdate' )
|
135
|
-
end
|
132
|
+
tag 'filemdate'
|
136
133
|
|
137
134
|
def process_tag( tag, node, refNode )
|
138
135
|
return File.mtime( node.recursive_value( 'src' ) ).to_s
|
@@ -56,5 +56,5 @@ parameter. Each parameter can be overridden in the configuration file by specifi
|
|
56
56
|
plugin name as top level key and each parameter and value as a key/value pair. A configuration file
|
57
57
|
looks like this:
|
58
58
|
|
59
|
-
<pre class="webgen-file">{includeFile:
|
59
|
+
<pre class="webgen-file">{includeFile: ../../config.yaml}</pre>
|
60
60
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/doc/src/documentation/plugins/{resourcemanager.page → coreplugins/resourcemanager.page}
RENAMED
@@ -20,11 +20,15 @@ There are two different types of resources: file resources and memory resources.
|
|
20
20
|
additional information, such as CSS formatting rules or Javascript.
|
21
21
|
|
22
22
|
Resources are only written to the output path if they are referenced (i.e. their output path is
|
23
|
-
included in a page file) at least once by the <a href="{relocatable: tags/resource.page}">resource
|
23
|
+
included in a page file) at least once by the <a href="{relocatable: ../tags/resource.page}">resource
|
24
24
|
tag</a>.
|
25
25
|
|
26
26
|
h2. Predefined Resources
|
27
27
|
|
28
28
|
webgen provides some predefined resources which can be used by any website created with it.
|
29
29
|
|
30
|
+
Credits: The icons were taken from the "CrystalClear" package from
|
31
|
+
"http://www.kde-look.org/content/show.php?content=25668":http://www.kde-look.org/content/show.php?content=25668
|
32
|
+
.
|
33
|
+
|
30
34
|
<notextile>{predefinedResources:}</notextile>
|
@@ -35,7 +35,7 @@ information you want. You can use relative and absolute paths in the filenames.
|
|
35
35
|
specify meta information for files which are in one of the parent directories of the backing file.
|
36
36
|
|
37
37
|
If you want to set meta information for an existing page description file, you have to use the
|
38
|
-
<a href="{relocatable:
|
38
|
+
<a href="{relocatable: page.page#naming}">standardified name</a> of that page description
|
39
39
|
file (e.g. @filename1.page@ or @filename1.de.page@).
|
40
40
|
|
41
41
|
Using backing files you can add virtual files and directories. If the file specified in the entry
|