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
data/doc/src/design.gallery
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
title: Design Gallery
|
2
|
-
files: designs/*.png
|
3
|
-
|
4
|
-
mainPage:
|
5
|
-
menuOrder: 8
|
6
|
-
|
7
|
-
designs/curdesign.png:
|
8
|
-
title: Default Design
|
9
|
-
description: This is the default and the current design for the webgen homepage.
|
10
|
-
|
11
|
-
designs/nostyle.png:
|
12
|
-
title: Without Stylesheet
|
13
|
-
description: The default homepage with the stylesheet disabled. Not very nice, but
|
14
|
-
still useable.
|
15
|
-
|
16
|
-
designs/old.png:
|
17
|
-
title: Old Design
|
18
|
-
description: The old design of the homepage.
|
Binary file
|
data/doc/src/designs/nostyle.png
DELETED
Binary file
|
data/doc/src/designs/old.png
DELETED
Binary file
|
@@ -1,12 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: Default Gallery Layouter
|
3
|
-
inMenu: true
|
4
|
-
---
|
5
|
-
h2. Information
|
6
|
-
|
7
|
-
<notextile>{describe: DefaultGalleryLayouter}</notextile>
|
8
|
-
|
9
|
-
h2. Description
|
10
|
-
|
11
|
-
This plugin serves as base class for all picture gallery layouters and provides a default
|
12
|
-
implementation.
|
@@ -1,20 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: Navigation Bar
|
3
|
-
inMenu: true
|
4
|
-
---
|
5
|
-
h2. Information
|
6
|
-
|
7
|
-
<notextile>{describe: NavbarTag}</notextile>
|
8
|
-
|
9
|
-
h2. Description
|
10
|
-
|
11
|
-
The navigation bar tag is used to display the hierarchy for the current page. You can see it in
|
12
|
-
action in the lower left corner of the header.
|
13
|
-
|
14
|
-
h2. Examples
|
15
|
-
|
16
|
-
table{border:1px solid black}.
|
17
|
-
|_.Command|_.Output|
|
18
|
-
|\{navbar:}|{navbar:}|
|
19
|
-
|<notextile>\{navbar: {separator: " HALLO "}}</notextile>|<notextile>{navbar: {separator: " HALLO "}}</notextile>|
|
20
|
-
|
data/lib/webgen/webgen.rb
DELETED
@@ -1,271 +0,0 @@
|
|
1
|
-
#
|
2
|
-
#--
|
3
|
-
#
|
4
|
-
# $Id: webgen.rb 334 2005-08-23 19:11:53Z 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 'optparse'
|
24
|
-
require 'rbconfig'
|
25
|
-
require 'fileutils'
|
26
|
-
require 'cmdparse'
|
27
|
-
require 'webgen/plugin'
|
28
|
-
|
29
|
-
module Webgen
|
30
|
-
|
31
|
-
class Color
|
32
|
-
|
33
|
-
@@colors = {:bold => [0, 1], :green => [0, 32], :lblue => [1, 34], :lred => [1, 31], :reset => [0, 0]}
|
34
|
-
|
35
|
-
def Color.colorify
|
36
|
-
@@colors.each do |color, values|
|
37
|
-
module_eval <<-EOF
|
38
|
-
def Color.#{color.to_s}
|
39
|
-
"\e[#{values[0]};#{values[1]}m"
|
40
|
-
end
|
41
|
-
EOF
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def Color.method_missing( id )
|
46
|
-
''
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
|
52
|
-
class RunWebgenCommand < CommandParser::Command
|
53
|
-
|
54
|
-
def initialize; super( 'run' ); end
|
55
|
-
|
56
|
-
def description; "Runs webgen. This command is used as default command when no command was issued."; end
|
57
|
-
|
58
|
-
def usage; "Usage: #{@options.program_name} [global options] run"; end
|
59
|
-
|
60
|
-
def execute( commandParser, args )
|
61
|
-
logger.info "Starting Webgen..."
|
62
|
-
|
63
|
-
# load all the files in src dir and build tree
|
64
|
-
tree = Plugin['FileHandler'].build_tree
|
65
|
-
|
66
|
-
# execute tree transformer plugins
|
67
|
-
Plugin['TreeWalker'].execute( tree ) unless tree.nil?
|
68
|
-
|
69
|
-
# generate output files
|
70
|
-
Plugin['FileHandler'].write_tree( tree ) unless tree.nil?
|
71
|
-
|
72
|
-
logger.info "Webgen finished"
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
|
77
|
-
class ShowCommand < CommandParser::Command
|
78
|
-
|
79
|
-
def initialize; super( 'show' ); end
|
80
|
-
|
81
|
-
def description; "Shows all available plugins or their configuration items."; end
|
82
|
-
|
83
|
-
def usage; "Usage: #{@options.program_name} [global options] show plugins|config"; end
|
84
|
-
|
85
|
-
def execute( commandParser, args )
|
86
|
-
case args[0]
|
87
|
-
when 'plugins' then showPlugins
|
88
|
-
when 'config' then showConfiguration
|
89
|
-
else puts "You have to specify either 'plugins' or 'config'"
|
90
|
-
end
|
91
|
-
exit
|
92
|
-
end
|
93
|
-
|
94
|
-
private
|
95
|
-
|
96
|
-
def showPlugins
|
97
|
-
print "List of loaded plugins:\n"
|
98
|
-
|
99
|
-
headers = Hash.new {|h,k| h[k] = (k.nil? ? "Other Plugins" : k.gsub(/([A-Z][a-z])/, ' \1').strip) }
|
100
|
-
|
101
|
-
ljustlength = 30 + Color.green.length + Color.reset.length
|
102
|
-
header = ''
|
103
|
-
Plugin.config.sort { |a, b| a[0].name <=> b[0].name }.each do |klass, data|
|
104
|
-
newHeader = headers[klass.name[/^.*?(?=::)/]]
|
105
|
-
unless newHeader == header
|
106
|
-
print "\n #{Color.bold}#{newHeader}#{Color.reset}:\n";
|
107
|
-
header = newHeader
|
108
|
-
end
|
109
|
-
print " - #{Color.green}#{data.plugin}#{Color.reset}:".ljust(ljustlength) +"#{data.summary}\n"
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
def showConfiguration
|
114
|
-
print "List of configuration parameters:\n\n"
|
115
|
-
ljustlength = 20 + Color.green.length + Color.reset.length
|
116
|
-
Plugin.config.sort { |a, b| a[0].name <=> b[0].name }.each do |klass, data|
|
117
|
-
next if data.params.nil?
|
118
|
-
print " #{Color.bold}#{data.plugin}#{Color.reset}:\n"
|
119
|
-
data.params.sort.each do |key, item|
|
120
|
-
print " #{Color.green}Parameter:#{Color.reset}".ljust(ljustlength)
|
121
|
-
puts Color.lred + item.name + Color.reset + " = " + Color.lblue + item.value.inspect + Color.reset + " (" + item.default.inspect + ")"
|
122
|
-
puts " #{Color.green}Description:#{Color.reset}".ljust(ljustlength) + item.description
|
123
|
-
print "\n"
|
124
|
-
end
|
125
|
-
print "\n"
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
end
|
130
|
-
|
131
|
-
|
132
|
-
class CreateCommand < CommandParser::Command
|
133
|
-
|
134
|
-
def initialize; super( 'create' ); end
|
135
|
-
|
136
|
-
def description;
|
137
|
-
"Creates the basic directories and files for webgen. This includes the source and output directories, " \
|
138
|
-
"the log and the plugin directory. Also, a basic template plus a CSS and an index file are created."
|
139
|
-
end
|
140
|
-
|
141
|
-
def usage; "Usage: #{@options.program_name} [global options] create DIR"; end
|
142
|
-
|
143
|
-
def execute( commandParser, args )
|
144
|
-
if args.length == 0
|
145
|
-
raise OptionParser::MissingArgument.new( 'DIR' )
|
146
|
-
else
|
147
|
-
FileUtils.cp_r( File.join( Webgen::Configuration.data_dir, 'example' ), args[0] )
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
end
|
152
|
-
|
153
|
-
|
154
|
-
class CleanCommand < CommandParser::Command
|
155
|
-
|
156
|
-
module ::FileUtils
|
157
|
-
|
158
|
-
def fu_output_message( msg )
|
159
|
-
logger.info { msg }
|
160
|
-
end
|
161
|
-
|
162
|
-
def ask_before_delete( ask, func, list, options = {} )
|
163
|
-
newlist = [*list].collect {|e| "'" + e + "'"}.join(', ')
|
164
|
-
if ask
|
165
|
-
print "Really delete #{newlist}? "
|
166
|
-
return unless /y|Y/ =~ gets.strip
|
167
|
-
end
|
168
|
-
self.send( func, list, options.merge( :verbose => true ) )
|
169
|
-
end
|
170
|
-
|
171
|
-
end
|
172
|
-
|
173
|
-
class CleanWalker < Webgen::Plugin
|
174
|
-
|
175
|
-
summary "Deletes the output file for each node."
|
176
|
-
depends_on 'TreeWalker'
|
177
|
-
|
178
|
-
attr_writer :ask
|
179
|
-
|
180
|
-
def handle_node( node, level )
|
181
|
-
file = node.recursive_value( 'dest' )
|
182
|
-
return if !File.exists?( file ) || node['int:virtualNode']
|
183
|
-
if File.directory?( file )
|
184
|
-
begin
|
185
|
-
FileUtils.ask_before_delete( @ask, :rmdir, file )
|
186
|
-
rescue Errno::ENOTEMPTY => e
|
187
|
-
logger.info "Cannot delete directory #{file}, as it is not empty!"
|
188
|
-
end
|
189
|
-
else
|
190
|
-
FileUtils.ask_before_delete( @ask, :rm, file, :force => true )
|
191
|
-
end
|
192
|
-
end
|
193
|
-
|
194
|
-
end
|
195
|
-
|
196
|
-
def initialize;
|
197
|
-
super( 'clean' )
|
198
|
-
@all = false
|
199
|
-
@ask = false
|
200
|
-
options.separator( "Options" )
|
201
|
-
options.on( '--all', '-a', "Removes ALL files from the output directory" ) { @all = true }
|
202
|
-
options.on( '--interactive', '-i', "Ask for each file" ) { @ask = true }
|
203
|
-
end
|
204
|
-
|
205
|
-
def description; "Removes the generated or all files from the output directory"; end
|
206
|
-
|
207
|
-
def usage; "Usage: #{@options.program_name} [global options] clean [options]"; end
|
208
|
-
|
209
|
-
def execute( commandParser, args )
|
210
|
-
if @all
|
211
|
-
logger.info( "Deleting all files from output directory..." )
|
212
|
-
outDir = Plugin['Configuration']['outDirectory']
|
213
|
-
FileUtils.ask_before_delete( @ask, :rm_rf, outDir ) if File.exists?( outDir )
|
214
|
-
else
|
215
|
-
tree = Plugin['FileHandler'].build_tree
|
216
|
-
logger.info( "Deleting generated files from output directory..." )
|
217
|
-
Plugin['CleanWalker'].ask = @ask
|
218
|
-
Plugin['TreeWalker'].execute( tree, Plugin['CleanWalker'], :backward )
|
219
|
-
end
|
220
|
-
logger.info( "Webgen finished 'clean' command" )
|
221
|
-
end
|
222
|
-
|
223
|
-
private
|
224
|
-
|
225
|
-
end
|
226
|
-
|
227
|
-
class WebgenCommandParser < CommandParser
|
228
|
-
|
229
|
-
def initialize
|
230
|
-
super( true )
|
231
|
-
self.options do |opts|
|
232
|
-
opts.program_name = "webgen"
|
233
|
-
opts.version = Webgen::VERSION
|
234
|
-
opts.summary_width = 25
|
235
|
-
opts.summary_indent = ' '
|
236
|
-
|
237
|
-
opts.banner = "Usage: webgen [global options] COMMAND [command options]\n#{Webgen::SUMMARY}"
|
238
|
-
|
239
|
-
opts.separator ""
|
240
|
-
opts.separator "Global options:"
|
241
|
-
|
242
|
-
opts.on( "--verbosity LEVEL", "-V", Integer, "The verbosity level" ) { |verbosity| Plugin.set_param( 'Logging', 'verbosityLevel', verbosity ) }
|
243
|
-
opts.on( "--[no-]logfile", "-L", "Log to file" ) { |logfile| Plugin.set_param( 'Logging', 'logToFile', logfile ) }
|
244
|
-
|
245
|
-
opts.separator ""
|
246
|
-
end
|
247
|
-
|
248
|
-
self.add_command( RunWebgenCommand.new, true )
|
249
|
-
self.add_command( ShowCommand.new )
|
250
|
-
self.add_command( CreateCommand.new )
|
251
|
-
self.add_command( CleanCommand.new )
|
252
|
-
self.add_command( CommandParser::HelpCommand.new )
|
253
|
-
self.add_command( CommandParser::VersionCommand.new )
|
254
|
-
end
|
255
|
-
|
256
|
-
end
|
257
|
-
|
258
|
-
|
259
|
-
class WebgenMain
|
260
|
-
|
261
|
-
def main( cmdOptions )
|
262
|
-
Color.colorify if $stdout.isatty && !Config::CONFIG['arch'].include?( 'mswin32' )
|
263
|
-
wcp = WebgenCommandParser.new
|
264
|
-
wcp.parse!( ARGV, false )
|
265
|
-
Plugin['Configuration'].init_all
|
266
|
-
wcp.execute
|
267
|
-
end
|
268
|
-
|
269
|
-
end
|
270
|
-
|
271
|
-
end
|
data/testsite/config.yaml
DELETED
data/testsite/src/bghack.png
DELETED
Binary file
|
data/testsite/src/bluecloth.page
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
---
|
2
|
-
blocks:
|
3
|
-
- {name: content, format: markdown}
|
4
|
-
---
|
5
|
-
BlueCloth
|
6
|
-
=========
|
7
|
-
|
8
|
-
Version 0.0.4b - 2004/06/01
|
9
|
-
|
10
|
-
Original version by John Gruber <http://daringfireball.net/>.
|
11
|
-
Ruby port by Michael Granger <http://www.deveiate.org/>.
|
12
|
-
|
13
|
-
BlueCloth is a Ruby implementation of [Markdown][1], a text-to-HTML conversion
|
14
|
-
tool for web writers. To quote from the project page: Markdown allows you to
|
15
|
-
write using an easy-to-read, easy-to-write plain text format, then convert it to
|
16
|
-
structurally valid XHTML (or HTML).
|
17
|
-
|
18
|
-
It borrows a naming convention and several helpings of interface from
|
19
|
-
[Redcloth][2], [Why the Lucky Stiff][3]'s processor for a similar text-to-HTML
|
20
|
-
conversion syntax called [Textile][4].
|
21
|
-
|
22
|
-
|
23
|
-
Installation
|
24
|
-
------------
|
25
|
-
|
26
|
-
You can install this module either by running the included `install.rb` script,
|
27
|
-
or by simply copying `lib/bluecloth.rb` to a directory in your load path.
|
28
|
-
|
29
|
-
|
30
|
-
Dependencies
|
31
|
-
------------
|
32
|
-
|
33
|
-
BlueCloth uses the `StringScanner` class from the `strscan` library, which comes
|
34
|
-
with Ruby 1.8.x and later or may be downloaded from the RAA for earlier
|
35
|
-
versions, and the `logger` library, which is also included in 1.8.x and later.
|
36
|
-
|
37
|
-
|
38
|
-
Example Usage
|
39
|
-
-------------
|
40
|
-
|
41
|
-
The BlueCloth class is a subclass of Ruby's String, and can be used thusly:
|
42
|
-
|
43
|
-
bc = BlueCloth::new( str )
|
44
|
-
puts bc.to_html
|
45
|
-
|
46
|
-
This `README` file is an example of Markdown syntax. The sample program
|
47
|
-
`bluecloth` in the `bin/` directory can be used to convert this (or any other)
|
48
|
-
file with Markdown syntax into HTML:
|
49
|
-
|
50
|
-
$ bin/bluecloth README > README.html
|
51
|
-
|
52
|
-
|
53
|
-
Acknowledgements
|
54
|
-
----------------
|
55
|
-
|
56
|
-
This library is a port of the canonical Perl one, and so owes most of its
|
57
|
-
functionality to its author, John Gruber. The bugs in this code are most
|
58
|
-
certainly an artifact of my porting it and not an artifact of the excellent code
|
59
|
-
from which it is derived.
|
60
|
-
|
61
|
-
It also, as mentioned before, borrows its API liberally from RedCloth, both for
|
62
|
-
compatibility's sake, and because I think Why's code is beautiful. His excellent
|
63
|
-
code and peerless prose have been an inspiration to me, and this module is
|
64
|
-
intended as the sincerest flattery.
|
65
|
-
|
66
|
-
Also contributing to any success this module may enjoy are those among my peers
|
67
|
-
who have taken the time to help out, either by submitting patches, testing, or
|
68
|
-
offering suggestions and review:
|
69
|
-
|
70
|
-
* Martin Chase <stillflame@FaerieMUD.org>
|
71
|
-
* Florian Gross <flgr@ccan.de>
|
72
|
-
|
73
|
-
|
74
|
-
Author/Legal
|
75
|
-
------------
|
76
|
-
|
77
|
-
Original version:
|
78
|
-
Copyright (c) 2003-2004 John Gruber
|
79
|
-
<http://daringfireball.net/>
|
80
|
-
All rights reserved.
|
81
|
-
|
82
|
-
Ruby version:
|
83
|
-
Copyright (c) 2004 The FaerieMUD Consortium
|
84
|
-
|
85
|
-
BlueCloth is free software; you can redistribute it and/or modify it under the
|
86
|
-
terms of the GNU General Public License as published by the Free Software
|
87
|
-
Foundation; either version 2 of the License, or (at your option) any later
|
88
|
-
version.
|
89
|
-
|
90
|
-
BlueCloth is distributed in the hope that it will be useful, but WITHOUT ANY
|
91
|
-
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
92
|
-
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
93
|
-
|
94
|
-
|
95
|
-
[1]: http://daringfireball.net/projects/markdown/
|
96
|
-
[2]: http://www.whytheluckystiff.net/ruby/redcloth/
|
97
|
-
[3]: http://www.whytheluckystiff.net/
|
98
|
-
[4]: http://www.textism.com/tools/textile/
|
99
|
-
|
100
|
-
|
101
|
-
$Id: README 51 2004-06-21 15:20:59Z deveiant $
|
102
|
-
$URL: svn+ssh://cvs.faeriemud.org/var/svn/BlueCloth/trunk/README $
|