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: horizontal.rb
|
4
|
+
# $Id: horizontal.rb 348 2005-09-02 08:43:33Z 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/menustyles/
|
23
|
+
require 'webgen/plugins/menustyles/default'
|
24
24
|
|
25
25
|
module MenuStyles
|
26
26
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: horizontal_dropdown.rb
|
4
|
+
# $Id: horizontal_dropdown.rb 348 2005-09-02 08:43:33Z 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/menustyles/
|
23
|
+
require 'webgen/plugins/menustyles/default'
|
24
24
|
|
25
25
|
module MenuStyles
|
26
26
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: partial.rb
|
4
|
+
# $Id: partial.rb 348 2005-09-02 08:43:33Z 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/menustyles/
|
23
|
+
require 'webgen/plugins/menustyles/default'
|
24
24
|
|
25
25
|
module MenuStyles
|
26
26
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: vertical.rb
|
4
|
+
# $Id: vertical.rb 348 2005-09-02 08:43:33Z 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/menustyles/
|
23
|
+
require 'webgen/plugins/menustyles/default'
|
24
24
|
|
25
25
|
module MenuStyles
|
26
26
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: vertical_dropdown.rb
|
4
|
+
# $Id: vertical_dropdown.rb 348 2005-09-02 08:43:33Z 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/menustyles/
|
23
|
+
require 'webgen/plugins/menustyles/default'
|
24
24
|
|
25
25
|
module MenuStyles
|
26
26
|
|
@@ -0,0 +1,84 @@
|
|
1
|
+
#
|
2
|
+
#--
|
3
|
+
#
|
4
|
+
# $Id: smileyreplacer.rb 350 2005-09-02 09:44:23Z thomas $
|
5
|
+
#
|
6
|
+
# webgen: template based static website generator
|
7
|
+
# Copyright (C) 2004 Thomas Leitner
|
8
|
+
#
|
9
|
+
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU
|
10
|
+
# General Public License as published by the Free Software Foundation; either version 2 of the
|
11
|
+
# License, or (at your option) any later version.
|
12
|
+
#
|
13
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
14
|
+
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
+
# General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU General Public License along with this program; if not,
|
18
|
+
# write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
+
#
|
20
|
+
#++
|
21
|
+
#
|
22
|
+
|
23
|
+
require 'webgen/plugins/filehandlers/filehandler'
|
24
|
+
require 'webgen/plugins/coreplugins/resourcemanager'
|
25
|
+
|
26
|
+
module MiscPlugins
|
27
|
+
|
28
|
+
class SmileyReplacer < Webgen::Plugin
|
29
|
+
|
30
|
+
summary "Replaces smiley characters with actual smileys"
|
31
|
+
depends_on 'FileHandler', 'ResourceManager'
|
32
|
+
|
33
|
+
add_param 'emoticonPack', nil, 'The name of the emoticon package which should be used. If set to nil, ' \
|
34
|
+
'smileys are not replaced.'
|
35
|
+
|
36
|
+
used_meta_info 'emoticonPack'
|
37
|
+
|
38
|
+
SMILEY_MAP = {
|
39
|
+
':-@' => 'angry',
|
40
|
+
'8-)' => 'cool',
|
41
|
+
':\'-(' => 'cry',
|
42
|
+
':*)' => 'drunk',
|
43
|
+
':-D' => 'lol',
|
44
|
+
':-O' => 'oops',
|
45
|
+
':-(' => 'sad',
|
46
|
+
'|-I' => 'sleep',
|
47
|
+
':-)' => 'smile',
|
48
|
+
':-P' => 'tongue',
|
49
|
+
';-)' => 'wink'
|
50
|
+
}
|
51
|
+
SMILEY_REGEXP = Regexp.union( *SMILEY_MAP.keys.collect {|t| /#{Regexp.escape(t)}/ } )
|
52
|
+
|
53
|
+
def initialize
|
54
|
+
Webgen::Plugin['PageFileHandler'].add_msg_listener( :AFTER_CONTENT_RENDERED, method( :replace_smileys ) )
|
55
|
+
end
|
56
|
+
|
57
|
+
#######
|
58
|
+
private
|
59
|
+
#######
|
60
|
+
|
61
|
+
def replace_smileys( content, node )
|
62
|
+
pack = smiley_pack( node )
|
63
|
+
return if pack.nil?
|
64
|
+
|
65
|
+
logger.info { "Replacing smileys in file <#{node.recursive_value('dest')}>..." }
|
66
|
+
content.gsub!( SMILEY_REGEXP ) do |match|
|
67
|
+
logger.info { "Found smiley #{match}, trying to replace it with emoticon..." }
|
68
|
+
if res = Webgen::Plugin['ResourceManager'].get_resource( "webgen-emoticons-#{pack}-#{SMILEY_MAP[match]}" )
|
69
|
+
res.referenced!
|
70
|
+
"<img src=\"#{res.relpath_from_node( node )}\" alt=\"smiley #{match}\" />"
|
71
|
+
else
|
72
|
+
logger.warn { "Could not replace smiley '#{match}'(#{SMILEY_MAP[match]}) in <#{node.recursive_value('src')}>: resource not found!" }
|
73
|
+
match
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def smiley_pack( node )
|
79
|
+
node.metainfo.has_key?( 'emoticonPack' ) && node['emoticonPack'].nil? ? nil : node['emoticonPack'] || get_param( 'emoticonPack' )
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id:
|
4
|
+
# $Id: breadcrumbtrail.rb 355 2005-09-05 18:04:17Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -24,7 +24,7 @@ require 'webgen/plugins/tags/tags'
|
|
24
24
|
|
25
25
|
module Tags
|
26
26
|
|
27
|
-
# Generates a
|
27
|
+
# Generates a breadcrumb trail. It consists of all pages in the hierarchy of the
|
28
28
|
# current page.
|
29
29
|
#
|
30
30
|
# For example, assuming we have the following branch
|
@@ -32,16 +32,12 @@ module Tags
|
|
32
32
|
# this plugin will generate something like this:
|
33
33
|
# root / directory1 / directory2 / currentFile
|
34
34
|
# where each listed name is linked to the corresponding file.
|
35
|
-
class
|
35
|
+
class BreadcrumbTrailTag < DefaultTag
|
36
36
|
|
37
37
|
summary 'Shows the hierarchy of current page'
|
38
38
|
add_param 'separator', ' / ', 'Separates the hierachy entries from each other.'
|
39
|
-
depends_on 'Tags'
|
40
39
|
|
41
|
-
|
42
|
-
super
|
43
|
-
register_tag( 'navbar' )
|
44
|
-
end
|
40
|
+
tag 'breadcrumbTrail'
|
45
41
|
|
46
42
|
def process_tag( tag, srcNode, refNode )
|
47
43
|
out = []
|
@@ -53,7 +49,7 @@ module Tags
|
|
53
49
|
end
|
54
50
|
|
55
51
|
out = out.reverse.join( get_param( 'separator' ) )
|
56
|
-
self.logger.debug { "
|
52
|
+
self.logger.debug { "Breadcrumb trail for <#{srcNode.recursive_value( 'src' )}>: #{out}" }
|
57
53
|
out
|
58
54
|
end
|
59
55
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: date.rb
|
4
|
+
# $Id: date.rb 324 2005-07-04 12:54:25Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -30,12 +30,8 @@ module Tags
|
|
30
30
|
|
31
31
|
summary "Prints out the date"
|
32
32
|
add_param 'format', '%A, %B %d %H:%M:%S %Z %Y', 'The format of the date (same options as Time#strftime).'
|
33
|
-
depends_on 'Tags'
|
34
33
|
|
35
|
-
|
36
|
-
super
|
37
|
-
register_tag( 'date' )
|
38
|
-
end
|
34
|
+
tag 'date'
|
39
35
|
|
40
36
|
def process_tag( tag, node, refNode )
|
41
37
|
Time.now.strftime( get_param( 'format' ) )
|
@@ -0,0 +1,155 @@
|
|
1
|
+
#
|
2
|
+
#--
|
3
|
+
#
|
4
|
+
# $Id: download.rb 349 2005-09-02 09:28:06Z thomas $
|
5
|
+
#
|
6
|
+
# webgen: template based static website generator
|
7
|
+
# Copyright (C) 2004 Thomas Leitner
|
8
|
+
#
|
9
|
+
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU
|
10
|
+
# General Public License as published by the Free Software Foundation; either version 2 of the
|
11
|
+
# License, or (at your option) any later version.
|
12
|
+
#
|
13
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
14
|
+
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
+
# General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU General Public License along with this program; if not,
|
18
|
+
# write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
+
#
|
20
|
+
#++
|
21
|
+
#
|
22
|
+
|
23
|
+
require 'webgen/plugins/tags/tags'
|
24
|
+
require 'webgen/plugins/coreplugins/resourcemanager'
|
25
|
+
require 'yaml'
|
26
|
+
require 'uri'
|
27
|
+
require 'open-uri'
|
28
|
+
|
29
|
+
module Tags
|
30
|
+
|
31
|
+
class DownloadTag < DefaultTag
|
32
|
+
|
33
|
+
summary "Provides a nice download link and, optional, image "
|
34
|
+
add_param 'url', nil, 'The URL to the file. Can be a local file or one referenced via HTTP/FTP.'
|
35
|
+
add_param 'icon', nil, 'The URL to an icon which will be shown next to the name.'
|
36
|
+
add_param 'alwaysShowDownloadIcon', false, 'Specifies if the download icon should always be shown, or only ' \
|
37
|
+
'when no icon is available for the file type.'
|
38
|
+
add_param 'mappingFile', nil, 'An additional mapping file used for mapping extensions to icons.'
|
39
|
+
set_mandatory 'url', true
|
40
|
+
|
41
|
+
depends_on 'ResourceManager'
|
42
|
+
|
43
|
+
CSS = '
|
44
|
+
.webgen-file-icon, .webgen-download-icon {
|
45
|
+
vertical-align: middle;
|
46
|
+
}
|
47
|
+
'
|
48
|
+
|
49
|
+
tag 'download'
|
50
|
+
|
51
|
+
def initialize
|
52
|
+
super
|
53
|
+
Webgen::Plugin['ResourceManager'].append_data( 'webgen-css', CSS )
|
54
|
+
@default_mapping = load_mapping( File.join( CorePlugins::Configuration.data_dir, 'icon_mapping.yaml' ) )
|
55
|
+
end
|
56
|
+
|
57
|
+
def process_tag( tag, node, refNode )
|
58
|
+
url = get_param( 'url' )
|
59
|
+
return '' if url.nil?
|
60
|
+
|
61
|
+
mapping = @default_mapping.dup
|
62
|
+
mapping.update( load_mapping( get_param( 'mappingFile' ) ) ) if File.exists?( get_param( 'mappingFile' ) || '' )
|
63
|
+
|
64
|
+
icon = file_icon( File.extname( url ), mapping, node )
|
65
|
+
output = ''
|
66
|
+
output << download_icon if get_param( 'alwaysShowDownloadIcon' ) || icon.nil?
|
67
|
+
output << icon unless icon.nil?
|
68
|
+
output << file_link( url, node, refNode )
|
69
|
+
output << file_size( url, refNode )
|
70
|
+
end
|
71
|
+
|
72
|
+
#######
|
73
|
+
private
|
74
|
+
#######
|
75
|
+
|
76
|
+
def download_icon
|
77
|
+
"<img class=\"webgen-download-icon\" src=\"{resource: webgen-icons-download}\" alt=\"Download icon\" />"
|
78
|
+
end
|
79
|
+
|
80
|
+
def file_icon( ext, mapping, node )
|
81
|
+
data = mapping[ext]
|
82
|
+
src = get_param( 'icon' )
|
83
|
+
if src.nil? && !data.nil?
|
84
|
+
if data[0] == :resource
|
85
|
+
src = "{resource: #{data[1]}}"
|
86
|
+
else
|
87
|
+
icon_node = Node.root( node ).node_for_string( data[1] )
|
88
|
+
unless icon_node.nil?
|
89
|
+
src = node.relpath_to_node( icon_node )
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
(src.nil? ? nil : "<img class=\"webgen-file-icon\" src=\"#{src}\" alt=\"File icon\" />")
|
94
|
+
end
|
95
|
+
|
96
|
+
def file_link( url, node, refNode )
|
97
|
+
link = if URI.parse( url ).absolute?
|
98
|
+
url
|
99
|
+
else
|
100
|
+
fileNode = refNode.node_for_string( url )
|
101
|
+
(fileNode.nil? ? '' : node.relpath_to_node( fileNode ))
|
102
|
+
end
|
103
|
+
"<a href=\"#{link}\">#{File.basename( url )}</a>"
|
104
|
+
end
|
105
|
+
|
106
|
+
UNIT_NAMES = ['Byte', 'KiB', 'MiB', 'GiB', 'TiB']
|
107
|
+
|
108
|
+
def file_size( url, refNode )
|
109
|
+
size = nil
|
110
|
+
catch :size do
|
111
|
+
begin
|
112
|
+
if URI.parse( url ).absolute?
|
113
|
+
open( url, :content_length_proc => proc {|size| throw :size} ) {|f| }
|
114
|
+
else
|
115
|
+
fileNode = refNode.node_for_string( url )
|
116
|
+
size = File.size( fileNode.recursive_value( 'src' ) )
|
117
|
+
end
|
118
|
+
rescue
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
if size.nil?
|
123
|
+
logger.warn { "Could not get file size information for file <#{url}>" }
|
124
|
+
''
|
125
|
+
else
|
126
|
+
size, unit = [size.to_f, 0]
|
127
|
+
size, unit = [size / 1024, unit + 1] while size > 1024
|
128
|
+
format_str = if unit == 0
|
129
|
+
" (%d %s)"
|
130
|
+
else
|
131
|
+
" (%.2f %s)"
|
132
|
+
end
|
133
|
+
format_str % [size, UNIT_NAMES[unit]]
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
def load_mapping( file )
|
138
|
+
data = YAML::load( File.read( file ) )
|
139
|
+
mapping = {}
|
140
|
+
if data['resource-mapping']
|
141
|
+
data['resource-mapping'].each do |icon, exts|
|
142
|
+
exts.each {|ext| mapping[ext] = [:resource, icon]}
|
143
|
+
end
|
144
|
+
end
|
145
|
+
if data['file-mapping']
|
146
|
+
data['file-mapping'].each do |icon, exts|
|
147
|
+
exts.each {|ext| mapping[ext] = [:file, icon]}
|
148
|
+
end
|
149
|
+
end
|
150
|
+
mapping
|
151
|
+
end
|
152
|
+
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: executecommand.rb
|
4
|
+
# $Id: executecommand.rb 324 2005-07-04 12:54:25Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -30,16 +30,12 @@ module Tags
|
|
30
30
|
class ExecuteCommandTag < DefaultTag
|
31
31
|
|
32
32
|
summary "Executes the given command and includes its standard output"
|
33
|
-
depends_on 'Tags'
|
34
33
|
add_param 'command', nil, 'The command which should be executed'
|
35
34
|
add_param 'processOutput', true, 'The output of the command will be processed if true'
|
36
35
|
add_param 'escapeHTML', true, 'Special HTML characters in the output will be escaped if true'
|
37
36
|
set_mandatory 'command', true
|
38
37
|
|
39
|
-
|
40
|
-
super
|
41
|
-
register_tag( 'execute' )
|
42
|
-
end
|
38
|
+
tag 'execute'
|
43
39
|
|
44
40
|
def process_tag( tag, node, refNode )
|
45
41
|
@processOutput = get_param( 'processOutput' )
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: includefile.rb
|
4
|
+
# $Id: includefile.rb 324 2005-07-04 12:54:25Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -29,22 +29,18 @@ module Tags
|
|
29
29
|
class IncludeFileTag < DefaultTag
|
30
30
|
|
31
31
|
summary "Includes a file verbatim"
|
32
|
-
depends_on 'Tags'
|
33
32
|
add_param 'filename', nil, 'The name of the file which should be included'
|
34
|
-
add_param 'processOutput', true, 'The file content will be
|
33
|
+
add_param 'processOutput', true, 'The file content will be scanned for tags if true'
|
35
34
|
add_param 'escapeHTML', true, 'Special HTML characters in the file content will be escaped if true'
|
36
35
|
set_mandatory 'filename', true
|
37
36
|
|
38
|
-
|
39
|
-
super
|
40
|
-
register_tag( 'includeFile' )
|
41
|
-
end
|
37
|
+
tag 'includeFile'
|
42
38
|
|
43
39
|
def process_tag( tag, node, refNode )
|
44
40
|
@processOutput = get_param( 'processOutput' )
|
45
41
|
content = ''
|
46
42
|
begin
|
47
|
-
filename = refNode.
|
43
|
+
filename = refNode.parent_dir.recursive_value( 'src' ) + get_param( 'filename' )
|
48
44
|
self.logger.debug { "File location: <#{filename}>" }
|
49
45
|
content = File.read( filename )
|
50
46
|
rescue
|