webgen 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +300 -0
- data/Rakefile +149 -27
- data/TODO +3 -4
- data/VERSION +1 -1
- data/data/webgen/gallery_styles/slides/collage.rb +7 -4
- data/data/webgen/sipttra_styles/default/README +7 -0
- data/data/webgen/sipttra_styles/default/css/sipttra.rcss +71 -0
- data/data/webgen/sipttra_styles/default/js/sipttra.js +7 -0
- data/data/webgen/sipttra_styles/default/sipttra.template +105 -0
- data/data/webgen/website_styles/1024px/README +3 -0
- data/data/webgen/website_styles/1024px/default.css +3 -3
- data/data/webgen/website_styles/andreas00/README +4 -1
- data/data/webgen/website_styles/andreas00/default.css +2 -2
- data/data/webgen/website_styles/andreas01/README +3 -0
- data/data/webgen/website_styles/andreas01/default.css +3 -3
- data/data/webgen/website_styles/andreas03/README +4 -1
- data/data/webgen/website_styles/andreas03/default.css +2 -2
- data/data/webgen/website_styles/andreas04/README +3 -0
- data/data/webgen/website_styles/andreas04/default.css +2 -2
- data/data/webgen/website_styles/andreas05/README +3 -0
- data/data/webgen/website_styles/andreas05/default.css +2 -2
- data/data/webgen/website_styles/andreas06/README +3 -0
- data/data/webgen/website_styles/andreas06/default.css +3 -2
- data/data/webgen/website_styles/andreas07/README +3 -0
- data/data/webgen/website_styles/andreas07/default.css +4 -4
- data/data/webgen/website_styles/andreas08/README +4 -1
- data/data/webgen/website_styles/andreas08/default.css +2 -2
- data/data/webgen/website_styles/andreas08/default.template +1 -1
- data/data/webgen/website_styles/andreas09/README +3 -0
- data/data/webgen/website_styles/andreas09/default.css +2 -2
- data/data/webgen/website_styles/default/README +1 -1
- data/data/webgen/website_styles/default/default.css +1 -1
- data/data/webgen/website_styles/plain/README +7 -2
- data/data/webgen/website_styles/plain/default.css +2 -2
- data/doc/config.yaml +3 -0
- data/doc/metainfo.yaml +20 -3
- data/doc/src/css/sipttra.rcss +71 -0
- data/doc/src/default.template +10 -5
- data/doc/src/documentation/howto.page +221 -0
- data/doc/src/documentation/plugins/contentconverter/default.page +1 -0
- data/doc/src/documentation/plugins/contentconverter/xmlbuilder.page +2 -2
- data/doc/src/documentation/plugins/core/configuration.page +6 -0
- data/doc/src/documentation/plugins/core/resourcemanager.page +4 -10
- data/doc/src/documentation/plugins/file/defaulthandler.page +1 -0
- data/doc/src/documentation/plugins/file/sipttrahandler.page +18 -0
- data/doc/src/documentation/plugins/file/templatehandler.page +27 -10
- data/doc/src/documentation/plugins/file/thumbnailwriter.page +5 -2
- data/doc/src/documentation/plugins/htmlvalidator/default.page +1 -0
- data/doc/src/documentation/plugins/index.page +2 -2
- data/doc/src/documentation/plugins/menustyle/default.page +1 -0
- data/doc/src/documentation/plugins/tag/breadcrumbtrail.page +12 -0
- data/doc/src/documentation/plugins/tag/customvar.page +11 -0
- data/doc/src/documentation/plugins/tag/default.page +1 -0
- data/doc/src/documentation/references/index.page +8 -0
- data/doc/src/documentation/references/meta_info_reference.page +35 -16
- data/doc/src/documentation/references/resource_reference.page +18 -0
- data/doc/src/documentation/references/sipttra_format.page +241 -0
- data/doc/src/documentation/references/webpage_format.page +4 -0
- data/doc/src/examples/example_sites/index.page +41 -0
- data/doc/src/examples/example_sites/personal.zip +0 -0
- data/doc/src/examples/example_sites/photo_gallery.zip +0 -0
- data/doc/src/examples/index.page +2 -1
- data/doc/src/js/sipttra.js +7 -0
- data/doc/src/news.page +25 -0
- data/doc/src/project.todo +91 -0
- data/doc/src/sipttra.template +105 -0
- data/lib/webgen/cli.rb +31 -1
- data/lib/webgen/config.rb +2 -2
- data/lib/webgen/plugin.rb +7 -3
- data/lib/webgen/plugins/coreplugins/configuration.rb +3 -1
- data/lib/webgen/plugins/filehandlers/filehandler.rb +6 -5
- data/lib/webgen/plugins/filehandlers/sipttra.rb +73 -0
- data/lib/webgen/plugins/filehandlers/template.rb +2 -1
- data/lib/webgen/plugins/miscplugins/treewalker.rb +40 -4
- data/lib/webgen/plugins/tags/breadcrumbtrail.rb +14 -1
- data/lib/webgen/plugins/tags/customvar.rb +54 -0
- data/lib/webgen/sipttra_format.rb +343 -0
- data/lib/webgen/website.rb +25 -1
- data/man/man1/webgen.1 +75 -0
- data/setup.rb +861 -607
- data/test/fixtures/sample_site/src/test.todo +7 -0
- data/test/fixtures/tc_plugin/plugin1.rb +2 -0
- data/test/fixtures/tc_sipttra_format/test.sipttra +46 -0
- data/test/unittests/tc_filehandler_sipttra.rb +26 -0
- data/test/unittests/tc_filehandler_template.rb +2 -1
- data/test/unittests/tc_plugin.rb +8 -1
- data/test/unittests/tc_sipttra_format.rb +58 -0
- data/test/unittests/tc_tags_breadcrumbtrail.rb +34 -0
- data/test/unittests/tc_tags_customvar.rb +24 -0
- data/test/unittests/tc_tags_date.rb +1 -0
- data/test/unittests/tc_tags_includefile.rb +6 -13
- data/test/unittests/tc_treewalker.rb +8 -1
- metadata +37 -3
@@ -242,6 +242,10 @@ use in your ERB code:
|
|
242
242
|
* @ref_node@: the reference node, i.e. the node in which the content will be embedded (normally a
|
243
243
|
template file)
|
244
244
|
|
245
|
+
*Caveat*: you may need to ensure that the ERB start and end tags are not processed by the content
|
246
|
+
converter. For example, with Textile you may need to surround the ERB code with <textile>
|
247
|
+
tags!
|
248
|
+
|
245
249
|
|
246
250
|
h3(#proc-tags). Evaluating webgen Tags
|
247
251
|
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
title: Index
|
3
|
+
directoryName: Example Websites
|
4
|
+
---
|
5
|
+
h2. List of example websites
|
6
|
+
|
7
|
+
|
8
|
+
Here is a list of the available example sites:
|
9
|
+
|
10
|
+
* webgen homepage: included in the webgen distribution in the @doc@ directory
|
11
|
+
|
12
|
+
The webgen homepage uses many features of webgen so it is a very good example for a webgen
|
13
|
+
website.
|
14
|
+
|
15
|
+
* personal homepage example: {download: personal.zip}
|
16
|
+
|
17
|
+
From the README:
|
18
|
+
|
19
|
+
This is an example site for a personal homepage done with webgen.
|
20
|
+
Have a look at the files in the src directory to see what it
|
21
|
+
takes to make the homepage.
|
22
|
+
|
23
|
+
It features, among others, the following things:
|
24
|
+
|
25
|
+
* multilingual pages
|
26
|
+
* dynamic menu generation with some static parts
|
27
|
+
* an automatically generated breadcrumb trail
|
28
|
+
* pages in different markup languages (textile, markdown)
|
29
|
+
|
30
|
+
By running webgen in this directory, the homepage gets built and
|
31
|
+
you can view the output in the output directory with a browser.
|
32
|
+
|
33
|
+
* photo gallery example: {download: photo_gallery.zip}
|
34
|
+
|
35
|
+
From the README:
|
36
|
+
|
37
|
+
This example shows you how to create a simple photo gallery with
|
38
|
+
webgen. It also shows how to use image navigation links in the main
|
39
|
+
template.
|
40
|
+
|
41
|
+
To create the output just run webgen in this directory!
|
Binary file
|
Binary file
|
data/doc/src/examples/index.page
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
title: Index
|
3
3
|
directoryName: Examples
|
4
4
|
---
|
5
|
-
h2
|
5
|
+
h2. Overview
|
6
6
|
|
7
7
|
|
8
8
|
This section shows examples for various parts of webgen. Currently, there are examples for
|
@@ -10,6 +10,7 @@ This section shows examples for various parts of webgen. Currently, there are ex
|
|
10
10
|
* website templates
|
11
11
|
* website styles
|
12
12
|
* gallery styles
|
13
|
+
* whole website done with webgen
|
13
14
|
|
14
15
|
Most of the website styles are from open source web design sites and have been adjusted to work with
|
15
16
|
webgen. Detailed information and full demos of these styles are available at the homepage specified
|
data/doc/src/news.page
CHANGED
@@ -5,6 +5,31 @@ inMenu: true
|
|
5
5
|
h2. News
|
6
6
|
|
7
7
|
|
8
|
+
h3(#news-2007-02-28). 28.02.2007 - webgen 0.4.2
|
9
|
+
|
10
|
+
|
11
|
+
Another minor release which concentrates on fixing some bugs and adding some new features:
|
12
|
+
|
13
|
+
New features:
|
14
|
+
|
15
|
+
* Implemented support for <a href="{relocatable:/documentation/references/sipttra_format.page}">sipttra</a> (Simple Plain Text Tracker) files and using it for the <a href="{relocatable: project.page}">project status page</a>
|
16
|
+
* HTML is now the default content format for template files (also see "FR#7893":http://rubyforge.org/tracker/?func=detail&atid=1210&aid=7893&group_id=296)
|
17
|
+
* New parameters for {plugin: Tag/BreadcrumbTrail}: {param: Tag/BreadcrumbTrail:omitLast} and {param: Tag/BreadcrumbTrail:omitIndexFile} (also see "Patch#7942":http://rubyforge.org/tracker/?func=detail&atid=1209&aid=7942&group_id=296)
|
18
|
+
* New parameter {param: Core/Configuration:customVars} for storing custom global variables and a new plugin {plugin: Tag/CustomVar} for accessing them
|
19
|
+
* Added an example websites section to the examples section (also see "FR#7827":http://rubyforge.org/tracker/?func=detail&atid=1210&aid=7827&group_id=296)!
|
20
|
+
* Added a <a href="{relocatable: documentation/howto.page}">HowTo page</a> which answer some often asked questions!
|
21
|
+
* Added a man page contributed by the Debian project
|
22
|
+
|
23
|
+
Closed bugs:
|
24
|
+
|
25
|
+
* Specifying arguments to the @run@ command to render only certain files now actually works! ;-)
|
26
|
+
* Fixed bug when loading site specific plugins: the use of @load_plugin@ should now work correctly!
|
27
|
+
* All website styles updated to behave correctly when {param: File/DefaultHandler:linkToCurrentPage} is false
|
28
|
+
|
29
|
+
Thanks for the many comments and suggestions since the last release, especially to Bill Paxton,
|
30
|
+
Massimiliano Filacchioni, Erhard Karger, Alejandro Sierra, Fritz Heinrichmeyer and Vincent Fourmond!
|
31
|
+
|
32
|
+
|
8
33
|
h3(#news-2007-01-12). 12.01.2007 - webgen 0.4.1
|
9
34
|
|
10
35
|
|
@@ -0,0 +1,91 @@
|
|
1
|
+
---
|
2
|
+
webgen-metainfo:
|
3
|
+
inMenu: true
|
4
|
+
title: Project Status
|
5
|
+
---
|
6
|
+
|
7
|
+
The following category defines all milestones for webgen:
|
8
|
+
|
9
|
+
|
10
|
+
###### Milestones ######
|
11
|
+
|
12
|
+
|
13
|
+
* Feb07 (2007-02-28) Bug fixes and small enhancements
|
14
|
+
- include patches/requests created since 0.4.1 release
|
15
|
+
- add support for sipttra (Simple Plain Text Tracker) files
|
16
|
+
|
17
|
+
|
18
|
+
* F: Ideas and todo items for future versions
|
19
|
+
|
20
|
+
This milestone holds all ideas/todo items/requests which are implemented some
|
21
|
+
time in the future.
|
22
|
+
|
23
|
+
|
24
|
+
Categories for implementation issues:
|
25
|
+
|
26
|
+
|
27
|
+
###### Implementation (open) ######
|
28
|
+
|
29
|
+
|
30
|
+
* T002 [F] add localization support for all files
|
31
|
+
See also FR#7891
|
32
|
+
|
33
|
+
* T003 [F] add additional tests for sipttra implementation
|
34
|
+
|
35
|
+
|
36
|
+
## Implementation (closed) ##
|
37
|
+
|
38
|
+
* T004 [Feb07] use HTML as default format for templates
|
39
|
+
See also FR#7893
|
40
|
+
|
41
|
+
* T006 [Feb07] add parameter for not showing index files in breadcrumb trail
|
42
|
+
See also PATCH#7942
|
43
|
+
|
44
|
+
* T007 [Feb07] implement a plugin for storing/accessing global variables
|
45
|
+
|
46
|
+
* T001 [Feb07] add support for sipttra files
|
47
|
+
|
48
|
+
|
49
|
+
###### Bugs (open) ######
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
## Bugs (closed) ##
|
54
|
+
|
55
|
+
* T005 [Feb07] check all styles for correctly selected menu items
|
56
|
+
style issues because of new span element when File/DefaultHandler:linkToCurrentPage is false
|
57
|
+
|
58
|
+
* T009 [Feb07] PluginManager#init: log typo for "creating plugin of class..."
|
59
|
+
|
60
|
+
* T012 [Feb07] update copyright notices for included website templates
|
61
|
+
See also Bug#8725
|
62
|
+
|
63
|
+
* T008 [Feb07] PluginLoader shouldn't load plugins that are already loaded in the DEFAULT_WRAPPER_MODULE
|
64
|
+
When site plugins use the load_plugin command to load plugins that are shipped with webgen and loaded by
|
65
|
+
default, some plugins don't work correctly as plugin classes get defined twice with different oids.
|
66
|
+
|
67
|
+
* T013 [Feb07] fix TreeWalker
|
68
|
+
Make TreeWalker work as in 0.3.8 again, name it 'Misc/TreeWalker' and call it after building and
|
69
|
+
before writing tree
|
70
|
+
|
71
|
+
|
72
|
+
Category for documentation issues:
|
73
|
+
|
74
|
+
|
75
|
+
###### Documentation (open) ######
|
76
|
+
|
77
|
+
|
78
|
+
* T014 [F] add plugin developer documentation
|
79
|
+
- document how to write various plugins (file handler, tag, CLI command, ...)
|
80
|
+
- caveat when using classes in modules
|
81
|
+
|
82
|
+
|
83
|
+
## Documentation (closed) ##
|
84
|
+
|
85
|
+
* T010 [Feb07] add some example sites
|
86
|
+
It was requested that one should be able to download some zipped examples sites from the examples
|
87
|
+
section showing basic use cases for webgen.
|
88
|
+
|
89
|
+
* T011 [Feb07] add example section for sipttra style files
|
90
|
+
|
91
|
+
* T015 [Feb07] add a resource reference page with the table of resources
|
@@ -0,0 +1,105 @@
|
|
1
|
+
--- content, html
|
2
|
+
<% sipttra = node.node_info[:sipttra] %>
|
3
|
+
|
4
|
+
<div class="sipttra">
|
5
|
+
|
6
|
+
|
7
|
+
<h1>Milestones</h1>
|
8
|
+
|
9
|
+
<% sipttra.milestones.each do |ms| %>
|
10
|
+
|
11
|
+
<div class="milestone">
|
12
|
+
|
13
|
+
<h2 class="milestone-name" id="ticket-<%= ms.name %>">Milestone: <span><%= ms.name %></span></h2>
|
14
|
+
<p class="milestone-info">
|
15
|
+
<% if ms.due_date %>Due on: <span class="date"><%= ms.due_date %></span><% else %>No due date<% end %>
|
16
|
+
<% if ms.belongs_to %> | <% end %>
|
17
|
+
<% if ms.belongs_to %>Belongs to milestone: <span class="belongs-to"><%= ms.belongs_to %></span><% end %>
|
18
|
+
</p>
|
19
|
+
|
20
|
+
|
21
|
+
<%
|
22
|
+
if ms.all_assigned_tickets.length > 0
|
23
|
+
closed = ms.all_assigned_tickets( :closed ).length
|
24
|
+
all = ms.all_assigned_tickets.length
|
25
|
+
percent = "%.2f" % (100 * closed.to_f / all)
|
26
|
+
%>
|
27
|
+
<div class="progress-info">
|
28
|
+
<div class="progress-bar">
|
29
|
+
<div class="progress-indicator" style="width: <%= percent %>%"></div>
|
30
|
+
</div>
|
31
|
+
<p class="progress-text"><%= closed %> out of <%= all %> tickets (= <%= percent %>%) closed (including tickets in sub milestones)</p>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
|
35
|
+
|
36
|
+
<div class="milestone-summary"><%= CGI.escapeHTML(ms.summary) %></div>
|
37
|
+
<% if !ms.description.to_s.empty? %>
|
38
|
+
<p><b>Detailed description:</b></p>
|
39
|
+
<div class="milestone-description"><%= sipttra.htmlize(ms.description) %></div>
|
40
|
+
<% end %>
|
41
|
+
|
42
|
+
<% if ms.assigned_tickets.length > 0 %>
|
43
|
+
<p>Tickets directly assigned to milestone (<a href="javascript: toogle('assigned-tickets_<%= ms.name %>')">show/hide</a>):</p>
|
44
|
+
<ul id="assigned-tickets_<%= ms.name %>" class="assigned-tickets">
|
45
|
+
<% ms.assigned_tickets.each do |ticket| %>
|
46
|
+
<li>
|
47
|
+
<% if ticket.name.to_s.empty? %>
|
48
|
+
<a href='#category-<%= ticket.category.name %>'><%= CGI.escapeHTML(ticket.summary) %></a>
|
49
|
+
<% else %>
|
50
|
+
<a href='#ticket-<%= ticket.name %>'><%= ticket.name %>: <%= CGI.escapeHTML(ticket.summary) %></a>
|
51
|
+
<% end %>
|
52
|
+
<% if ticket.closed? %>(closed)<% end %>
|
53
|
+
</li>
|
54
|
+
<% end %>
|
55
|
+
</ul>
|
56
|
+
<% end %>
|
57
|
+
|
58
|
+
|
59
|
+
<% if ms.sub_milestones.length > 0 %>
|
60
|
+
<p>Sub milestones (<a href="javascript: toogle('sub-milestones-<%= ms.name %>')">show/hide</a>):</p>
|
61
|
+
<ul id="sub-milestones_<%= ms.name %>" class="sub-milestones">
|
62
|
+
<% ms.sub_milestones.each do |sms| %>
|
63
|
+
<li><a href='#ticket-<%= sms.name %>'><%= sms.name %></a> <% if sms.closed? %>(closed)<% end %></li>
|
64
|
+
<% end %>
|
65
|
+
</ul>
|
66
|
+
<% end %>
|
67
|
+
|
68
|
+
</div>
|
69
|
+
|
70
|
+
<% end %>
|
71
|
+
|
72
|
+
|
73
|
+
<h1>Tickets</h1>
|
74
|
+
|
75
|
+
<% sipttra.category_names.each do |cat_name| %>
|
76
|
+
|
77
|
+
<div class="ticket">
|
78
|
+
|
79
|
+
<h2 id="category-<%= cat_name %>">Category: <%= cat_name %></h2>
|
80
|
+
|
81
|
+
<table class='tickets'>
|
82
|
+
<tr class='header'><th>Name</th><th>Due Date</th><th>Belongs To</th><th>Text</th><th>Type</th></tr>
|
83
|
+
|
84
|
+
<% sipttra.tickets_for_category( cat_name ).each do |ticket| %>
|
85
|
+
<tr class='<%= ticket.category.type %>'>
|
86
|
+
<td class='name'<%= ticket.name ? ' id="ticket-' + ticket.name + '"' : '' %>><%= ticket.name %></td>
|
87
|
+
<td class='due_date'><%= ticket.due_date %></td>
|
88
|
+
<td class='belongs_to'><a href='#ticket-<%= ticket.belongs_to %>'><%= ticket.belongs_to %></a></td>
|
89
|
+
<td class='text'>
|
90
|
+
<% if !ticket.description.empty? %><span style="float:right">(<a href="javascript: toogle('ticket-description-<%= ticket.hash.abs %>')">details</a>)</span><% end %>
|
91
|
+
<%= CGI.escapeHTML(ticket.summary) %>
|
92
|
+
<% if !ticket.description.empty? %><div class="ticket-description" id="ticket-description-<%= ticket.hash.abs %>"><%= BlueCloth.new(ticket.description).to_html %></div><% end %>
|
93
|
+
</td>
|
94
|
+
<td class='type'><%= ticket.category.type %></td>
|
95
|
+
</tr>
|
96
|
+
<% end %>
|
97
|
+
|
98
|
+
</table>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<% end %>
|
103
|
+
|
104
|
+
|
105
|
+
</div>
|
data/lib/webgen/cli.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: cli.rb
|
4
|
+
# $Id: cli.rb 601 2007-02-14 21:20:44Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -200,6 +200,36 @@ module Webgen
|
|
200
200
|
end
|
201
201
|
end
|
202
202
|
self.add_command( useGalleryStyle )
|
203
|
+
|
204
|
+
# Use sipttra style command.
|
205
|
+
useSipttraStyle = CmdParse::Command.new( 'sipttra_style', false )
|
206
|
+
useSipttraStyle.short_desc = "Changes the used sipttra style"
|
207
|
+
useSipttraStyle.description =
|
208
|
+
CliUtils.format("\nCopies the sipttra styles files for the sipttra style STYLE to the website " +
|
209
|
+
"directory defined by the global directory option, overwritting existing files. " +
|
210
|
+
"If the global verbosity level is set to 0 or 1, the copied files are listed.")
|
211
|
+
useSipttraStyle.options = CmdParse::OptionParserWrapper.new do |opts|
|
212
|
+
opts.separator "Available styles:"
|
213
|
+
opts.separator ""
|
214
|
+
Webgen::SipttraStyle.entries.sort.each {|name, entry| CliUtils.dirinfo_output( opts, name, entry ) }
|
215
|
+
end
|
216
|
+
def useSipttraStyle.usage
|
217
|
+
"Usage: #{commandparser.program_name} [global options] use sipttra_style STYLE"
|
218
|
+
end
|
219
|
+
useSipttraStyle.set_execution_block do |args|
|
220
|
+
if args.length == 0
|
221
|
+
raise OptionParser::MissingArgument.new( 'STYLE' )
|
222
|
+
else
|
223
|
+
if @force || ask_overwrite
|
224
|
+
files = Webgen::WebSite.use_sipttra_style( cmdparser.directory, args[0] )
|
225
|
+
if (0..1) === cmdparser.verbosity
|
226
|
+
puts "The following files were created or overwritten:"
|
227
|
+
puts files.collect {|f| "- " + f }.join("\n")
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
232
|
+
self.add_command( useSipttraStyle )
|
203
233
|
end
|
204
234
|
|
205
235
|
#######
|
data/lib/webgen/config.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: config.rb
|
4
|
+
# $Id: config.rb 621 2007-02-28 09:45:30Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -24,7 +24,7 @@ require 'rbconfig'
|
|
24
24
|
|
25
25
|
module Webgen
|
26
26
|
|
27
|
-
VERSION = [0, 4,
|
27
|
+
VERSION = [0, 4, 2]
|
28
28
|
AUTHOR = 'Thomas Leitner <t_leitner@gmx.at>'
|
29
29
|
SUMMARY = "webgen is a templated based static Web site generator."
|
30
30
|
DESCRIPTION = "webgen is a Web site generator implemented in Ruby. " \
|
data/lib/webgen/plugin.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: plugin.rb
|
4
|
+
# $Id: plugin.rb 611 2007-02-19 15:30:54Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -191,6 +191,10 @@ module Webgen
|
|
191
191
|
# The optional parts managed (loaded or not) by this PluginLoader instance.
|
192
192
|
attr_reader :optional_parts
|
193
193
|
|
194
|
+
# The files loaded by this PluginLoader instance.
|
195
|
+
attr_reader :loaded_files
|
196
|
+
|
197
|
+
|
194
198
|
# Creates a new PluginLoader instance. The +wrapper_module+ is used when loading the plugins so
|
195
199
|
# that they do not pollute the global namespace.
|
196
200
|
def initialize( wrapper_module = Module.new )
|
@@ -220,7 +224,7 @@ module Webgen
|
|
220
224
|
load_plugin( file )
|
221
225
|
nil
|
222
226
|
end
|
223
|
-
do_load_file = !@loaded_files.include?( file ) unless file.nil?
|
227
|
+
do_load_file = !@loaded_files.include?( file ) && !DEFAULT_PLUGIN_LOADER.loaded_files.include?( file ) unless file.nil?
|
224
228
|
@loaded_files << file unless file.nil? || @loaded_files.include?( file )
|
225
229
|
cont.call( @wrapper_module, do_load_file ) if cont
|
226
230
|
end
|
@@ -363,7 +367,7 @@ module Webgen
|
|
363
367
|
dep.tsort.each do |plugin_name|
|
364
368
|
config = plugin_class_for_name( plugin_name ).config
|
365
369
|
unless config.infos.has_key?(:instantiate) && !config.infos[:instantiate]
|
366
|
-
log_msg( :debug, 'PluginManager#init') { "Creating
|
370
|
+
log_msg( :debug, 'PluginManager#init') { "Creating instance of plugin #{plugin_name}" }
|
367
371
|
@plugins[plugin_name] = config.plugin_klass.new( self )
|
368
372
|
end
|
369
373
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: configuration.rb
|
4
|
+
# $Id: configuration.rb 598 2007-02-14 19:42:43Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -36,6 +36,8 @@ module CorePlugins
|
|
36
36
|
param 'lang', 'en', 'The default language.'
|
37
37
|
param 'loggerLevel', 2, 'The logging level, ranges from 0 (debug, more verbose) to 3 (error, less verbose)'
|
38
38
|
|
39
|
+
param 'customVars', {}, 'A hash with global custom variables.'
|
40
|
+
|
39
41
|
end
|
40
42
|
|
41
43
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
#--
|
3
3
|
#
|
4
|
-
# $Id: filehandler.rb
|
4
|
+
# $Id: filehandler.rb 620 2007-02-28 09:19:15Z thomas $
|
5
5
|
#
|
6
6
|
# webgen: template based static website generator
|
7
7
|
# Copyright (C) 2004 Thomas Leitner
|
@@ -73,15 +73,16 @@ module FileHandlers
|
|
73
73
|
# Renders the whole website.
|
74
74
|
def render_site
|
75
75
|
tree = build_tree
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
unless tree.nil?
|
77
|
+
@plugin_manager['Misc/TreeWalker'].execute( tree )
|
78
|
+
write_tree( tree )
|
79
|
+
end
|
79
80
|
end
|
80
81
|
|
81
82
|
# Renders only the given +files+.
|
82
83
|
def render_files( files )
|
83
84
|
tree = build_tree
|
84
|
-
return
|
85
|
+
return if tree.nil?
|
85
86
|
files.each do |file|
|
86
87
|
node = tree.resolve_node( file )
|
87
88
|
if !node.nil?
|