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
data/lib/webgen/version.rb
CHANGED
data/lib/webgen/website.rb
CHANGED
@@ -109,8 +109,8 @@ module Webgen
|
|
109
109
|
@ext = OpenStruct.new
|
110
110
|
|
111
111
|
@init_block.call(self, true) if @init_block && @init_block.arity == 2
|
112
|
-
load_bundles
|
113
|
-
load_configuration
|
112
|
+
loader = load_bundles
|
113
|
+
load_configuration(loader)
|
114
114
|
if @init_block
|
115
115
|
@init_block.arity == 1 ? @init_block.call(self) : @init_block.call(self, false)
|
116
116
|
end
|
@@ -132,6 +132,7 @@ module Webgen
|
|
132
132
|
ext_loader.load_autoload_bundles
|
133
133
|
Dir[File.join(ext_dir, '**/init.rb')].sort.each {|file| ext_loader.load(file[ext_dir.length..-1])}
|
134
134
|
ext_loader.load('init.rb') if File.file?(File.join(ext_dir, 'init.rb'))
|
135
|
+
ext_loader
|
135
136
|
end
|
136
137
|
private :load_bundles
|
137
138
|
|
@@ -139,17 +140,16 @@ module Webgen
|
|
139
140
|
CONFIG_FILENAME = 'webgen.config'
|
140
141
|
|
141
142
|
# Load the configuration file into the Configuration object.
|
142
|
-
|
143
|
+
#
|
144
|
+
# If it is a Ruby configuration file, the given bundle loader is used to load it.
|
145
|
+
def load_configuration(bundle_loader)
|
143
146
|
config_file = File.join(@directory, CONFIG_FILENAME)
|
144
147
|
return unless File.exist?(config_file)
|
145
148
|
|
146
149
|
first_line = File.open(config_file, 'r') {|f| f.gets}
|
147
|
-
if first_line =~ /^\s*#.*\bruby\b/
|
148
|
-
o = Object.new
|
149
|
-
o.instance_variable_set(:@website, self)
|
150
|
-
def o.website; @website; end
|
150
|
+
if first_line =~ /^\s*#.*\bruby\b/i
|
151
151
|
begin
|
152
|
-
|
152
|
+
bundle_loader.load!(config_file)
|
153
153
|
rescue Exception => e
|
154
154
|
raise Webgen::Error.new("Couldn't load webgen configuration file (using Ruby syntax):\n#{e.message}")
|
155
155
|
end
|
@@ -166,7 +166,7 @@ module Webgen
|
|
166
166
|
# Restore the cache using the +website.cache+ configuration option.
|
167
167
|
def restore_cache
|
168
168
|
@cache = Cache.new
|
169
|
-
data = if config['website.cache'].first ==
|
169
|
+
data = if config['website.cache'].first == 'file'
|
170
170
|
File.binread(cache_file) if File.file?(cache_file)
|
171
171
|
else
|
172
172
|
config['website.cache'].last
|
@@ -180,7 +180,7 @@ module Webgen
|
|
180
180
|
def save_cache
|
181
181
|
return if config['website.dry_run']
|
182
182
|
cache_data = [@cache.dump, Webgen::VERSION]
|
183
|
-
if config['website.cache'].first ==
|
183
|
+
if config['website.cache'].first == 'file'
|
184
184
|
File.open(cache_file(true), 'wb') {|f| Marshal.dump(cache_data, f)}
|
185
185
|
else
|
186
186
|
config['website.cache'][1] = Marshal.dump(cache_data)
|
data/man/man1/webgen.1
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
.TH "WEBGEN" 1 "
|
1
|
+
.TH "WEBGEN" 1 "September 2013"
|
2
2
|
.SH NAME
|
3
3
|
webgen \- a fast, powerful and extensible static website generator
|
4
4
|
.SH SYNOPSIS
|
@@ -18,6 +18,21 @@ automatically be generated.
|
|
18
18
|
.B \-d, \-\-directory DIR
|
19
19
|
Set the website directectory. if none specified, the current directory is used.
|
20
20
|
.TP
|
21
|
+
.B \-s, \-\-search-dirs
|
22
|
+
Search the parent directories for a directory with a webgen configuration file and use this as
|
23
|
+
website directory.
|
24
|
+
.TP
|
25
|
+
.B \-c, \-\-color
|
26
|
+
Use ANSI colors for the output.
|
27
|
+
.TP
|
28
|
+
.B \-n, \-\-dry-run
|
29
|
+
Simulate the website generation. Does everything as it would be done without the option but nothing
|
30
|
+
gets written to the destination directory.
|
31
|
+
.TP
|
32
|
+
.B \-o, \-\-option CONFIG_OPTION
|
33
|
+
Specify a simple configuration option. The argument must be of the form KEY=VALUE where the VALUE is
|
34
|
+
a valid YAML type.
|
35
|
+
.TP
|
21
36
|
.B \-v, \-\-verbose
|
22
37
|
Show more output by default.
|
23
38
|
.TP
|
@@ -25,40 +40,55 @@ Show more output by default.
|
|
25
40
|
Show less output by default. If this option is specified, then no output is shown during rendering
|
26
41
|
of a website.
|
27
42
|
.TP
|
28
|
-
.B
|
29
|
-
|
30
|
-
output).
|
43
|
+
.B \-\-debug
|
44
|
+
Enable debugging (shows much more output).
|
31
45
|
.TP
|
32
46
|
.B \-h, \-\-help
|
33
47
|
Show generic help.
|
34
48
|
.TP
|
35
|
-
.B \-\-version
|
49
|
+
.B \-V, \-\-version
|
36
50
|
Show the version of the program and exit.
|
37
51
|
.SH COMMANDS
|
52
|
+
Commands are used to execute different actions (e.g. creating a website directory, generating the
|
53
|
+
website, showing help, ...). The command names can be shortened as long as the used name is
|
54
|
+
unambiguous. For example, the command "show deps" can also be executed by specifying "s d".
|
55
|
+
.TP
|
56
|
+
\fBcreate bundle\fR
|
57
|
+
Creates a new extension bundle either as a standalone extension or inside the website extension directory.
|
38
58
|
.TP
|
39
|
-
\
|
40
|
-
|
41
|
-
|
59
|
+
\fBcreate website\fR
|
60
|
+
Creates the basic directories and files for webgen. This includes the source and destination
|
61
|
+
directories as well as the extension directory. Takes the \fIdirectory\fR in which to create the
|
62
|
+
webgen structure as an argument.
|
42
63
|
.TP
|
43
|
-
\
|
44
|
-
|
45
|
-
output directories as well as an empty extensions directory. Also, a basic template plus a CSS and
|
46
|
-
an index file are created. Takes the \fIdirectory\fR to create the webgen structure in as an
|
47
|
-
argument.
|
64
|
+
\fBgenerate\fR
|
65
|
+
Generates the website. This command will be executed if no command is explicitly specified.
|
48
66
|
.TP
|
49
67
|
\fBhelp\fR
|
50
|
-
Provides help for
|
68
|
+
Provides help for individual commands.
|
69
|
+
.TP
|
70
|
+
\fBinstall\fR
|
71
|
+
Installs an extension bundle. The name of the extension bundle is needed as argument.
|
72
|
+
.TP
|
73
|
+
\fBshow bundles\fR
|
74
|
+
Shows all available bundles and additional information them.
|
75
|
+
.TP
|
76
|
+
\fBshow config\fR
|
77
|
+
Shows all available configuration options. Command options can be used to additionally show default
|
78
|
+
values and/or current values.
|
79
|
+
.TP
|
80
|
+
\fBshow deps\fR
|
81
|
+
Shows dependencies of nodes. After webgen generates the website (see generate) information about the
|
82
|
+
generated website is stored in cache files and this command reads this information to show the
|
83
|
+
dependencies of nodes.
|
51
84
|
.TP
|
52
|
-
\
|
53
|
-
|
54
|
-
directory from the files in the source directory. This command is used as the default command when
|
55
|
-
no command was issued.
|
85
|
+
\fBshow extensions\fR
|
86
|
+
Shows all available extensions.
|
56
87
|
.TP
|
57
|
-
\
|
58
|
-
Shows the
|
88
|
+
\fBshow tree\fR
|
89
|
+
Shows the node tree. Command options can be used to customize the output.
|
59
90
|
.TP
|
60
|
-
\
|
61
|
-
Starts the webgen webgui, a browser based graphical user interface for manging webgen websites.
|
91
|
+
\fBversion\fR Shows the version of the program and exit.
|
62
92
|
.SH ENVIRONMENT VARIABLES
|
63
93
|
webgen's behaviour is affected by the following environment variables:
|
64
94
|
.TP
|
@@ -66,12 +96,13 @@ webgen's behaviour is affected by the following environment variables:
|
|
66
96
|
If no website is specified via the \-d option and this variable is set, webgen assumes that its
|
67
97
|
content is the webgen website directory that should be used.
|
68
98
|
.SH SEE ALSO
|
69
|
-
The webgen website, http://webgen.rubyforge.org/ for
|
99
|
+
The webgen website, http://webgen.rubyforge.org/ for detailed information.
|
70
100
|
.SH AUTHOR
|
71
101
|
webgen was written by Thomas Leitner <t_leitner@gmx.at>
|
72
102
|
.PP
|
73
103
|
This manual page was written by Paul van Tilburg <paulvt@debian.org> for the Debian project (but may
|
74
104
|
be used by others). This manual page was update to reflect webgen 0.4 change by Arnaud Cornet
|
75
105
|
<arnaud.cornet@gmail.com>. This manual page was updated to reflect webgen 0.5.x changes by Thomas
|
106
|
+
Leitner <t_leitner@gmx.at>. This manual page was updated to reflect webgen 1.x changes by Thomas
|
76
107
|
Leitner <t_leitner@gmx.at>.
|
77
108
|
|
data/test/test_documentation.rb
CHANGED
@@ -6,11 +6,11 @@ require 'tmpdir'
|
|
6
6
|
require 'yaml'
|
7
7
|
require 'set'
|
8
8
|
|
9
|
-
class TestExtensionDocumentation <
|
9
|
+
class TestExtensionDocumentation < Minitest::Test
|
10
10
|
|
11
11
|
def test_all_extensions_documented
|
12
12
|
ws = Webgen::Website.new(File.join(Dir.tmpdir, '/abcdefgh'))
|
13
|
-
documentation =
|
13
|
+
documentation = ws.ext.bundle_infos.extensions.dup
|
14
14
|
author = "Thomas Leitner <t_leitner@gmx.at>"
|
15
15
|
docu_keys = Set.new(documentation.keys)
|
16
16
|
ext_keys = Set.new(ws.ext.instance_eval { @table.keys })
|
@@ -24,12 +24,16 @@ class TestExtensionDocumentation < MiniTest::Unit::TestCase
|
|
24
24
|
|
25
25
|
ext_keys.each do |key|
|
26
26
|
check_docu.call(key.to_s)
|
27
|
+
if ws.ext.send(key).kind_of?(OpenStruct)
|
28
|
+
ws.ext.send(key).instance_eval {@table.keys}.each do |s_key|
|
29
|
+
check_docu.call("#{key}.#{s_key}")
|
30
|
+
end
|
31
|
+
end
|
27
32
|
|
28
33
|
if ws.ext.send(key).respond_to?(:registered_extensions)
|
29
34
|
ws.ext.send(key).registered_extensions.keys.each do |skey|
|
30
35
|
skey = "#{key}.#{skey}"
|
31
|
-
|
32
|
-
next if %w[tag.r].include?(skey)
|
36
|
+
next if %w[tag.r tag.default].include?(skey)
|
33
37
|
|
34
38
|
check_docu.call(skey)
|
35
39
|
end
|
@@ -40,4 +44,23 @@ class TestExtensionDocumentation < MiniTest::Unit::TestCase
|
|
40
44
|
assert(documentation.empty?, "Superfluous documentation keys: #{documentation.keys.join(", ")}")
|
41
45
|
end
|
42
46
|
|
47
|
+
def test_all_config_options_documented
|
48
|
+
ws = Webgen::Website.new(File.join(Dir.tmpdir, '/abcdefgh'))
|
49
|
+
documentation = ws.ext.bundle_infos.options.dup
|
50
|
+
docu_keys = Set.new(documentation.keys)
|
51
|
+
|
52
|
+
check_docu = lambda do |key|
|
53
|
+
data = documentation.delete(key.to_s)
|
54
|
+
assert(data, "Missing options documentation for '#{key}'")
|
55
|
+
assert(!data['summary'].to_s.empty?, "Missing summary for option '#{key}'")
|
56
|
+
assert(!data['syntax'].to_s.empty?, "Missing syntax for option '#{key}'")
|
57
|
+
assert(data['example'].kind_of?(Hash) && data['example'].length > 0, "Missing example for option '#{key}'")
|
58
|
+
end
|
59
|
+
|
60
|
+
ws.config.options.each do |key, value|
|
61
|
+
check_docu.call(key.to_s)
|
62
|
+
end
|
63
|
+
assert(documentation.empty?, "Superfluous option documentation keys: #{documentation.keys.join(", ")}")
|
64
|
+
end
|
65
|
+
|
43
66
|
end
|
@@ -1,13 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
require 'webgen/test_helper'
|
4
|
-
require 'webgen/content_processor/builder'
|
5
4
|
|
6
|
-
class TestBuilder <
|
5
|
+
class TestBuilder < Minitest::Test
|
7
6
|
|
8
7
|
include Webgen::TestHelper
|
9
8
|
|
10
9
|
def test_static_call
|
10
|
+
require 'webgen/content_processor/builder' rescue skip('Library builder not installed')
|
11
|
+
|
11
12
|
setup_context
|
12
13
|
cp = Webgen::ContentProcessor::Builder
|
13
14
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
require 'webgen/test_helper'
|
4
|
-
require 'webgen/content_processor/erubis'
|
5
4
|
|
6
|
-
class TestErubis <
|
5
|
+
class TestErubis < Minitest::Test
|
7
6
|
|
8
7
|
include Webgen::TestHelper
|
9
8
|
|
10
9
|
def test_static_call
|
10
|
+
require 'webgen/content_processor/erubis' rescue skip('Library erubis not installed')
|
11
11
|
setup_context
|
12
12
|
@website.config.merge!('content_processor.erubis.options' => {}, 'content_processor.erubis.use_pi' => false)
|
13
13
|
cp = Webgen::ContentProcessor::Erubis
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
require 'webgen/test_helper'
|
4
|
-
require 'webgen/content_processor/haml'
|
5
4
|
|
6
|
-
class TestHaml <
|
5
|
+
class TestHaml < Minitest::Test
|
7
6
|
|
8
7
|
include Webgen::TestHelper
|
9
8
|
|
10
9
|
def test_static_call
|
10
|
+
require 'webgen/content_processor/haml' rescue skip('Library haml not installed')
|
11
11
|
setup_context
|
12
12
|
cp = Webgen::ContentProcessor::Haml
|
13
13
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'webgen/test_helper'
|
4
4
|
require 'webgen/content_processor/html_head'
|
5
5
|
|
6
|
-
class TestHtmlHead <
|
6
|
+
class TestHtmlHead < Minitest::Test
|
7
7
|
|
8
8
|
include Webgen::TestHelper
|
9
9
|
|
@@ -42,6 +42,10 @@ class TestHtmlHead < MiniTest::Unit::TestCase
|
|
42
42
|
"\n<style type=\"text/css\">/*<![CDATA[/*/\nanotherstyle\n/*]]>*/</style>" +
|
43
43
|
"\n<meta name=\"lucky\" content=\"me<"\" />" +
|
44
44
|
"\n<meta name=\"other\" content=\"me\" />", @obj.tags_from_context_data(context))
|
45
|
+
|
46
|
+
context.persistent[:cp_html_head] = nil
|
47
|
+
assert_equal("\n<meta name=\"other\" content=\"me\" />", @obj.tags_from_context_data(context))
|
48
|
+
|
45
49
|
end
|
46
50
|
|
47
51
|
def test_links_to_translations
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
require 'webgen/test_helper'
|
4
|
-
require 'webgen/content_processor/kramdown'
|
5
4
|
|
6
|
-
class TestContentProcessorKramdown <
|
5
|
+
class TestContentProcessorKramdown < Minitest::Test
|
7
6
|
|
8
7
|
include Webgen::TestHelper
|
9
8
|
|
10
9
|
def test_static_call
|
10
|
+
require 'webgen/content_processor/kramdown' rescue skip('Library kramdown not installed')
|
11
11
|
setup_context
|
12
12
|
cp = Webgen::ContentProcessor::Kramdown
|
13
13
|
root = Webgen::Node.new(@website.tree.dummy_root, '/', '/')
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
require 'webgen/test_helper'
|
4
|
-
require 'webgen/content_processor/maruku'
|
5
4
|
|
6
|
-
class TestMaruku <
|
5
|
+
class TestMaruku < Minitest::Test
|
7
6
|
|
8
7
|
include Webgen::TestHelper
|
9
8
|
|
10
9
|
def setup
|
10
|
+
require 'webgen/content_processor/maruku' rescue skip('Library maruku not installed')
|
11
11
|
setup_context
|
12
12
|
@cp = Webgen::ContentProcessor::Maruku
|
13
13
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
require 'webgen/test_helper'
|
4
|
-
require 'webgen/content_processor/r_discount'
|
5
4
|
|
6
|
-
class TestRDiscount <
|
5
|
+
class TestRDiscount < Minitest::Test
|
7
6
|
|
8
7
|
include Webgen::TestHelper
|
9
8
|
|
10
9
|
def test_static_call
|
10
|
+
require 'webgen/content_processor/r_discount' rescue skip('Library rdiscount not installed')
|
11
11
|
setup_context
|
12
12
|
cp = Webgen::ContentProcessor::RDiscount
|
13
13
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'webgen/test_helper'
|
4
|
+
require 'webgen/content_processor/rainpress'
|
5
|
+
|
6
|
+
class TestContentProcessorRainpress < Minitest::Test
|
7
|
+
|
8
|
+
include Webgen::TestHelper
|
9
|
+
|
10
|
+
def test_static_call
|
11
|
+
setup_context
|
12
|
+
@website.config['content_processor.rainpress.options'] = {}
|
13
|
+
cp = Webgen::ContentProcessor::Rainpress
|
14
|
+
|
15
|
+
@context.content = "a \n{ border: 1px solid bold\n}"
|
16
|
+
assert_equal("a{border:1px solid bold}", cp.call(@context).content)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
require 'webgen/test_helper'
|
4
|
-
require 'webgen/content_processor/red_cloth'
|
5
4
|
|
6
|
-
class TestRedCloth <
|
5
|
+
class TestRedCloth < Minitest::Test
|
7
6
|
|
8
7
|
include Webgen::TestHelper
|
9
8
|
|
10
9
|
def test_static_call
|
10
|
+
require 'webgen/content_processor/red_cloth' rescue skip('Library RedCloth not installed')
|
11
11
|
setup_context
|
12
12
|
@website.config['content_processor.redcloth.hard_breaks'] = false
|
13
13
|
cp = Webgen::ContentProcessor::RedCloth
|