webgen 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +32 -2
- data/VERSION +1 -1
- data/doc/contentprocessor.template +10 -0
- data/doc/contentprocessor/blocks.page +67 -0
- data/doc/contentprocessor/builder.page +80 -0
- data/doc/contentprocessor/erb.page +51 -33
- data/doc/contentprocessor/haml.page +47 -0
- data/doc/contentprocessor/maruku.page +41 -0
- data/doc/contentprocessor/rdoc.page +36 -0
- data/doc/contentprocessor/redcloth.page +40 -0
- data/doc/contentprocessor/sass.page +32 -0
- data/doc/contentprocessor/tags.page +56 -44
- data/doc/extensions.metainfo +29 -0
- data/doc/extensions.page +15 -4
- data/doc/extensions.template +17 -0
- data/doc/reference_configuration.page +242 -5
- data/doc/reference_metainfo.page +9 -0
- data/doc/sourcehandler.template +21 -0
- data/doc/sourcehandler/copy.page +20 -0
- data/doc/sourcehandler/directory.page +27 -0
- data/doc/sourcehandler/metainfo.page +38 -115
- data/doc/sourcehandler/page.page +9 -27
- data/doc/sourcehandler/template.page +45 -0
- data/doc/sourcehandler/virtual.page +49 -0
- data/doc/tag.template +26 -0
- data/doc/tag/breadcrumbtrail.page +32 -0
- data/doc/tag/coderay.page +49 -0
- data/doc/tag/date.page +31 -0
- data/doc/tag/executecommand.page +26 -0
- data/doc/tag/includefile.page +32 -0
- data/doc/tag/langbar.page +22 -0
- data/doc/tag/menu.page +90 -0
- data/doc/tag/metainfo.page +29 -0
- data/doc/tag/relocatable.page +38 -0
- data/doc/webgen_page_format.page +2 -2
- data/lib/webgen/cli/utils.rb +1 -1
- data/lib/webgen/contentprocessor.rb +5 -0
- data/lib/webgen/contentprocessor/builder.rb +26 -0
- data/lib/webgen/contentprocessor/context.rb +4 -0
- data/lib/webgen/contentprocessor/erb.rb +24 -0
- data/lib/webgen/contentprocessor/haml.rb +25 -0
- data/lib/webgen/contentprocessor/maruku.rb +1 -1
- data/lib/webgen/contentprocessor/rdoc.rb +17 -0
- data/lib/webgen/contentprocessor/sass.rb +18 -0
- data/lib/webgen/default_config.rb +41 -10
- data/lib/webgen/node.rb +3 -2
- data/lib/webgen/path.rb +8 -1
- data/lib/webgen/sourcehandler.rb +15 -10
- data/lib/webgen/sourcehandler/page.rb +9 -1
- data/lib/webgen/tag.rb +6 -0
- data/lib/webgen/tag/breadcrumbtrail.rb +39 -0
- data/lib/webgen/tag/coderay.rb +32 -0
- data/lib/webgen/tag/date.rb +18 -0
- data/lib/webgen/tag/executecommand.rb +26 -0
- data/lib/webgen/tag/includefile.rb +42 -0
- data/lib/webgen/tag/langbar.rb +24 -0
- data/lib/webgen/tag/metainfo.rb +1 -1
- data/lib/webgen/version.rb +1 -1
- data/lib/webgen/webgentask.rb +5 -10
- data/misc/default.css +19 -0
- data/misc/default.template +3 -1
- data/misc/htmldoc.metainfo +3 -0
- data/misc/htmldoc.virtual +1 -1
- data/test/test_contentprocessor_builder.rb +19 -0
- data/test/test_contentprocessor_erb.rb +20 -0
- data/test/test_contentprocessor_haml.rb +20 -0
- data/test/test_contentprocessor_rdoc.rb +16 -0
- data/test/test_contentprocessor_sass.rb +20 -0
- data/test/test_node.rb +6 -2
- data/test/test_path.rb +5 -0
- data/test/test_sourcehandler_page.rb +8 -0
- data/test/test_tag_breadcrumbtrail.rb +78 -0
- data/test/test_tag_coderay.rb +30 -0
- data/test/test_tag_date.rb +16 -0
- data/test/test_tag_executecommand.rb +40 -0
- data/test/test_tag_includefile.rb +48 -0
- data/test/test_tag_langbar.rb +53 -0
- data/test/test_tag_menu.rb +1 -1
- data/test/test_webgentask.rb +21 -0
- metadata +81 -2
@@ -60,13 +60,7 @@ config.sourcehandler.casefold(true, :doc => 'Specifies whether path are consider
|
|
60
60
|
config.sourcehandler.use_hidden_files(false, :doc => 'Specifies whether hidden files (those starting with a dot) are used')
|
61
61
|
config.sourcehandler.ignore(['**/*~', '**/.svn/**'], :doc => 'Path patterns that should be ignored')
|
62
62
|
config.sourcehandler.default_lang_in_output_path(false, :doc => 'Specifies whether output paths in the default language should have the language in the name')
|
63
|
-
|
64
|
-
TODO:put this info into the user docs
|
65
|
-
desc: Defines how the output name should be built. The correct name will be used for the
|
66
|
-
:basename part and the file language will be used for the :lang part. If defaultLangInFilename
|
67
|
-
is true, the :lang part or the subarray in which the :lang part was defined, will be omitted.
|
68
|
-
The :ext part is replaced with the correct extension.
|
69
|
-
=end
|
63
|
+
|
70
64
|
config.sourcehandler.default_meta_info({
|
71
65
|
:all => {
|
72
66
|
'output_path_style' => [:parent, :cnbase, ['.', :lang], :ext]
|
@@ -76,10 +70,10 @@ config.sourcehandler.default_meta_info({
|
|
76
70
|
},
|
77
71
|
'Webgen::SourceHandler::Page' => {
|
78
72
|
'fragments_in_menu' => true,
|
79
|
-
'blocks' => {'default' => {'pipeline' => 'tags,maruku,blocks'}}
|
73
|
+
'blocks' => {'default' => {'pipeline' => 'erb,tags,maruku,blocks'}}
|
80
74
|
},
|
81
75
|
'Webgen::SourceHandler::Template' => {
|
82
|
-
'blocks' => {'default' => {'pipeline' => 'tags,blocks'}}
|
76
|
+
'blocks' => {'default' => {'pipeline' => 'erb,tags,blocks'}}
|
83
77
|
},
|
84
78
|
'Webgen::SourceHandler::Metainfo' => {
|
85
79
|
'blocks' => {1 => {'name' => 'paths'}, 2 => {'name' => 'alcn'}}
|
@@ -105,7 +99,12 @@ config.contentprocessor.map({
|
|
105
99
|
'maruku' => 'Webgen::ContentProcessor::Maruku',
|
106
100
|
'redcloth' => 'Webgen::ContentProcessor::RedCloth',
|
107
101
|
'tags' => 'Webgen::ContentProcessor::Tags',
|
108
|
-
'blocks' => 'Webgen::ContentProcessor::Blocks'
|
102
|
+
'blocks' => 'Webgen::ContentProcessor::Blocks',
|
103
|
+
'erb' => 'Webgen::ContentProcessor::Erb',
|
104
|
+
'haml' => 'Webgen::ContentProcessor::Haml',
|
105
|
+
'sass' => 'Webgen::ContentProcessor::Sass',
|
106
|
+
'rdoc' => 'Webgen::ContentProcessor::RDoc',
|
107
|
+
'builder' => 'Webgen::ContentProcessor::Builder',
|
109
108
|
}, :doc => 'Content processor name to class map')
|
110
109
|
|
111
110
|
Webgen::WebsiteAccess.website.blackboard.add_service(:content_processor_names, Webgen::ContentProcessor.method(:list))
|
@@ -116,6 +115,12 @@ config.contentprocessor.tags.prefix('', :doc => 'The prefix used for tag names t
|
|
116
115
|
config.contentprocessor.tags.map({
|
117
116
|
'relocatable' => 'Webgen::Tag::Relocatable',
|
118
117
|
'menu' => 'Webgen::Tag::Menu',
|
118
|
+
'breadcrumb_trail' => 'Webgen::Tag::BreadcrumbTrail',
|
119
|
+
'langbar' => 'Webgen::Tag::Langbar',
|
120
|
+
'include_file' => 'Webgen::Tag::IncludeFile',
|
121
|
+
'execute_cmd' => 'Webgen::Tag::ExecuteCommand',
|
122
|
+
'coderay' => 'Webgen::Tag::Coderay',
|
123
|
+
'date' => 'Webgen::Tag::Date',
|
119
124
|
:default => 'Webgen::Tag::Metainfo'
|
120
125
|
}, :doc => 'Tag processor name to class map')
|
121
126
|
|
@@ -126,3 +131,29 @@ config.tag.menu.min_levels(1, :doc => 'The minimum number of menu levels that sh
|
|
126
131
|
config.tag.menu.max_levels(3, :doc => 'The maximum number of menu levels that should be shown.')
|
127
132
|
config.tag.menu.show_current_subtree_only(true, :doc => 'Specifies whether only the current subtree should be shown.')
|
128
133
|
config.tag.menu.used_nodes('all', :doc => 'Specifies the kind of nodes that should be used: all, files, or fragments')
|
134
|
+
|
135
|
+
config.tag.breadcrumbtrail.separator(' / ', :doc => 'Separates the hierachy entries from each other.')
|
136
|
+
config.tag.breadcrumbtrail.omit_last(false, :doc => 'Omits the last path component.')
|
137
|
+
config.tag.breadcrumbtrail.omit_index_path(false, :doc => 'Omits the last path component if it is an index path.')
|
138
|
+
|
139
|
+
config.tag.langbar.separator(' | ', :doc => 'Separates the languages from each other.')
|
140
|
+
config.tag.langbar.show_single_lang(true, :doc => 'Should the link be shown although the page is only available in one language?')
|
141
|
+
config.tag.langbar.show_own_lang(true, :doc => 'Should the link to the currently displayed language page be shown?')
|
142
|
+
|
143
|
+
config.tag.includefile.filename(nil, :doc => 'The name of the file which should be included (relative to the website).', :mandatory => 'default')
|
144
|
+
config.tag.includefile.process_output(true, :doc => 'The file content will be scanned for tags if true.')
|
145
|
+
config.tag.includefile.escape_html(true, :doc => 'Special HTML characters in the file content will be escaped if true.')
|
146
|
+
|
147
|
+
config.tag.executecommand.command(nil, :doc => 'The command which should be executed', :mandatory => 'default')
|
148
|
+
config.tag.executecommand.process_output(true, :doc => 'The output of the command will be scanned for tags if true')
|
149
|
+
config.tag.executecommand.escape_html(true, :doc => 'Special HTML characters in the output will be escaped if true')
|
150
|
+
|
151
|
+
config.tag.coderay.lang('ruby', :doc => 'The highlighting language', :mandatory => 'default')
|
152
|
+
config.tag.coderay.process_body(true, :doc => 'The tag body will be scanned for tags first if true')
|
153
|
+
config.tag.coderay.wrap(:div, :doc => 'Specifies how the code should be wrapped, either :div or :span')
|
154
|
+
config.tag.coderay.line_numbers(true, :doc => 'Show line numbers')
|
155
|
+
config.tag.coderay.line_number_start(1, :doc => 'Line number of first line')
|
156
|
+
config.tag.coderay.bold_every(10, :doc => 'The interval at which the line number appears bold')
|
157
|
+
config.tag.coderay.tab_width(8, :doc => 'Number of spaces used for a tabulator')
|
158
|
+
|
159
|
+
config.tag.date.format('%Y-%m-%d %H:%M:%S', :doc => 'The format of the date (same options as Ruby\'s Time#strftime)')
|
data/lib/webgen/node.rb
CHANGED
@@ -267,10 +267,11 @@ module Webgen
|
|
267
267
|
# always need to specify general attributes with Strings!
|
268
268
|
def link_to(node, attr = {})
|
269
269
|
attr = node['link_attrs'].merge(attr) if node['link_attrs'].kind_of?(Hash)
|
270
|
-
|
270
|
+
rnode = node.routing_node(@lang)
|
271
|
+
link_text = attr[:link_text] || (rnode != node && rnode['routed_title']) || node['title']
|
271
272
|
attr.delete_if {|k,v| k.kind_of?(Symbol)}
|
272
273
|
|
273
|
-
use_link = (
|
274
|
+
use_link = (rnode != self || website.config['website.link_to_current_page'])
|
274
275
|
attr['href'] = self.route_to(node) if use_link
|
275
276
|
attrs = attr.collect {|name,value| "#{name.to_s}=\"#{value}\"" }.sort.unshift('').join(' ')
|
276
277
|
(use_link ? "<a#{attrs}>#{link_text}</a>" : "<span#{attrs}>#{link_text}</span>")
|
data/lib/webgen/path.rb
CHANGED
@@ -6,7 +6,8 @@ module Webgen
|
|
6
6
|
# content.
|
7
7
|
#
|
8
8
|
# A webgen source class needs to derive a specialized path class from this class and implement an
|
9
|
-
# approriate #changed? method
|
9
|
+
# approriate #changed? method that returns +true+ if the path's content has changed since the last
|
10
|
+
# webgen run.
|
10
11
|
class Path
|
11
12
|
|
12
13
|
# Helper class for easy access to the content of a path.
|
@@ -74,6 +75,12 @@ module Webgen
|
|
74
75
|
temp
|
75
76
|
end
|
76
77
|
|
78
|
+
# Has the content of this path changed since the last webgen run? This default implementation
|
79
|
+
# always returns +true+, a specialized sub class needs to override this behaviour!
|
80
|
+
def changed?
|
81
|
+
true
|
82
|
+
end
|
83
|
+
|
77
84
|
# Duplicate the path object.
|
78
85
|
def dup
|
79
86
|
temp = super
|
data/lib/webgen/sourcehandler.rb
CHANGED
@@ -58,16 +58,21 @@ module Webgen
|
|
58
58
|
tree.node_access[:alcn].sort.each do |name, node|
|
59
59
|
next if node == tree.dummy_root || !node.dirty
|
60
60
|
node.dirty = node.created = false
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
61
|
+
|
62
|
+
begin
|
63
|
+
if !node['no_output'] && (content = node.content)
|
64
|
+
puts " "*4 + name, :verbose
|
65
|
+
type = if node.is_directory?
|
66
|
+
:directory
|
67
|
+
elsif node.is_fragment?
|
68
|
+
:fragment
|
69
|
+
else
|
70
|
+
:file
|
71
|
+
end
|
72
|
+
output.write(node.path, content, type)
|
73
|
+
end
|
74
|
+
rescue
|
75
|
+
raise RuntimeError, "Error while processing <#{node.absolute_lcn}>: #{$!.message}", $!.backtrace
|
71
76
|
end
|
72
77
|
end
|
73
78
|
end
|
@@ -19,8 +19,16 @@ module Webgen::SourceHandler
|
|
19
19
|
node.node_info[:page] = page
|
20
20
|
tmp_logger = website.logger
|
21
21
|
website.logger = nil # disabling logging whiling creating fragment nodes
|
22
|
+
|
23
|
+
website.cache.permanent[:page_sections] ||= {}
|
24
|
+
sections = if path.changed? || !website.cache.permanent[:page_sections][node.absolute_lcn]
|
25
|
+
website.blackboard.invoke(:parse_html_headers, render_node(node, 'content', []))
|
26
|
+
else
|
27
|
+
website.cache.permanent[:page_sections][node.absolute_lcn]
|
28
|
+
end
|
29
|
+
website.cache.permanent[:page_sections][node.absolute_lcn] = sections
|
22
30
|
website.blackboard.invoke(:create_fragment_nodes,
|
23
|
-
|
31
|
+
sections,
|
24
32
|
node, node.meta_info['fragments_in_menu'])
|
25
33
|
website.logger = tmp_logger
|
26
34
|
end
|
data/lib/webgen/tag.rb
CHANGED
@@ -10,6 +10,12 @@ module Webgen
|
|
10
10
|
autoload :Relocatable, 'webgen/tag/relocatable'
|
11
11
|
autoload :Metainfo, 'webgen/tag/metainfo'
|
12
12
|
autoload :Menu, 'webgen/tag/menu'
|
13
|
+
autoload :BreadcrumbTrail, 'webgen/tag/breadcrumbtrail'
|
14
|
+
autoload :Langbar, 'webgen/tag/langbar'
|
15
|
+
autoload :IncludeFile, 'webgen/tag/includefile'
|
16
|
+
autoload :ExecuteCommand, 'webgen/tag/executecommand'
|
17
|
+
autoload :Coderay, 'webgen/tag/coderay'
|
18
|
+
autoload :Date, 'webgen/tag/date'
|
13
19
|
|
14
20
|
end
|
15
21
|
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'webgen/tag'
|
2
|
+
|
3
|
+
module Webgen::Tag
|
4
|
+
|
5
|
+
# Generates a breadcrumb trail for the page. This is especially useful when pages are in deep
|
6
|
+
# hierarchies of directories.
|
7
|
+
class BreadcrumbTrail
|
8
|
+
|
9
|
+
include Webgen::Tag::Base
|
10
|
+
|
11
|
+
# Create the breadcrumb trail.
|
12
|
+
def call(tag, body, context)
|
13
|
+
out = []
|
14
|
+
node = context.content_node
|
15
|
+
|
16
|
+
omit_index_path = if node.meta_info.has_key?('omit_index_path')
|
17
|
+
node['omit_index_path']
|
18
|
+
else
|
19
|
+
param('tag.breadcrumbtrail.omit_index_path')
|
20
|
+
end
|
21
|
+
omit_index_path = omit_index_path && node.parent.routing_node(node.lang) == node
|
22
|
+
|
23
|
+
node = node.parent if omit_index_path
|
24
|
+
|
25
|
+
until node == node.tree.dummy_root
|
26
|
+
context.dest_node.node_info[:used_nodes] << node.routing_node(context.dest_node.lang).absolute_lcn
|
27
|
+
context.dest_node.node_info[:used_nodes] << node.absolute_lcn
|
28
|
+
out.push(context.dest_node.link_to(node.in_lang(context.content_node.lang)))
|
29
|
+
node = node.parent
|
30
|
+
end
|
31
|
+
out[0] = '' if param('tag.breadcrumbtrail.omit_last') && !omit_index_path
|
32
|
+
out = out.reverse.join(param('tag.breadcrumbtrail.separator'))
|
33
|
+
log(:debug) { "Breadcrumb trail for <#{context.dest_node.absolute_lcn}>: #{out}" }
|
34
|
+
out
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'webgen/websiteaccess'
|
2
|
+
require 'webgen/tag'
|
3
|
+
|
4
|
+
module Webgen::Tag
|
5
|
+
|
6
|
+
# Provides syntax highlighting via the +coderay+ library.
|
7
|
+
class Coderay
|
8
|
+
|
9
|
+
include Webgen::Tag::Base
|
10
|
+
include Webgen::WebsiteAccess
|
11
|
+
|
12
|
+
# Highlight the body of the block.
|
13
|
+
def call(tag, body, context)
|
14
|
+
require 'coderay'
|
15
|
+
options = {
|
16
|
+
:css => :style,
|
17
|
+
:wrap => param('tag.coderay.wrap').to_sym,
|
18
|
+
:line_numbers => (param('tag.coderay.line_numbers') ? :inline : nil),
|
19
|
+
:line_number_start => param('tag.coderay.line_number_start'),
|
20
|
+
:tab_width => param('tag.coderay.tab_width'),
|
21
|
+
:bold_every => param('tag.coderay.bold_every')
|
22
|
+
}
|
23
|
+
|
24
|
+
if param('tag.coderay.process_body')
|
25
|
+
body = website.blackboard.invoke(:content_processor, 'tags').call(context.clone(:content => body)).content
|
26
|
+
end
|
27
|
+
CodeRay.scan(body, param('tag.coderay.lang').to_sym).html(options)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'webgen/tag'
|
2
|
+
|
3
|
+
module Webgen::Tag
|
4
|
+
|
5
|
+
# Prints out the date using a format string which will be passed to Time#strftime. Therefore you
|
6
|
+
# can use everything Time#strftime offers.
|
7
|
+
class Date
|
8
|
+
|
9
|
+
include Base
|
10
|
+
|
11
|
+
# Return the current date formatted as specified.
|
12
|
+
def call(tag, body, context)
|
13
|
+
Time.now.strftime(param('tag.date.format'))
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'webgen/tag'
|
2
|
+
require 'cgi'
|
3
|
+
require "tempfile"
|
4
|
+
|
5
|
+
module Webgen::Tag
|
6
|
+
|
7
|
+
# Executes the given command and returns the standard output. All special HTML characters are
|
8
|
+
# escaped.
|
9
|
+
class ExecuteCommand
|
10
|
+
|
11
|
+
include Webgen::Tag::Base
|
12
|
+
|
13
|
+
# Execute the command and return the standard output.
|
14
|
+
def call(tag, body, context)
|
15
|
+
command = param('tag.executecommand.command')
|
16
|
+
output = `#{command} 2> /dev/null`
|
17
|
+
if ($? >> 8) != 0
|
18
|
+
raise "Command '#{command}' in <#{context.ref_node.absolute_lcn}> has return value != 0: #{output}"
|
19
|
+
end
|
20
|
+
output = CGI::escapeHTML(output) if param('tag.executecommand.escape_html')
|
21
|
+
[output, param('tag.executecommand.process_output')]
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'webgen/websiteaccess'
|
2
|
+
require 'webgen/tag'
|
3
|
+
require 'cgi'
|
4
|
+
|
5
|
+
module Webgen::Tag
|
6
|
+
|
7
|
+
# Includes a file verbatim and optionally escapes all special HTML characters and processes webgen
|
8
|
+
# tags in it.
|
9
|
+
class IncludeFile
|
10
|
+
|
11
|
+
include Webgen::Tag::Base
|
12
|
+
include Webgen::WebsiteAccess
|
13
|
+
|
14
|
+
def initialize #:nodoc:
|
15
|
+
website.blackboard.add_listener(:node_changed?, method(:node_changed?))
|
16
|
+
end
|
17
|
+
|
18
|
+
# Include the specified file verbatim in the output, optionally escaping special HTML characters
|
19
|
+
# and processing tags in it.
|
20
|
+
def call(tag, body, context)
|
21
|
+
filename = param('tag.includefile.filename')
|
22
|
+
filename = File.join(website.directory, filename) unless filename =~ /^(\/|\w:)/
|
23
|
+
content = File.read(filename)
|
24
|
+
content = CGI::escapeHTML(content) if param('tag.includefile.escape_html')
|
25
|
+
(context.dest_node.node_info[:tag_includefile_filenames] ||= []) << [filename, File.mtime(filename)]
|
26
|
+
|
27
|
+
[content, param('tag.includefile.process_output')]
|
28
|
+
end
|
29
|
+
|
30
|
+
#######
|
31
|
+
private
|
32
|
+
#######
|
33
|
+
|
34
|
+
def node_changed?(node)
|
35
|
+
if filenames = node.node_info[:tag_includefile_filenames]
|
36
|
+
node.dirty = true if filenames.any? {|f, mtime| File.mtime(f) > mtime}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'webgen/tag'
|
2
|
+
|
3
|
+
module Webgen::Tag
|
4
|
+
|
5
|
+
# Generates a list with all the languages of the page.
|
6
|
+
class Langbar
|
7
|
+
|
8
|
+
include Webgen::Tag::Base
|
9
|
+
|
10
|
+
# Return a list of all translations of the content page.
|
11
|
+
def call(tag, body, context)
|
12
|
+
lang_nodes = context.content_node.tree.node_access[:acn][context.content_node.absolute_cn]
|
13
|
+
nr_langs = lang_nodes.length
|
14
|
+
result = lang_nodes.
|
15
|
+
reject {|n| (context.content_node.lang == n.lang && !param('tag.langbar.show_own_lang')) }.
|
16
|
+
sort {|a, b| a.lang <=> b.lang}.
|
17
|
+
collect {|n| context.dest_node.link_to(n, :link_text => n.lang)}.
|
18
|
+
join(param('tag.langbar.separator'))
|
19
|
+
(param('tag.langbar.show_single_lang') || nr_langs > 1 ? result : "")
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
data/lib/webgen/tag/metainfo.rb
CHANGED
@@ -15,7 +15,7 @@ module Webgen::Tag
|
|
15
15
|
elsif context.content_node[tag]
|
16
16
|
output = context.content_node[tag].to_s
|
17
17
|
else
|
18
|
-
log(:warn) { "No value for
|
18
|
+
log(:warn) { "No value for meta info key '#{tag}' in <#{context.ref_node.absolute_lcn}> found in <#{context.content_node.absolute_lcn}>" }
|
19
19
|
end
|
20
20
|
output
|
21
21
|
end
|
data/lib/webgen/version.rb
CHANGED
data/lib/webgen/webgentask.rb
CHANGED
@@ -125,16 +125,11 @@ module Webgen
|
|
125
125
|
def define # :nodoc:
|
126
126
|
desc "Render the webgen website"
|
127
127
|
task @name, :verbosity, :log_level do |t, args|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
website.render
|
134
|
-
rescue => e
|
135
|
-
puts "webgen task failed: #{e}"
|
136
|
-
raise e
|
137
|
-
end
|
128
|
+
require 'webgen/website'
|
129
|
+
website = Webgen::Website.new(@directory, Webgen::Logger.new($stdout), &@config_block)
|
130
|
+
website.logger.verbosity = args[:verbosity].to_s.intern unless args[:verbosity].to_s.empty?
|
131
|
+
website.logger.level = args[:log_level].to_i if args[:log_level]
|
132
|
+
website.render
|
138
133
|
end
|
139
134
|
|
140
135
|
task :clobber => paste('clobber_', @name)
|
data/misc/default.css
CHANGED
@@ -307,6 +307,25 @@ blockquote pre {
|
|
307
307
|
padding: 2px;
|
308
308
|
}
|
309
309
|
|
310
|
+
/* extensions classes */
|
311
|
+
.backlink {
|
312
|
+
float: right;
|
313
|
+
}
|
314
|
+
|
315
|
+
table.examples {
|
316
|
+
border: 1px solid black;
|
317
|
+
border-collapse: collapse;
|
318
|
+
margin-left: auto;
|
319
|
+
margin-right: auto;
|
320
|
+
width: 80%;
|
321
|
+
}
|
322
|
+
|
323
|
+
table.examples td, table.examples th {
|
324
|
+
border: 1px solid black;
|
325
|
+
padding: 3px;
|
326
|
+
}
|
327
|
+
|
328
|
+
|
310
329
|
|
311
330
|
/* plugin documentation classes */
|
312
331
|
.plugin-info .param-name {
|
data/misc/default.template
CHANGED
@@ -58,12 +58,14 @@
|
|
58
58
|
|
59
59
|
<div class="col2 float-right">
|
60
60
|
<p>
|
61
|
-
©
|
61
|
+
© 2008 Thomas Leitner | generated by <a href="http://webgen.rubyforge.org">webgen</a><br />
|
62
62
|
Design based on Ablaze 2.1 by <a href="http://www.styleshout.com/">styleshout</a><br />
|
63
63
|
Block quote icons originally by <a href="http://fullahead.org/">Fullahead</a><br />
|
64
64
|
Valid <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> |
|
65
65
|
<a href="http://validator.w3.org/check/referer">XHTML</a>
|
66
66
|
</p>
|
67
|
+
|
68
|
+
<p>Page last changed at: {date:}</p>
|
67
69
|
</div>
|
68
70
|
|
69
71
|
</div></div>
|