webgen 1.0.0.beta3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/COPYING +23 -1
- data/Rakefile +16 -77
- data/VERSION +1 -1
- data/bin/webgen +0 -0
- data/data/webgen/basic_website_template/ext/init.rb +3 -1
- data/data/webgen/basic_website_template/src/.gitignore +0 -0
- data/data/webgen/basic_website_template/webgen.config +1 -1
- data/data/webgen/bundle_template_files/info.yaml.erb +14 -2
- data/data/webgen/passive_sources/default.metainfo +10 -0
- data/data/webgen/passive_sources/templates/api.template +16 -2
- data/data/webgen/passive_sources/templates/feed.template +5 -5
- data/data/webgen/passive_sources/templates/sitemap.template +1 -1
- data/data/webgen/passive_sources/templates/tag.template +8 -4
- data/lib/webgen/blackboard.rb +21 -5
- data/lib/webgen/bundle/built-in-show-changes/info.yaml +17 -0
- data/lib/webgen/bundle/built-in-show-changes/init.rb +4 -5
- data/lib/webgen/bundle/built-in/info.yaml +1064 -0
- data/lib/webgen/bundle/built-in/init.rb +103 -136
- data/lib/webgen/bundle_loader.rb +82 -9
- data/lib/webgen/cli.rb +12 -8
- data/lib/webgen/cli/commands/create.rb +27 -0
- data/lib/webgen/cli/{create_bundle_command.rb → commands/create_bundle.rb} +2 -2
- data/lib/webgen/cli/{create_command.rb → commands/create_website.rb} +2 -2
- data/lib/webgen/cli/commands/generate.rb +66 -0
- data/lib/webgen/cli/{install_bundle_command.rb → commands/install.rb} +1 -1
- data/lib/webgen/cli/{show_command.rb → commands/show.rb} +6 -4
- data/lib/webgen/cli/{list_bundle_command.rb → commands/show_bundles.rb} +12 -15
- data/lib/webgen/cli/{show_config_command.rb → commands/show_config.rb} +34 -6
- data/lib/webgen/cli/{show_dependencies_command.rb → commands/show_dependencies.rb} +0 -0
- data/lib/webgen/cli/{show_extensions_command.rb → commands/show_extensions.rb} +1 -13
- data/lib/webgen/cli/{show_tree_command.rb → commands/show_tree.rb} +3 -0
- data/lib/webgen/cli/utils.rb +1 -1
- data/lib/webgen/configuration.rb +9 -11
- data/lib/webgen/content_processor/html_head.rb +3 -4
- data/lib/webgen/content_processor/rainpress.rb +21 -0
- data/lib/webgen/content_processor/sass.rb +8 -8
- data/lib/webgen/content_processor/tikz.rb +59 -16
- data/lib/webgen/item_tracker.rb +33 -12
- data/lib/webgen/item_tracker/missing_node.rb +5 -5
- data/lib/webgen/item_tracker/template_chain.rb +52 -0
- data/lib/webgen/misc/dummy_index.rb +78 -0
- data/lib/webgen/node.rb +1 -1
- data/lib/webgen/node_finder.rb +86 -141
- data/lib/webgen/page.rb +5 -5
- data/lib/webgen/path.rb +4 -1
- data/lib/webgen/path_handler.rb +25 -21
- data/lib/webgen/path_handler/api.rb +36 -3
- data/lib/webgen/path_handler/base.rb +20 -4
- data/lib/webgen/path_handler/feed.rb +6 -2
- data/lib/webgen/path_handler/meta_info.rb +4 -2
- data/lib/webgen/path_handler/page.rb +5 -7
- data/lib/webgen/path_handler/sitemap.rb +6 -1
- data/lib/webgen/path_handler/virtual.rb +6 -8
- data/lib/webgen/source/file_system.rb +2 -2
- data/lib/webgen/tag.rb +22 -18
- data/lib/webgen/tag/menu.rb +5 -5
- data/lib/webgen/test_helper.rb +18 -18
- data/lib/webgen/utils/external_command.rb +1 -1
- data/lib/webgen/utils/tag_parser.rb +1 -1
- data/lib/webgen/vendor/rainpress.rb +168 -0
- data/lib/webgen/version.rb +1 -1
- data/lib/webgen/website.rb +10 -10
- data/man/man1/webgen.1 +54 -23
- data/test/test_documentation.rb +27 -4
- data/test/webgen/cli/test_logger.rb +1 -1
- data/test/webgen/content_processor/test_blocks.rb +1 -1
- data/test/webgen/content_processor/test_builder.rb +3 -2
- data/test/webgen/content_processor/test_erb.rb +1 -1
- data/test/webgen/content_processor/test_erubis.rb +2 -2
- data/test/webgen/content_processor/test_fragments.rb +1 -1
- data/test/webgen/content_processor/test_haml.rb +2 -2
- data/test/webgen/content_processor/test_html_head.rb +5 -1
- data/test/webgen/content_processor/test_kramdown.rb +2 -2
- data/test/webgen/content_processor/test_maruku.rb +2 -2
- data/test/webgen/content_processor/test_r_discount.rb +2 -2
- data/test/webgen/content_processor/test_r_doc.rb +1 -1
- data/test/webgen/content_processor/test_rainpress.rb +19 -0
- data/test/webgen/content_processor/test_red_cloth.rb +2 -2
- data/test/webgen/content_processor/test_ruby.rb +1 -1
- data/test/webgen/content_processor/test_sass.rb +8 -6
- data/test/webgen/content_processor/test_scss.rb +3 -3
- data/test/webgen/content_processor/test_tags.rb +1 -1
- data/test/webgen/content_processor/test_tidy.rb +9 -1
- data/test/webgen/content_processor/test_tikz.rb +6 -3
- data/test/webgen/content_processor/test_xmllint.rb +9 -2
- data/test/webgen/destination/test_file_system.rb +4 -4
- data/test/webgen/item_tracker/test_file.rb +1 -1
- data/test/webgen/item_tracker/test_missing_node.rb +1 -1
- data/test/webgen/item_tracker/test_node_content.rb +1 -1
- data/test/webgen/item_tracker/test_node_meta_info.rb +1 -1
- data/test/webgen/item_tracker/test_nodes.rb +2 -4
- data/test/webgen/item_tracker/test_template_chain.rb +36 -0
- data/test/webgen/misc/test_dummy_index.rb +83 -0
- data/test/webgen/path_handler/test_api.rb +6 -46
- data/test/webgen/path_handler/test_base.rb +3 -2
- data/test/webgen/path_handler/test_copy.rb +1 -1
- data/test/webgen/path_handler/test_feed.rb +3 -4
- data/test/webgen/path_handler/test_meta_info.rb +1 -1
- data/test/webgen/path_handler/test_page.rb +1 -1
- data/test/webgen/path_handler/test_page_utils.rb +1 -1
- data/test/webgen/path_handler/test_sitemap.rb +3 -5
- data/test/webgen/path_handler/test_template.rb +1 -1
- data/test/webgen/path_handler/test_virtual.rb +1 -3
- data/test/webgen/source/test_file_system.rb +9 -4
- data/test/webgen/source/test_stacked.rb +1 -1
- data/test/webgen/source/test_tar_archive.rb +2 -2
- data/test/webgen/tag/test_breadcrumb_trail.rb +1 -1
- data/test/webgen/tag/test_coderay.rb +3 -2
- data/test/webgen/tag/test_date.rb +1 -1
- data/test/webgen/tag/test_execute_command.rb +1 -1
- data/test/webgen/tag/test_include_file.rb +1 -1
- data/test/webgen/tag/test_langbar.rb +1 -1
- data/test/webgen/tag/test_link.rb +1 -1
- data/test/webgen/tag/test_menu.rb +12 -30
- data/test/webgen/tag/test_meta_info.rb +1 -1
- data/test/webgen/tag/test_relocatable.rb +1 -1
- data/test/webgen/tag/test_tikz.rb +3 -2
- data/test/webgen/task/test_create_website.rb +2 -2
- data/test/webgen/test_blackboard.rb +11 -3
- data/test/webgen/test_bundle_loader.rb +26 -9
- data/test/webgen/test_cache.rb +1 -1
- data/test/webgen/test_cli.rb +2 -2
- data/test/webgen/test_configuration.rb +8 -9
- data/test/webgen/test_content_processor.rb +1 -1
- data/test/webgen/test_context.rb +1 -1
- data/test/webgen/test_core_ext.rb +1 -1
- data/test/webgen/test_destination.rb +1 -1
- data/test/webgen/test_error.rb +5 -5
- data/test/webgen/test_extension_manager.rb +1 -1
- data/test/webgen/test_item_tracker.rb +26 -5
- data/test/webgen/test_languages.rb +1 -1
- data/test/webgen/test_logger.rb +1 -1
- data/test/webgen/test_node.rb +1 -1
- data/test/webgen/test_node_finder.rb +2 -2
- data/test/webgen/test_page.rb +5 -5
- data/test/webgen/test_path.rb +8 -8
- data/test/webgen/test_rake_task.rb +1 -1
- data/test/webgen/test_source.rb +1 -1
- data/test/webgen/test_tag.rb +16 -24
- data/test/webgen/test_task.rb +1 -1
- data/test/webgen/test_tree.rb +1 -1
- data/test/webgen/test_utils.rb +1 -1
- data/test/webgen/test_website.rb +1 -1
- data/test/webgen/utils/test_tag_parser.rb +1 -1
- metadata +85 -105
- data/lib/webgen/cli/bundle_command.rb +0 -30
- data/lib/webgen/cli/generate_command.rb +0 -25
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bc28598716d6dbfc5755161abde547978815a8fb
|
4
|
+
data.tar.gz: 9fcab153b65bfcb25fe189174e292591153944fb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a8819bc56874a30b1d5c0b63bb7f65a7fe8a104c8c8ed7c2b659db128d600a9ffd66d3e821e476b4c29775596678f83aafaf3025dee52ec715a966184cfbad50
|
7
|
+
data.tar.gz: e0a3b69860bdcf22c5b654f0c37529543acc7137ba5a6d5841c10fc56b10da308160451d38b4b397d22e82710b28da39deec537c7e5109db4207f2045bc33eeb
|
data/COPYING
CHANGED
@@ -15,9 +15,31 @@ You should have received a copy of the GNU General Public License
|
|
15
15
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
16
|
|
17
17
|
|
18
|
-
The webgen distribution contains some
|
18
|
+
The webgen distribution contains some files that have a different
|
19
19
|
license. These files/directories are listed here:
|
20
20
|
|
21
|
+
lib/webgen/vendor/rainpress.rb:
|
22
|
+
Copyright (c) 2007-2008 Uwe L. Korn
|
23
|
+
|
24
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
25
|
+
a copy of this software and associated documentation files (the
|
26
|
+
"Software"), to deal in the Software without restriction, including
|
27
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
28
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
29
|
+
permit persons to whom the Software is furnished to do so, subject to
|
30
|
+
the following conditions:
|
31
|
+
|
32
|
+
The above copyright notice and this permission notice shall be
|
33
|
+
included in all copies or substantial portions of the Software.
|
34
|
+
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
36
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
37
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
38
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
39
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
40
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
41
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
42
|
+
|
21
43
|
data/webgen/passive_sources/stylesheets/coderay-default.css:
|
22
44
|
This file has been generated with the coderay_stylesheet binary and
|
23
45
|
falls under the LGPL.
|
data/Rakefile
CHANGED
@@ -16,9 +16,7 @@ require 'rake/testtask'
|
|
16
16
|
require 'rake/packagetask'
|
17
17
|
|
18
18
|
$:.unshift('lib')
|
19
|
-
require 'webgen/rake_task'
|
20
19
|
require 'webgen/version'
|
21
|
-
require 'webgen/page'
|
22
20
|
|
23
21
|
# End user tasks ###############################################################
|
24
22
|
|
@@ -35,32 +33,8 @@ task :clobber do
|
|
35
33
|
ruby "setup.rb clean"
|
36
34
|
end
|
37
35
|
|
38
|
-
desc "Build the whole user documentation"
|
39
|
-
task :doc => [:rdoc, :htmldoc]
|
40
|
-
|
41
|
-
desc "Generate the HTML documentation"
|
42
|
-
Webgen::RakeTask.new('htmldoc') do |site|
|
43
|
-
site.clobber_outdir = true
|
44
|
-
site.config_block = lambda do |config|
|
45
|
-
config['sources'] = [['/', "Webgen::Source::FileSystem", 'doc'],
|
46
|
-
['/', "Webgen::Source::FileSystem", 'misc', 'default.*'],
|
47
|
-
['/', "Webgen::Source::FileSystem", 'misc', 'htmldoc.metainfo'],
|
48
|
-
['/', "Webgen::Source::FileSystem", 'misc', 'htmldoc.virtual'],
|
49
|
-
['/', "Webgen::Source::FileSystem", 'misc', 'images/**/*']]
|
50
|
-
prefix = "webgen-website-bundle-"
|
51
|
-
config['resources'].select {|name, data| name =~ /^#{prefix}style/}.each do |name, data|
|
52
|
-
config['sources'] <<
|
53
|
-
["/references/website_styles/#{name.sub(prefix, '')}/", "Webgen::Source::FileSystem", 'misc', 'style.page']
|
54
|
-
config['sources'] <<
|
55
|
-
["/references/website_styles/#{name.sub(prefix, '')}/", 'Webgen::Source::Resource', name, '/src/**', '/src/']
|
56
|
-
end
|
57
|
-
config['output'] = ['Webgen::Output::FileSystem', 'htmldoc']
|
58
|
-
config.default_processing_pipeline('Page' => 'erb,tags,kramdown,blocks,fragments')
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
36
|
RDoc::Task.new do |rdoc|
|
63
|
-
rdoc.rdoc_dir = '
|
37
|
+
rdoc.rdoc_dir = 'rdoc'
|
64
38
|
rdoc.title = 'webgen'
|
65
39
|
rdoc.main = 'API.rdoc'
|
66
40
|
rdoc.options << '--line-numbers'
|
@@ -68,7 +42,7 @@ RDoc::Task.new do |rdoc|
|
|
68
42
|
end
|
69
43
|
|
70
44
|
Rake::TestTask.new do |test|
|
71
|
-
test.test_files = FileList['test
|
45
|
+
test.test_files = FileList['test/**/test_*.rb']
|
72
46
|
end
|
73
47
|
|
74
48
|
# Release tasks and development tasks ############################################
|
@@ -83,12 +57,6 @@ dynamic content like menus on the fly and comes with many powerful
|
|
83
57
|
extensions.
|
84
58
|
EOF
|
85
59
|
|
86
|
-
begin
|
87
|
-
REL_PAGE = Webgen::Page.from_data(File.read('website/src/news/release_' + Webgen::VERSION.split('.').join('_') + '.page'))
|
88
|
-
rescue
|
89
|
-
puts 'NO RELEASE NOTES/CHANGES FILE'
|
90
|
-
end
|
91
|
-
|
92
60
|
PKG_FILES = FileList.new([
|
93
61
|
'Rakefile',
|
94
62
|
'setup.rb',
|
@@ -101,12 +69,11 @@ EOF
|
|
101
69
|
'README.md',
|
102
70
|
'bin/webgen',
|
103
71
|
'data/**/*',
|
104
|
-
'
|
72
|
+
'data/**/.gitignore',
|
73
|
+
'lib/**/*',
|
105
74
|
'man/man1/webgen.1',
|
106
75
|
'test/**/*',
|
107
|
-
])
|
108
|
-
fl.exclude('**/.gitignore')
|
109
|
-
end
|
76
|
+
])
|
110
77
|
|
111
78
|
CLOBBER << "VERSION"
|
112
79
|
file 'VERSION' do
|
@@ -127,14 +94,15 @@ EOF
|
|
127
94
|
s.version = Webgen::VERSION
|
128
95
|
s.summary = SUMMARY
|
129
96
|
s.description = DESCRIPTION
|
97
|
+
s.license = 'GPL'
|
130
98
|
s.post_install_message = <<EOF
|
131
99
|
|
132
100
|
Thanks for choosing webgen! Here are some places to get you started:
|
133
|
-
* The webgen User Documentation at <http://webgen.rubyforge.org/documentation
|
101
|
+
* The webgen User Documentation at <http://webgen.rubyforge.org/documentation/>
|
134
102
|
* The mailing list archive at <http://rubyforge.org/pipermail/webgen-users/>
|
135
103
|
* The webgen Wiki at <http://github.com/gettalong/webgen/wiki>
|
136
104
|
|
137
|
-
Have a look at <http://webgen.rubyforge.org
|
105
|
+
Have a look at <http://webgen.rubyforge.org/news.html> for a list of changes!
|
138
106
|
|
139
107
|
Have fun!
|
140
108
|
|
@@ -142,12 +110,13 @@ EOF
|
|
142
110
|
|
143
111
|
#### Dependencies, requirements and files
|
144
112
|
|
145
|
-
s.required_ruby_version = '>= 1.9.
|
113
|
+
s.required_ruby_version = '>= 1.9.3'
|
146
114
|
|
147
115
|
s.add_dependency('cmdparse', '>= 2.0.5')
|
148
116
|
s.add_dependency('systemu', '>= 2.5.0')
|
149
|
-
s.add_dependency('kramdown', '
|
117
|
+
s.add_dependency('kramdown', '~> 1.0')
|
150
118
|
s.add_development_dependency('rake', '>= 0.8.3')
|
119
|
+
s.add_development_dependency('minitest', '>= 5.0.0')
|
151
120
|
s.add_development_dependency('diff-lcs', '>= 1.1.0')
|
152
121
|
s.add_development_dependency('rubyforge', '>= 2.0.2')
|
153
122
|
s.add_development_dependency('maruku', '>= 0.6.0')
|
@@ -186,12 +155,7 @@ EOF
|
|
186
155
|
end
|
187
156
|
|
188
157
|
desc 'Release webgen version ' + Webgen::VERSION
|
189
|
-
task :release => [:clobber, :package, :publish_files, :
|
190
|
-
|
191
|
-
desc "Upload webgen documentation to Rubyforge homepage"
|
192
|
-
task :publish_doc => [:doc] do
|
193
|
-
sh "rsync -avc --delete htmldoc/ gettalong@rubyforge.org:/var/www/gforge-projects/webgen/documentation/#{(Webgen::VERSION.split('.')[0..-2] + ['x']).join('.')}"
|
194
|
-
end
|
158
|
+
task :release => [:clobber, :package, :publish_files, :post_news]
|
195
159
|
|
196
160
|
if defined? RubyForge
|
197
161
|
desc "Upload the release to Rubyforge"
|
@@ -203,8 +167,8 @@ EOF
|
|
203
167
|
rf.configure
|
204
168
|
rf.login
|
205
169
|
|
206
|
-
rf.userconfig["release_notes"] =
|
207
|
-
rf.userconfig["release_changes"] =
|
170
|
+
rf.userconfig["release_notes"] = ""
|
171
|
+
rf.userconfig["release_changes"] = ""
|
208
172
|
rf.userconfig["preformatted"] = false
|
209
173
|
|
210
174
|
files = %w[.gem .tgz .zip].collect {|ext| "pkg/webgen-#{Webgen::VERSION}" + ext}
|
@@ -224,37 +188,12 @@ EOF
|
|
224
188
|
rf.configure
|
225
189
|
rf.login
|
226
190
|
|
227
|
-
|
191
|
+
text = "Have a look at http://webgen.rubyforge.org/news.html for the release details!"
|
192
|
+
rf.post_news('webgen', "webgen #{Webgen::VERSION} released", text)
|
228
193
|
puts "done"
|
229
194
|
end
|
230
195
|
end
|
231
196
|
|
232
|
-
desc 'Generates the webgen website'
|
233
|
-
Webgen::RakeTask.new(:website) do |site|
|
234
|
-
site.directory = 'website'
|
235
|
-
site.clobber_outdir = true
|
236
|
-
site.config_block = lambda do |config|
|
237
|
-
config['sources'] += [['/documentation/', 'Webgen::Source::FileSystem', '../doc'],
|
238
|
-
['/', "Webgen::Source::FileSystem", '../misc', 'default.less.css'],
|
239
|
-
['/documentation/', "Webgen::Source::FileSystem", '../misc', 'htmldoc.virtual'],
|
240
|
-
['/', "Webgen::Source::FileSystem", '../misc', 'images/**/*']]
|
241
|
-
prefix = "webgen-website-bundle-"
|
242
|
-
config['resources'].select {|name, data| name =~ /^#{prefix}style/}.each do |name, data|
|
243
|
-
config['sources'] <<
|
244
|
-
["/documentation/references/website_styles/#{name.sub(prefix, '')}/", "Webgen::Source::FileSystem", '../misc', 'style.page']
|
245
|
-
config['sources'] <<
|
246
|
-
["/documentation/references/website_styles/#{name.sub(prefix, '')}/", 'Webgen::Source::Resource', name, '/src/**', '/src/']
|
247
|
-
end
|
248
|
-
config.default_processing_pipeline('Page' => 'erb,tags,kramdown,blocks,fragments')
|
249
|
-
end
|
250
|
-
end
|
251
|
-
|
252
|
-
desc "Upload the webgen website to Rubyforge"
|
253
|
-
task :publish_website => ['rdoc', :website] do
|
254
|
-
sh "rsync -avc --delete --exclude documentation/rdoc --exclude 'documentation/0.5.x' --exclude 'documentation/0.4.x' --exclude 'wiki' --exclude 'robots.txt' website/out/ gettalong@rubyforge.org:/var/www/gforge-projects/webgen/"
|
255
|
-
sh "rsync -avc --delete htmldoc/rdoc/ gettalong@rubyforge.org:/var/www/gforge-projects/webgen/documentation/rdoc"
|
256
|
-
end
|
257
|
-
|
258
197
|
|
259
198
|
desc "Run the tests one by one to check for missing deps"
|
260
199
|
task :test_isolated do
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0
|
1
|
+
1.0.0
|
data/bin/webgen
CHANGED
File without changes
|
@@ -8,7 +8,9 @@
|
|
8
8
|
# directory in which it is!
|
9
9
|
#
|
10
10
|
# * For information on how to write extensions, have a look at the API
|
11
|
-
# documentation of webgen at
|
11
|
+
# documentation of webgen at
|
12
|
+
#
|
13
|
+
# http://webgen.rubyforge.org/documentation/reference/api/
|
12
14
|
#
|
13
15
|
# * Have a look at the API documentation of Webgen::BundlerLoader to see
|
14
16
|
# what methods are available in init.rb files.
|
File without changes
|
@@ -12,7 +12,7 @@
|
|
12
12
|
# The available configuration options can be found on the homepage in the Configuration Option
|
13
13
|
# Reference at
|
14
14
|
#
|
15
|
-
# http://webgen.rubyforge.org/documentation/
|
15
|
+
# http://webgen.rubyforge.org/documentation/reference/configuration_options.html
|
16
16
|
#
|
17
17
|
# More info about YAML itself can be found at http://www.yaml.org/
|
18
18
|
#####
|
@@ -5,8 +5,8 @@ version:
|
|
5
5
|
license:
|
6
6
|
homepage:
|
7
7
|
|
8
|
-
# If extensions are defined, document them here
|
9
|
-
# example (at least the summary key should be set):
|
8
|
+
# If extensions or configuration options are defined, document them here
|
9
|
+
# like in the following example (at least the summary key should be set):
|
10
10
|
#
|
11
11
|
# extensions:
|
12
12
|
# content_processor.my_processor:
|
@@ -14,3 +14,15 @@ homepage:
|
|
14
14
|
# super_duper:
|
15
15
|
# summary: Provides some very super-duper things!!
|
16
16
|
# author: Some One Else
|
17
|
+
#
|
18
|
+
# options:
|
19
|
+
# tag.my_processor.option:
|
20
|
+
# summary: Some description of the option here
|
21
|
+
# syntax: Syntax description of this option
|
22
|
+
# example:
|
23
|
+
# config: |
|
24
|
+
# tag.my_processor.option: some_value
|
25
|
+
# tag: |
|
26
|
+
# {my_tag: {option: some_value}}
|
27
|
+
#
|
28
|
+
# The options:*:example:tag key should only be used for tags!
|
@@ -1,5 +1,19 @@
|
|
1
|
-
--- name:content pipeline:
|
2
|
-
|
1
|
+
--- name:content pipeline:ruby
|
2
|
+
rdoc_object = context.node.node_info[:rdoc_object]
|
3
|
+
if rdoc_object.kind_of?(::RDoc::ClassModule)
|
4
|
+
context.content = context.render_block(:name => 'klass', :node => 'current')
|
5
|
+
else
|
6
|
+
context.content = context.render_block(:name => 'page', :node => 'current')
|
7
|
+
end
|
8
|
+
--- name:page pipeline:erb
|
9
|
+
<% page = context.node.node_info[:rdoc_object] %>
|
10
|
+
<div class="api-documentation api-page">
|
11
|
+
<div class="description">
|
12
|
+
<%= page.description %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
--- name:klass pipeline:erb
|
16
|
+
<% klass = context.node.node_info[:rdoc_object] %>
|
3
17
|
<div class="api-documentation api-<%= klass.type %>">
|
4
18
|
<h1 class="<%= klass.type %>"><%= klass.type %> <%= klass.full_name %></h1>
|
5
19
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
</author>
|
10
10
|
|
11
11
|
<link href="<%= context.node.feed_link %>" rel="alternate" />
|
12
|
-
<link href="<%=
|
12
|
+
<link href="<%= context.node.url %>" rel="self" />
|
13
13
|
<generator uri="http://webgen.rubyforge.org/" version="<%= Webgen::VERSION %>">
|
14
14
|
webgen - Webgen::PathHandler::Feed
|
15
15
|
</generator>
|
@@ -25,8 +25,8 @@
|
|
25
25
|
<uri><%= h(entry['author_url']) %></uri>
|
26
26
|
</author>
|
27
27
|
<% end %>
|
28
|
-
<link href="<%=
|
29
|
-
<id><%=
|
28
|
+
<link href="<%= entry.url %>" rel="alternate" />
|
29
|
+
<id><%= entry.url %></id>
|
30
30
|
<updated><%= entry['modified_at'].xmlschema %></updated>
|
31
31
|
<% if entry['created_at'].kind_of?(Time) %>
|
32
32
|
<published><%= entry['created_at'].xmlschema %></published>
|
@@ -55,10 +55,10 @@
|
|
55
55
|
<% context.node.feed_entries.flatten.each do |entry| %>
|
56
56
|
<item>
|
57
57
|
<title><%= h(entry['title']) %></title>
|
58
|
-
<link><%=
|
58
|
+
<link><%= entry.url %></link>
|
59
59
|
<description><%= h(context.node.entry_content(entry)) %></description>
|
60
60
|
<pubDate><%= entry['modified_at'].rfc822 %></pubDate>
|
61
|
-
<guid isPermaLink="true"><%=
|
61
|
+
<guid isPermaLink="true"><%= entry.url %></guid>
|
62
62
|
</item>
|
63
63
|
<% end %>
|
64
64
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
context.node.sitemap_entries.each do |item|
|
6
6
|
%>
|
7
7
|
<url>
|
8
|
-
<loc><%= URI.escape(
|
8
|
+
<loc><%= URI.escape(item.url) %></loc>
|
9
9
|
<lastmod><%= item['modified_at'].iso8601 %></lastmod>
|
10
10
|
<changefreq><%= item['change_freq'] || context.node['default_change_freq'] %></changefreq>
|
11
11
|
<% if priority = item['priority'] || context.node['default_priority'] %>
|
@@ -13,11 +13,15 @@ end.join(context[:config]['tag.breadcrumb_trail.separator'])
|
|
13
13
|
|
14
14
|
|
15
15
|
--- name:tag.menu pipeline:ruby --------------------------------------------------------------------
|
16
|
+
start_tag = "<ul"
|
17
|
+
start_tag << " class=\"#{context[:config]['tag.menu.css_class']}\"" if context[:config]['tag.menu.css_class']
|
18
|
+
start_tag << ">"
|
19
|
+
|
16
20
|
nested_list = lambda do |nodes, level|
|
17
|
-
out = "<ul>"
|
21
|
+
out = (level == 1 ? start_tag.dup : "<ul>")
|
18
22
|
nodes.each do |node, children|
|
19
23
|
menu = (children ? nested_list.call(children, level + 1) : '')
|
20
|
-
style, link = Webgen::Tag::Menu.menu_item_details(context.dest_node, node, context.content_node.lang, level, !children.nil
|
24
|
+
style, link = Webgen::Tag::Menu.menu_item_details(context.dest_node, node, context.content_node.lang, level, !children.nil?, context[:config])
|
21
25
|
out << "<li #{style}>#{link}"
|
22
26
|
out << menu
|
23
27
|
out << "</li>"
|
@@ -28,10 +32,10 @@ end
|
|
28
32
|
|
29
33
|
flat_list = lambda do |nodes, level|
|
30
34
|
submenu = ''
|
31
|
-
out = "<ul>"
|
35
|
+
out = (level == 1 ? start_tag.dup : "<ul>")
|
32
36
|
nodes.each do |node, children|
|
33
37
|
submenu << (children ? flat_list.call(children, level + 1) : '')
|
34
|
-
style, link = Webgen::Tag::Menu.menu_item_details(context.dest_node, node, context.content_node.lang, level, !children.nil
|
38
|
+
style, link = Webgen::Tag::Menu.menu_item_details(context.dest_node, node, context.content_node.lang, level, !children.nil?, context[:config])
|
35
39
|
out << "<li #{style}>#{link}</li>"
|
36
40
|
end
|
37
41
|
out << "</ul>" << submenu
|
data/lib/webgen/blackboard.rb
CHANGED
@@ -13,16 +13,32 @@ module Webgen
|
|
13
13
|
@listener = {}
|
14
14
|
end
|
15
15
|
|
16
|
-
# Add the given block as listener for the
|
17
|
-
#
|
18
|
-
#
|
19
|
-
|
16
|
+
# Add the given block as listener for the message +msg_name+.
|
17
|
+
#
|
18
|
+
# The +id+ parameter can be used to specify a string which uniquely identifies the listener.
|
19
|
+
#
|
20
|
+
# The +position+ parameter can be used to specify where the listener should be added. The keys
|
21
|
+
# :before and :after are recognized and must contain a valid listener ID. If no key is or an
|
22
|
+
# unknown ID is specified, the listener is added as last entry in the listener array.
|
23
|
+
def add_listener(msg_name, id = nil, position = {}, &block)
|
24
|
+
position = if position[:before]
|
25
|
+
(@listener[msg_name] || []).index {|id, obj| id == position[:before]}
|
26
|
+
elsif position[:after]
|
27
|
+
(pos = (@listener[msg_name] || []).index {|id, obj| id == position[:after]}) && pos + 1
|
28
|
+
end
|
29
|
+
insert_listener_at_position(msg_name, id, position || -1, &block)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Insert the block as listener for +msg_name+ with the given +id+ at the +position+ in the
|
33
|
+
# listener array.
|
34
|
+
def insert_listener_at_position(msg_name, id, position, &block)
|
20
35
|
if !block.nil?
|
21
|
-
|
36
|
+
(@listener[msg_name] ||= []).insert(position, [id, block])
|
22
37
|
else
|
23
38
|
raise ArgumentError, "You have to provide a block"
|
24
39
|
end
|
25
40
|
end
|
41
|
+
private :insert_listener_at_position
|
26
42
|
|
27
43
|
# Remove the blocks associated with the given ID from the dispatcher queues of the given message
|
28
44
|
# names.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
author: &author Thomas Leitner <t_leitner@gmx.at>
|
2
|
+
summary: Built-in webgen extension for showing destination path changes
|
3
|
+
description: |
|
4
|
+
This is an extension bundle that comes with webgen. It provides a means for
|
5
|
+
showing the changes that would be written to a destination path.
|
6
|
+
|
7
|
+
options:
|
8
|
+
destination.show_changes:
|
9
|
+
summary: |
|
10
|
+
Specifies whether changes to the content of destination paths should be shown in a diff-like
|
11
|
+
manner. This option combined with the website.dry_run configuration option allows one to
|
12
|
+
preview the changes that the invocation of webgen would do.
|
13
|
+
syntax: |
|
14
|
+
`true` or `false`
|
15
|
+
example:
|
16
|
+
config: |
|
17
|
+
destination.show_changes: true
|
@@ -2,15 +2,14 @@
|
|
2
2
|
#
|
3
3
|
# This file initializes the show-changes built-in extension.
|
4
4
|
|
5
|
-
option('destination.show_changes', false
|
6
|
-
'Show changes to destination paths') do |val|
|
5
|
+
option('destination.show_changes', false) do |val|
|
7
6
|
raise "The value has to be 'true' or 'false'" unless val == true || val == false
|
8
7
|
val
|
9
8
|
end
|
10
9
|
|
11
10
|
data = nil
|
12
11
|
|
13
|
-
website.blackboard.add_listener(:before_node_written) do |node|
|
12
|
+
website.blackboard.add_listener(:before_node_written, 'destination.show_changes') do |node|
|
14
13
|
next unless website.config['destination.show_changes'] && node.is_file? && !node['no_output']
|
15
14
|
webgen_require('diff/lcs', 'diff-lcs')
|
16
15
|
webgen_require('diff/lcs/hunk', 'diff-lcs')
|
@@ -21,13 +20,13 @@ website.blackboard.add_listener(:before_node_written) do |node|
|
|
21
20
|
end
|
22
21
|
end
|
23
22
|
|
24
|
-
website.blackboard.add_listener(:after_node_written) do |node, content|
|
23
|
+
website.blackboard.add_listener(:after_node_written, 'destination.show_changes') do |node, content|
|
25
24
|
next unless website.config['destination.show_changes'] && node.is_file? && !node['no_output']
|
26
25
|
if data.nil?
|
27
26
|
website.logger.info { "New destination path <#{node.dest_path}>" }
|
28
27
|
next
|
29
28
|
end
|
30
|
-
new_data = (content.kind_of?(String) ? content : content.data)
|
29
|
+
new_data = (content.kind_of?(String) ? content : content.data).force_encoding('ASCII-8BIT')
|
31
30
|
|
32
31
|
binary = data[0...4096]["\0"] || new_data[0..4096]["\0"]
|
33
32
|
if binary
|