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
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: html.rb
|
4
|
+
# $Id: html.rb 349 2005-09-02 09:28:06Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -20,7 +20,7 @@
|
|
20
20
|
#++
|
21
21
|
#
|
22
22
|
|
23
|
-
require 'webgen/plugins/
|
23
|
+
require 'webgen/plugins/contenthandlers/default'
|
24
24
|
|
25
25
|
module ContentHandlers
|
26
26
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: markdown.rb
|
4
|
+
# $Id: markdown.rb 349 2005-09-02 09:28:06Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
begin
|
25
25
|
require 'bluecloth'
|
26
|
-
require 'webgen/plugins/
|
26
|
+
require 'webgen/plugins/contenthandlers/default'
|
27
27
|
|
28
28
|
module ContentHandlers
|
29
29
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: rdoc.rb
|
4
|
+
# $Id: rdoc.rb 349 2005-09-02 09:28:06Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
require 'rdoc/markup/simple_markup'
|
24
24
|
require 'rdoc/markup/simple_markup/to_html'
|
25
|
-
require 'webgen/plugins/
|
25
|
+
require 'webgen/plugins/contenthandlers/default'
|
26
26
|
|
27
27
|
module ContentHandlers
|
28
28
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: textile.rb
|
4
|
+
# $Id: textile.rb 349 2005-09-02 09:28:06Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
begin
|
24
24
|
require 'redcloth'
|
25
|
-
require 'webgen/plugins/
|
25
|
+
require 'webgen/plugins/contenthandlers/default'
|
26
26
|
|
27
27
|
module ContentHandlers
|
28
28
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: configuration.rb
|
4
|
+
# $Id: configuration.rb 349 2005-09-02 09:28:06Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -22,6 +22,7 @@
|
|
22
22
|
|
23
23
|
require 'find'
|
24
24
|
require 'tsort'
|
25
|
+
require 'cmdparse'
|
25
26
|
require 'webgen/node'
|
26
27
|
require 'webgen/plugin'
|
27
28
|
|
@@ -37,14 +38,18 @@ end
|
|
37
38
|
|
38
39
|
module Webgen
|
39
40
|
|
40
|
-
VERSION = [0, 3,
|
41
|
+
VERSION = [0, 3, 7]
|
41
42
|
SUMMARY = "Webgen is a templated based static website generator."
|
42
43
|
DESCRIPTION = "Webgen is a web page generator implemented in Ruby. " \
|
43
44
|
"It is used to generate static web pages from templates and page " \
|
44
45
|
"description files."
|
45
46
|
|
47
|
+
end
|
48
|
+
|
49
|
+
module CorePlugins
|
50
|
+
|
46
51
|
# Responsible for loading the other plugin files and holds the basic configuration options.
|
47
|
-
class Configuration < Plugin
|
52
|
+
class Configuration < Webgen::Plugin
|
48
53
|
|
49
54
|
summary "Responsible for loading plugins and holding general parameters"
|
50
55
|
|
@@ -52,6 +57,10 @@ module Webgen
|
|
52
57
|
add_param 'outDirectory', 'output', 'The directory to which the output files are written.'
|
53
58
|
add_param 'lang', 'en', 'The default language.'
|
54
59
|
|
60
|
+
# Returns the +CommandParser+ object used for parsing the command line. You can add site
|
61
|
+
# specific commands to it by calling the Configuration#add_cmdparser_command method!
|
62
|
+
attr_accessor :cmdparser
|
63
|
+
|
55
64
|
# Returns the data directory of webgen.
|
56
65
|
def self.data_dir
|
57
66
|
unless defined?( @@data_dir )
|
@@ -74,9 +83,13 @@ module Webgen
|
|
74
83
|
@@data_dir
|
75
84
|
end
|
76
85
|
|
86
|
+
def add_cmdparser_command( command )
|
87
|
+
@cmdparser.add_command( command ) if @cmdparser
|
88
|
+
end
|
89
|
+
|
77
90
|
# Does all the initialisation stuff
|
78
91
|
def init_all
|
79
|
-
load_plugins( File.dirname( __FILE__)
|
92
|
+
load_plugins( File.dirname( __FILE__).sub( /coreplugins$/,'' ), File.dirname( __FILE__).sub(/webgen\/plugins\/coreplugins$/, '') )
|
80
93
|
load_plugins( 'plugin', '' )
|
81
94
|
init_plugins
|
82
95
|
end
|
@@ -85,29 +98,36 @@ module Webgen
|
|
85
98
|
# trimmed: if +trimpath+ matches the beginning of the string, +trimpath+ is deleted from it.
|
86
99
|
def load_plugins( path, trimpath )
|
87
100
|
Find.find( path ) do |file|
|
88
|
-
|
89
|
-
|
90
|
-
|
101
|
+
trimmedFile = file.gsub(/^#{trimpath}/, '')
|
102
|
+
Find.prune unless File.directory?( file ) || ( (/.rb$/ =~ file) && !$".include?( trimmedFile ) )
|
103
|
+
if File.file?( file )
|
104
|
+
self.logger.debug { "Loading plugin file <#{file}>..." }
|
105
|
+
require trimmedFile
|
106
|
+
end
|
91
107
|
end
|
92
108
|
end
|
93
109
|
|
94
110
|
# Instantiate the plugins in the correct order, except the classes which have a constant
|
95
|
-
# +VIRTUAL
|
111
|
+
# +VIRTUAL+, and add CommandPlugin instance to the global CommandParser.
|
96
112
|
def init_plugins
|
97
113
|
dep = Dependency.new
|
98
|
-
Plugin.config.each {|k,data| dep[data.plugin] = data.dependencies || []}
|
99
|
-
self.logger.debug { "Dependencies: #{dep.inspect}" }
|
114
|
+
Webgen::Plugin.config.each {|k,data| dep[data.plugin] = data.dependencies || []}
|
100
115
|
dep.tsort.each do |plugin|
|
101
|
-
data = Plugin.config.find {|k,v| v.plugin == plugin }[1]
|
102
|
-
|
103
|
-
|
116
|
+
data = Webgen::Plugin.config.find {|k,v| v.plugin == plugin }[1]
|
117
|
+
unless data.klass.const_defined?( 'VIRTUAL' ) || data.obj
|
118
|
+
self.logger.debug { "Creating plugin of class #{data.klass.name}" }
|
119
|
+
data.obj ||= data.klass.new
|
120
|
+
end
|
121
|
+
end
|
122
|
+
Webgen::Plugin.config.keys.find_all {|klass| klass.ancestors.include?( Webgen::CommandPlugin )}.each do |cmdKlass|
|
123
|
+
add_cmdparser_command( Webgen::Plugin.config[cmdKlass].obj )
|
104
124
|
end
|
105
125
|
end
|
106
126
|
|
107
127
|
end
|
108
128
|
|
109
129
|
# Initialize single configuration instance
|
110
|
-
Plugin.config[Configuration].obj = Configuration.new
|
130
|
+
Webgen::Plugin.config[Configuration].obj = Configuration.new
|
111
131
|
|
112
132
|
end
|
113
133
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: logging.rb
|
4
|
+
# $Id: logging.rb 350 2005-09-02 09:44:23Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -73,9 +73,9 @@ class Module
|
|
73
73
|
|
74
74
|
end
|
75
75
|
|
76
|
-
module
|
76
|
+
module CorePlugins
|
77
77
|
|
78
|
-
class Logging < Plugin
|
78
|
+
class Logging < Webgen::Plugin
|
79
79
|
|
80
80
|
summary "Plugin for configuring the logger"
|
81
81
|
|
@@ -96,6 +96,6 @@ module Webgen
|
|
96
96
|
end
|
97
97
|
|
98
98
|
# Initialize single logging instance
|
99
|
-
Plugin.config[Logging].obj = Logging.new
|
99
|
+
Webgen::Plugin.config[Logging].obj = Logging.new
|
100
100
|
|
101
101
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: resourcemanager.rb
|
4
|
+
# $Id: resourcemanager.rb 350 2005-09-02 09:44:23Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -23,11 +23,11 @@
|
|
23
23
|
require 'rbconfig'
|
24
24
|
require 'fileutils'
|
25
25
|
require 'webgen/plugins/tags/tags'
|
26
|
-
require 'webgen/plugins/
|
26
|
+
require 'webgen/plugins/filehandlers/filehandler'
|
27
27
|
|
28
|
-
module
|
28
|
+
module CorePlugins
|
29
29
|
|
30
|
-
class ResourceManager < Plugin
|
30
|
+
class ResourceManager < Webgen::Plugin
|
31
31
|
|
32
32
|
class Resource
|
33
33
|
|
@@ -131,9 +131,9 @@ module Webgen
|
|
131
131
|
attr_reader :data_dir
|
132
132
|
|
133
133
|
def initialize
|
134
|
-
Plugin.config[self.class].resources = {}
|
135
|
-
Plugin['FileHandler'].add_msg_listener( :AFTER_ALL_WRITTEN, method( :write_resources ) )
|
136
|
-
define_webgen_resources unless
|
134
|
+
Webgen::Plugin.config[self.class].resources = {}
|
135
|
+
Webgen::Plugin['FileHandler'].add_msg_listener( :AFTER_ALL_WRITTEN, method( :write_resources ) )
|
136
|
+
define_webgen_resources unless CorePlugins::Configuration.data_dir.empty?
|
137
137
|
define_user_resources
|
138
138
|
end
|
139
139
|
|
@@ -160,7 +160,7 @@ module Webgen
|
|
160
160
|
|
161
161
|
# Returns the requested resource.
|
162
162
|
def get_resource( name )
|
163
|
-
Plugin.config[self.class].resources[name]
|
163
|
+
Webgen::Plugin.config[self.class].resources[name]
|
164
164
|
end
|
165
165
|
|
166
166
|
|
@@ -178,28 +178,56 @@ module Webgen
|
|
178
178
|
#######
|
179
179
|
|
180
180
|
def define_resource( name, res )
|
181
|
-
if Plugin.config[self.class].resources.has_key?( name )
|
181
|
+
if Webgen::Plugin.config[self.class].resources.has_key?( name )
|
182
182
|
logger.error { "Resource #{name} already defined, not using new definition (#{res.inspect})" }
|
183
183
|
else
|
184
184
|
logger.info { "Adding resource #{name} to pool (#{res.inspect})" }
|
185
|
-
Plugin.config[self.class].resources[name] = res
|
185
|
+
Webgen::Plugin.config[self.class].resources[name] = res
|
186
186
|
end
|
187
187
|
end
|
188
188
|
|
189
189
|
def define_webgen_resources
|
190
|
-
define_file_resource( 'webgen-logo', File.join(
|
190
|
+
define_file_resource( 'webgen-logo', File.join( CorePlugins::Configuration.data_dir, 'resources', 'images', 'webgen_logo.png' ),
|
191
191
|
'/images/webgen-logo.png' ).predefined = "The logo of webgen as seen on the homepage."
|
192
|
-
define_file_resource( 'webgen-generated', File.join(
|
192
|
+
define_file_resource( 'webgen-generated', File.join( CorePlugins::Configuration.data_dir, 'resources', 'images', 'generated_by_webgen.png' ),
|
193
193
|
'/images/webgen-generated-by.png' ).predefined = "A 88x31 image for use on web sites that were generated by webgen."
|
194
|
-
define_file_resource( 'w3c-valid-css', File.join(
|
194
|
+
define_file_resource( 'w3c-valid-css', File.join( CorePlugins::Configuration.data_dir, 'resources', 'images', 'valid-css.gif' ),
|
195
195
|
'/images/w3c-valid-css.gif' ).predefined = 'The W3C image for valid css.'
|
196
|
-
define_file_resource( 'w3c-valid-xhtml11', File.join(
|
196
|
+
define_file_resource( 'w3c-valid-xhtml11', File.join( CorePlugins::Configuration.data_dir, 'resources', 'images', 'valid-xhtml11.png' ),
|
197
197
|
'/images/w3c-valid-xhtml11.png' ).predefined = "The W3C image for valid XHTML1.1"
|
198
198
|
|
199
|
+
define_webgen_emoticons
|
200
|
+
define_webgen_icons
|
201
|
+
|
199
202
|
define_memory_resource( 'webgen-css', '/css/webgen.css' ).predefined = "Plugins use this resource for their CSS styles."
|
200
203
|
define_memory_resource( 'webgen-javascript', '/css/webgen.js' ).predefined = "Plugins use this resource for their Javascript fragments."
|
201
204
|
end
|
202
205
|
|
206
|
+
def define_webgen_emoticons
|
207
|
+
Dir[File.join( CorePlugins::Configuration.data_dir, 'resources', 'emoticons', '*/')].each do |pack_dir|
|
208
|
+
pack = File.basename( pack_dir )
|
209
|
+
Dir[File.join( pack_dir, '*' )].each do |smiley_file|
|
210
|
+
smiley = File.basename( smiley_file, '.*' )
|
211
|
+
res = define_file_resource( "webgen-emoticons-#{pack}-#{smiley}",
|
212
|
+
smiley_file,
|
213
|
+
"/images/emoticons/#{pack}-#{File.basename(smiley_file)}" )
|
214
|
+
res.predefined = "Emoticon from pack '#{pack}' for '#{smiley}'"
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
def define_webgen_icons
|
220
|
+
base_dir = File.join( CorePlugins::Configuration.data_dir, 'resources', 'icons' )
|
221
|
+
Dir[File.join( base_dir, '**/*')].each do |icon|
|
222
|
+
dirs = File.dirname( icon ).sub( /^#{base_dir}/, '' ).split( '/' ).join( '-' )
|
223
|
+
dirs += '-' if dirs.length > 0
|
224
|
+
res = define_file_resource( "webgen-icons-#{dirs}#{File.basename( icon, '.*' )}",
|
225
|
+
icon,
|
226
|
+
"/images/icons/#{dirs}#{File.basename(icon)}" )
|
227
|
+
res.predefined = "Icon named #{File.basename(icon)}"
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
203
231
|
def define_user_resources
|
204
232
|
p = get_param( 'resources' )
|
205
233
|
if !p.kind_of?( Array ) || p.find {|h| !h.kind_of?( Array ) || h.length != 3}
|
@@ -211,7 +239,7 @@ module Webgen
|
|
211
239
|
|
212
240
|
|
213
241
|
def write_resources
|
214
|
-
Plugin.config[self.class].resources.each do |name, res|
|
242
|
+
Webgen::Plugin.config[self.class].resources.each do |name, res|
|
215
243
|
if res.write_resource?
|
216
244
|
begin
|
217
245
|
FileUtils.makedirs( File.dirname( res.dest_path ) )
|
@@ -239,15 +267,9 @@ module Tags
|
|
239
267
|
add_param 'name', nil, 'The name of the resource'
|
240
268
|
add_param 'insert', :path, 'What should be returned by the tag: the path to the resource (value :path) ' \
|
241
269
|
'or the data (value :data)'
|
242
|
-
|
243
270
|
set_mandatory 'name', true
|
244
271
|
|
245
|
-
|
246
|
-
|
247
|
-
def initialize
|
248
|
-
super
|
249
|
-
register_tag( 'resource' )
|
250
|
-
end
|
272
|
+
tag 'resource'
|
251
273
|
|
252
274
|
def process_tag( tag, node, refNode )
|
253
275
|
result = ''
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: backing.rb
|
4
|
+
# $Id: backing.rb 350 2005-09-02 09:44:23Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -20,9 +20,9 @@
|
|
20
20
|
#++
|
21
21
|
#
|
22
22
|
|
23
|
-
require 'webgen/plugins/
|
24
|
-
require 'webgen/plugins/
|
25
|
-
require 'webgen/plugins/
|
23
|
+
require 'webgen/plugins/filehandlers/filehandler'
|
24
|
+
require 'webgen/plugins/filehandlers/directory'
|
25
|
+
require 'webgen/plugins/filehandlers/page'
|
26
26
|
|
27
27
|
module FileHandlers
|
28
28
|
|
@@ -94,7 +94,7 @@ module FileHandlers
|
|
94
94
|
dirNode = create_path( dirname, dirNode )
|
95
95
|
|
96
96
|
self.logger.debug { "Trying to create virtual node for '#{filename}'..." }
|
97
|
-
pageNode = Webgen::Plugin['
|
97
|
+
pageNode = Webgen::Plugin['VirtualPageFileHandler'].create_node_from_data( '', filename, dirNode )
|
98
98
|
dirNode.add_child( pageNode )
|
99
99
|
pageNode.metainfo.update( data )
|
100
100
|
pageNode['int:virtualNode'] = true
|
@@ -120,8 +120,8 @@ module FileHandlers
|
|
120
120
|
node = node.find {|child| /^#{element}\/?$/ =~ child['src'] }
|
121
121
|
end
|
122
122
|
if node.nil?
|
123
|
-
node = FileHandlers::
|
124
|
-
node['processor'] = Webgen::Plugin['
|
123
|
+
node = FileHandlers::DirectoryHandler::DirNode.new( parent, element )
|
124
|
+
node['processor'] = Webgen::Plugin['VirtualDirectoryHandler']
|
125
125
|
parent.add_child( node )
|
126
126
|
self.logger.info { "Created virtual directory <#{node.recursive_value( 'dest' )}>" }
|
127
127
|
end
|
@@ -135,10 +135,10 @@ module FileHandlers
|
|
135
135
|
|
136
136
|
|
137
137
|
# Handles virtual directories, that is, directories that do not exist in the source tree.
|
138
|
-
class
|
138
|
+
class VirtualDirectoryHandler < DirectoryHandler
|
139
139
|
|
140
140
|
summary "Handles virtual directories"
|
141
|
-
depends_on "
|
141
|
+
depends_on "DirectoryHandler"
|
142
142
|
|
143
143
|
def write_node( node )
|
144
144
|
end
|
@@ -146,10 +146,10 @@ module FileHandlers
|
|
146
146
|
end
|
147
147
|
|
148
148
|
# Handles virtual pages, that is, pages that do not exist in the source tree.
|
149
|
-
class
|
149
|
+
class VirtualPageFileHandler < PageFileHandler
|
150
150
|
|
151
151
|
summary "Handles virtual pages"
|
152
|
-
depends_on "
|
152
|
+
depends_on "PageFileHandler"
|
153
153
|
|
154
154
|
def write_node( node )
|
155
155
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id:
|
4
|
+
# $Id: copy.rb 350 2005-09-02 09:44:23Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -21,13 +21,13 @@
|
|
21
21
|
#
|
22
22
|
|
23
23
|
require 'fileutils'
|
24
|
-
require 'webgen/plugins/
|
24
|
+
require 'webgen/plugins/filehandlers/filehandler'
|
25
25
|
|
26
26
|
module FileHandlers
|
27
27
|
|
28
28
|
# A simple file handler which copies files with a specific extension from the source to the output
|
29
29
|
# directory. The extensions of the files to copy are customizable.
|
30
|
-
class
|
30
|
+
class CopyFileHandler < DefaultFileHandler
|
31
31
|
|
32
32
|
summary "Copies files from source to destination without modification"
|
33
33
|
add_param 'paths', ['**/*.css', '**/*.jpg', '**/*.png', '**/*.gif'], \
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: directory.rb
|
4
|
+
# $Id: directory.rb 349 2005-09-02 09:28:06Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -20,12 +20,12 @@
|
|
20
20
|
#++
|
21
21
|
#
|
22
22
|
|
23
|
-
require 'webgen/plugins/
|
23
|
+
require 'webgen/plugins/filehandlers/filehandler'
|
24
24
|
|
25
25
|
module FileHandlers
|
26
26
|
|
27
27
|
# Handles directories.
|
28
|
-
class
|
28
|
+
class DirectoryHandler < DefaultFileHandler
|
29
29
|
|
30
30
|
# Specialized node describing a directory.
|
31
31
|
class DirNode < Node
|
@@ -34,7 +34,7 @@ module FileHandlers
|
|
34
34
|
super( parent )
|
35
35
|
self['title'] = name
|
36
36
|
self['src'] = self['dest'] = name + '/'
|
37
|
-
self['processor'] = Webgen::Plugin['
|
37
|
+
self['processor'] = Webgen::Plugin['DirectoryHandler']
|
38
38
|
self['int:directory?'] = true
|
39
39
|
end
|
40
40
|
|
@@ -44,13 +44,18 @@ module FileHandlers
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def process_dir_index
|
47
|
-
|
48
|
-
if
|
49
|
-
self.logger.info { "Directory index file for <#{self.recursive_value( 'src' )}> => <#{node.recursive_value( 'src', false )}>" }
|
50
|
-
self['indexFile'] = node
|
51
|
-
else
|
52
|
-
self.logger.warn { "No directory index file found for directory <#{self.recursive_value( 'src' )}>" }
|
47
|
+
indexFile = Webgen::Plugin['DirectoryHandler']['indexFile']
|
48
|
+
if indexFile.nil?
|
53
49
|
self['indexFile'] = nil
|
50
|
+
else
|
51
|
+
node = node_for_string( indexFile )
|
52
|
+
if node
|
53
|
+
self.logger.info { "Directory index file for <#{self.recursive_value( 'src' )}> => <#{node.recursive_value( 'src', false )}>" }
|
54
|
+
self['indexFile'] = node
|
55
|
+
else
|
56
|
+
self.logger.warn { "No directory index file found for directory <#{self.recursive_value( 'src' )}>" }
|
57
|
+
self['indexFile'] = nil
|
58
|
+
end
|
54
59
|
end
|
55
60
|
end
|
56
61
|
|