webgen 0.5.4 → 0.5.5

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 CHANGED
@@ -135,6 +135,7 @@ EOF
135
135
  s.summary = SUMMARY
136
136
  s.description = DESCRIPTION
137
137
  s.post_install_message = <<EOF
138
+
138
139
  Thanks for choosing webgen! Here are some places to get you started:
139
140
  * The webgen User Documentation at <http://webgen.rubyforge.org/documentation/index.html>
140
141
  * The mailing list archive at <http://rubyforge.org/pipermail/webgen-users/>
@@ -142,28 +143,29 @@ Thanks for choosing webgen! Here are some places to get you started:
142
143
  Have a look at <http://webgen.rubyforge.org/news/index.html> for a list of changes!
143
144
 
144
145
  Have fun!
146
+
145
147
  EOF
146
148
 
147
149
  #### Dependencies, requirements and files
148
150
 
149
151
  s.files = PKG_FILES.to_a
150
- s.add_dependency('cmdparse', '~> 2.0.0')
151
- s.add_dependency('maruku', '>= 0.5.6')
152
- s.add_dependency('facets', '>= 2.4.3')
153
- s.add_dependency('rake', '>= 0.8.0')
152
+ s.add_dependency('cmdparse', '2.0.2')
153
+ s.add_dependency('maruku', '0.5.9')
154
+ s.add_dependency('facets', '2.4.3')
155
+ s.add_dependency('rake', '0.8.3')
154
156
  s.add_dependency('ramaze', '2008.06')
155
- s.add_dependency('launchy', '>= 0.3.2')
156
- s.add_development_dependency('rcov', '>= 0.8.0')
157
- s.add_development_dependency('dcov', '>= 0.2.2')
158
- s.add_development_dependency('rubyforge', '>= 1.0.0')
159
- s.add_development_dependency('RedCloth', '>= 3.0.0')
160
- s.add_development_dependency('haml', '>= 2.0.1')
161
- s.add_development_dependency('builder', '>= 2.1.0')
162
- s.add_development_dependency('rdoc', '>= 2.0.0')
163
- s.add_development_dependency('coderay', '>= 0.7.4.215')
164
- s.add_development_dependency('feedtools', '>= 0.2.29')
165
- s.add_development_dependency('erubis', '>= 2.6.2')
166
- s.add_development_dependency('rdiscount', '>= 1.2.9')
157
+ s.add_dependency('launchy', '0.3.2')
158
+ s.add_development_dependency('rcov', '0.8.1.2.0')
159
+ s.add_development_dependency('dcov', '0.2.2')
160
+ s.add_development_dependency('rubyforge', '1.0.0')
161
+ s.add_development_dependency('RedCloth', '3.0.0')
162
+ s.add_development_dependency('haml', '2.0.1')
163
+ s.add_development_dependency('builder', '2.1.2')
164
+ s.add_development_dependency('rdoc', '2.0.0')
165
+ s.add_development_dependency('coderay', '0.7.4.215')
166
+ s.add_development_dependency('feedtools', '0.2.29')
167
+ s.add_development_dependency('erubis', '2.6.2')
168
+ s.add_development_dependency('rdiscount', '1.2.9')
167
169
 
168
170
  s.require_path = 'lib'
169
171
 
@@ -188,6 +190,27 @@ EOF
188
190
  pkg.need_tar = true
189
191
  end
190
192
 
193
+ desc 'Generate gemspec file for github'
194
+ task :gemspec do
195
+ spec.version = Webgen::VERSION + '.' + Time.now.strftime('%Y%m%d')
196
+ spec.summary = 'webgen beta build, not supported!!!'
197
+ spec.files = spec.files.reject {|f| f == 'VERSION'}
198
+ spec.post_install_message = "
199
+
200
+
201
+ WARNING: This is an unsupported BETA version of webgen which may
202
+ still contain bugs!
203
+
204
+ The official version is called 'webgen' and can be installed via
205
+
206
+ gem install webgen
207
+
208
+
209
+
210
+ "
211
+ File.open('webgen.gemspec', 'w+') {|f| f.write(spec.to_yaml)}
212
+ end
213
+
191
214
  end
192
215
 
193
216
  desc "Upload webgen documentation to Rubyforge homepage"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.4
1
+ 0.5.5
@@ -185,7 +185,7 @@ page. You can then add a sidebar block to each page file which needs it. Followi
185
185
  page file:
186
186
 
187
187
  This is the main content block
188
- --- sidebar
188
+ --- name:sidebar
189
189
  This is the sidebar block and everything in here goes to the sidebar!
190
190
 
191
191
  ### ... create XML output?
@@ -613,6 +613,39 @@ files in Webgen Page Format.
613
613
  Showing all subtrees: \{menu: {show_current_subtree_only: false}}
614
614
 
615
615
 
616
+ * ### tag.menu.nested
617
+
618
+ Specifies whether the generated menu should contain nested lists, ie. whether sub menus are
619
+ put inline
620
+
621
+ ul 1
622
+ li 2
623
+ ul 3
624
+ li 4
625
+ li 5
626
+ li 6
627
+
628
+ or separately following the previous menu level
629
+
630
+ ul 1
631
+ li 2
632
+ li 6
633
+ ul 3
634
+ li 4
635
+ li 5
636
+
637
+ > When this option is enabled you should enable the option
638
+ > `tag.menu.show_current_subtree_only`. Otherwise the generated menu will look a little bit
639
+ > confusing.
640
+ {.information}
641
+
642
+ * Syntax: `BOOLEAN` where `BOOLEAN` is either `true` or `false`.
643
+
644
+ * Examples:
645
+
646
+ Don't use nested lists: \{menu: {nested: false}}
647
+
648
+
616
649
  * ### tag.relocatable.path
617
650
 
618
651
  The default mandatory configuration option for Tag::Relocatable that specifies the path that
@@ -16,5 +16,4 @@ named `usage.html`. As you can see in this example, the processor name gets stri
16
16
  extension.
17
17
 
18
18
  If you want to use a specific content processor for processing a file, have a look at its
19
- documentation page which shows the unique identification string that needs to be used in the file
20
- extension.
19
+ documentation page which shows the unique short name that needs to be used in the file extension.
@@ -6,6 +6,7 @@ used_options:
6
6
  - tag.menu.min_levels
7
7
  - tag.menu.max_levels
8
8
  - tag.menu.show_current_subtree_only
9
+ - tag.menu.nested
9
10
  ---
10
11
  ## Description
11
12
 
@@ -40,6 +41,15 @@ follows:
40
41
  sub tree of the rendered node.
41
42
  * `webgen-menu-item-selected`: Set if the menu item corresponds to the rendered node.
42
43
 
44
+ The option `tag.menu.nested` decides whether a nested menu or a non-nested is generated. When
45
+ setting this option to `false` you need to ensure that `tag.menu.show_current_subtree_only` is set
46
+ to `true` and `tag.menu.min_levels` is set to `1`. Both ensure that no other subtree obfuscates the
47
+ menu.
48
+
49
+ > Set `tag.menu.nested` to `false` if you want to generate, for example, a horizontal menu, ie. a
50
+ > menu that has one horizontal bar for each menu level.
51
+ {.information}
52
+
43
53
  ## "Static" Menus
44
54
 
45
55
  It is also possible to define a "static" menu or to augment the dynamic menu with static entries by
@@ -89,4 +99,8 @@ setting `in_menu` for any other node.
89
99
  <td>\{menu: {used_nodes: fragments}}</td>
90
100
  <td>{menu: {used_nodes: fragments}}</td>
91
101
  </tr>
102
+ <tr>
103
+ <td>\{menu: {used_nodes: all, nested: false}}</td>
104
+ <td>{menu: {used_nodes: all, nested: false}}</td>
105
+ </tr>
92
106
  </table>
@@ -161,6 +161,7 @@ config.tag.menu.min_levels(1, :doc => 'The minimum number of menu levels that sh
161
161
  config.tag.menu.max_levels(3, :doc => 'The maximum number of menu levels that should be shown.')
162
162
  config.tag.menu.show_current_subtree_only(true, :doc => 'Specifies whether only the current subtree should be shown.')
163
163
  config.tag.menu.used_nodes('all', :doc => 'Specifies the kind of nodes that should be used: all, files, or fragments')
164
+ config.tag.menu.nested(true, :doc => 'Specifies whether a nested menu list should be generated.')
164
165
 
165
166
  config.tag.breadcrumbtrail.separator(' / ', :doc => 'Separates the hierachy entries from each other.')
166
167
  config.tag.breadcrumbtrail.omit_index_path(false, :doc => 'Omits the last path component if it is an index path.')
@@ -1,3 +1,4 @@
1
+ require 'uri'
1
2
  require 'yaml'
2
3
  require 'webgen/sourcehandler/base'
3
4
  require 'webgen/websiteaccess'
@@ -26,7 +27,8 @@ module Webgen::SourceHandler
26
27
  temp_path.meta_info['modified_at'] = path.meta_info['modified_at']
27
28
  temp_path.meta_info['no_output'] = true
28
29
  output_path = temp_path.meta_info.delete('url') || key
29
- output_path = (output_path =~ /^\// ? output_path : File.join(temp_parent.absolute_lcn, output_path))
30
+ output_path = (URI::parse(output_path).absolute? || output_path =~ /^\// ?
31
+ output_path : File.join(temp_parent.absolute_lcn, output_path))
30
32
 
31
33
  if key =~ /\/$/
32
34
  nodes << create_directory(temp_parent, key, path, temp_path.meta_info)
@@ -59,7 +59,14 @@ module Webgen::Tag
59
59
  tree = specific_menu_tree_for(context.content_node)
60
60
 
61
61
  (context.dest_node.node_info[:tag_menu_menus] ||= {})[[@params.to_a.sort, context.content_node.absolute_lcn]] = (tree ? tree.to_lcn_list : nil)
62
- (tree && !tree.children.empty? ? create_output(context, tree) : '')
62
+
63
+ if !tree || tree.children.empty?
64
+ ''
65
+ elsif param('tag.menu.nested')
66
+ create_output_nested(context, tree)
67
+ else
68
+ create_output_not_nested(context, tree)
69
+ end
63
70
  end
64
71
 
65
72
  #########
@@ -127,11 +134,11 @@ module Webgen::Tag
127
134
  end
128
135
  end
129
136
 
130
- # Create the HTML menu of the +tree+ using the provided +context+.
131
- def create_output(context, tree, level = 1)
137
+ # Create the nested HTML menu of the +tree+ using the provided +context+.
138
+ def create_output_nested(context, tree, level = 1)
132
139
  out = "<ul>"
133
140
  tree.children.each do |child|
134
- menu = child.children.length > 0 ? create_output(context, child, level + 1) : ''
141
+ menu = child.children.length > 0 ? create_output_nested(context, child, level + 1) : ''
135
142
  style, link = menu_item_details(context.dest_node, child.node, context.content_node.lang, level)
136
143
 
137
144
  out << "<li #{style}>#{link}"
@@ -142,6 +149,21 @@ module Webgen::Tag
142
149
  out
143
150
  end
144
151
 
152
+ # Create the not nested HTML menu of the +tree+ using the provided +context+.
153
+ def create_output_not_nested(context, tree, level = 1)
154
+ submenu = ''
155
+ out = "<ul>"
156
+ tree.children.each do |child|
157
+ submenu << (child.children.length > 0 ? create_output_not_nested(context, child, level + 1) : '')
158
+ style, link = menu_item_details(context.dest_node, child.node, context.content_node.lang, level)
159
+
160
+ out << "<li #{style}>#{link}</li>"
161
+ end
162
+ out << "</ul>"
163
+ out << submenu
164
+ out
165
+ end
166
+
145
167
  # Return style information (node is selected, ...) and a link from +dest_node+ to +node+.
146
168
  def menu_item_details(dest_node, node, lang, level)
147
169
  styles = ['webgen-menu-level' + level.to_s]
@@ -1,6 +1,6 @@
1
1
  module Webgen
2
2
 
3
3
  # The version of webgen.
4
- VERSION = '0.5.4'
4
+ VERSION = '0.5.5'
5
5
 
6
6
  end
@@ -19,6 +19,10 @@ class TestSourceHandlerVirtual < Test::Unit::TestCase
19
19
  - /directory/path.en.html:
20
20
  url: other.html
21
21
  title: new title
22
+
23
+ - api.html:
24
+ url: http://www.example.com
25
+ title: Absolute
22
26
  EOF
23
27
 
24
28
  def test_create_node
@@ -44,6 +48,9 @@ EOF
44
48
  assert_equal('directory/other.html', path_de.route_to(path_en))
45
49
  assert_equal('../path.de.html', dir.route_to(path_de))
46
50
  assert_equal('../directory/other.html', dir.route_to(path_en))
51
+
52
+ assert_equal('http://www.example.com', root.tree['/api.html'].path)
53
+ assert_equal('http://www.example.com', root.tree['/path.de.html'].route_to(root.tree['/api.html']))
47
54
  end
48
55
 
49
56
  end
@@ -66,6 +66,16 @@ class TestTagMenu < Test::Unit::TestCase
66
66
  "<li class=\"webgen-menu-level1 webgen-menu-submenu\"><a href=\"../../dir2/\"></a></li>" +
67
67
  "<li class=\"webgen-menu-level1 webgen-menu-submenu\"><a href=\"../../dir3/\"></a></li></ul>", output)
68
68
 
69
+ @obj.set_params('tag.menu.nested' => false)
70
+ output = @obj.call('menu', '', Webgen::ContentProcessor::Context.new(:chain => [nodes[:index11_en]]))
71
+ @obj.set_params({})
72
+ assert_equal("<ul><li class=\"webgen-menu-level1 webgen-menu-submenu webgen-menu-submenu-inhierarchy\"><a href=\"../\"></a></li>" +
73
+ "<li class=\"webgen-menu-level1 webgen-menu-submenu\"><a href=\"../../dir2/\"></a></li>" +
74
+ "<li class=\"webgen-menu-level1 webgen-menu-submenu\"><a href=\"../../dir3/\"></a></li></ul>" +
75
+ "<ul><li class=\"webgen-menu-level2 webgen-menu-submenu webgen-menu-submenu-inhierarchy\"><span></span></li>" +
76
+ "<li class=\"webgen-menu-level2\"><a href=\"../file11.en.html\"></a></li></ul>" +
77
+ "<ul><li class=\"webgen-menu-level3\"><a href=\"file111.en.html\"></a></li>" +
78
+ "<li class=\"webgen-menu-level3 webgen-menu-item-selected\"><span></span></li></ul>", output)
69
79
 
70
80
  @obj.set_params('tag.menu.used_nodes' => 'fragments')
71
81
  output = @obj.call('menu', '', Webgen::ContentProcessor::Context.new(:chain => [nodes[:file11_en]]))
@@ -189,7 +199,7 @@ class TestTagMenu < Test::Unit::TestCase
189
199
  "<ul><li class=\"webgen-menu-level2\"><a href=\"../../dir2/file21.en.html\"></a></li></ul></li>" +
190
200
  "<li class=\"webgen-menu-level1 webgen-menu-submenu\"><a href=\"../../dir3/\"></a>" +
191
201
  "<ul><li class=\"webgen-menu-level2\"><a href=\"../../dir3/file31.en.html\"></a></li></ul></li></ul>",
192
- @obj.send(:create_output, context, tree))
202
+ @obj.send(:create_output_nested, context, tree))
193
203
  end
194
204
 
195
205
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Leitner
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-08 00:00:00 +02:00
12
+ date: 2008-10-01 00:00:00 +02:00
13
13
  default_executable: webgen
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -18,9 +18,9 @@ dependencies:
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - ~>
21
+ - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.0.0
23
+ version: 2.0.2
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: maruku
@@ -28,9 +28,9 @@ dependencies:
28
28
  version_requirement:
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.5.6
33
+ version: 0.5.9
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: facets
@@ -38,7 +38,7 @@ dependencies:
38
38
  version_requirement:
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ">="
41
+ - - "="
42
42
  - !ruby/object:Gem::Version
43
43
  version: 2.4.3
44
44
  version:
@@ -48,9 +48,9 @@ dependencies:
48
48
  version_requirement:
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - "="
52
52
  - !ruby/object:Gem::Version
53
- version: 0.8.0
53
+ version: 0.8.3
54
54
  version:
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: ramaze
@@ -68,7 +68,7 @@ dependencies:
68
68
  version_requirement:
69
69
  version_requirements: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ">="
71
+ - - "="
72
72
  - !ruby/object:Gem::Version
73
73
  version: 0.3.2
74
74
  version:
@@ -78,9 +78,9 @@ dependencies:
78
78
  version_requirement:
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ">="
81
+ - - "="
82
82
  - !ruby/object:Gem::Version
83
- version: 0.8.0
83
+ version: 0.8.1.2.0
84
84
  version:
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: dcov
@@ -88,7 +88,7 @@ dependencies:
88
88
  version_requirement:
89
89
  version_requirements: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - ">="
91
+ - - "="
92
92
  - !ruby/object:Gem::Version
93
93
  version: 0.2.2
94
94
  version:
@@ -98,7 +98,7 @@ dependencies:
98
98
  version_requirement:
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "="
102
102
  - !ruby/object:Gem::Version
103
103
  version: 1.0.0
104
104
  version:
@@ -108,7 +108,7 @@ dependencies:
108
108
  version_requirement:
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - ">="
111
+ - - "="
112
112
  - !ruby/object:Gem::Version
113
113
  version: 3.0.0
114
114
  version:
@@ -118,7 +118,7 @@ dependencies:
118
118
  version_requirement:
119
119
  version_requirements: !ruby/object:Gem::Requirement
120
120
  requirements:
121
- - - ">="
121
+ - - "="
122
122
  - !ruby/object:Gem::Version
123
123
  version: 2.0.1
124
124
  version:
@@ -128,9 +128,9 @@ dependencies:
128
128
  version_requirement:
129
129
  version_requirements: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - ">="
131
+ - - "="
132
132
  - !ruby/object:Gem::Version
133
- version: 2.1.0
133
+ version: 2.1.2
134
134
  version:
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: rdoc
@@ -138,7 +138,7 @@ dependencies:
138
138
  version_requirement:
139
139
  version_requirements: !ruby/object:Gem::Requirement
140
140
  requirements:
141
- - - ">="
141
+ - - "="
142
142
  - !ruby/object:Gem::Version
143
143
  version: 2.0.0
144
144
  version:
@@ -148,7 +148,7 @@ dependencies:
148
148
  version_requirement:
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - ">="
151
+ - - "="
152
152
  - !ruby/object:Gem::Version
153
153
  version: 0.7.4.215
154
154
  version:
@@ -158,7 +158,7 @@ dependencies:
158
158
  version_requirement:
159
159
  version_requirements: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - ">="
161
+ - - "="
162
162
  - !ruby/object:Gem::Version
163
163
  version: 0.2.29
164
164
  version:
@@ -168,7 +168,7 @@ dependencies:
168
168
  version_requirement:
169
169
  version_requirements: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - "="
172
172
  - !ruby/object:Gem::Version
173
173
  version: 2.6.2
174
174
  version:
@@ -178,7 +178,7 @@ dependencies:
178
178
  version_requirement:
179
179
  version_requirements: !ruby/object:Gem::Requirement
180
180
  requirements:
181
- - - ">="
181
+ - - "="
182
182
  - !ruby/object:Gem::Version
183
183
  version: 1.2.9
184
184
  version:
@@ -536,7 +536,8 @@ files:
536
536
  - test/helper.rb
537
537
  has_rdoc: true
538
538
  homepage: http://webgen.rubyforge.org
539
- post_install_message: |
539
+ post_install_message: |+
540
+
540
541
  Thanks for choosing webgen! Here are some places to get you started:
541
542
  * The webgen User Documentation at <http://webgen.rubyforge.org/documentation/index.html>
542
543
  * The mailing list archive at <http://rubyforge.org/pipermail/webgen-users/>
@@ -544,7 +545,7 @@ post_install_message: |
544
545
  Have a look at <http://webgen.rubyforge.org/news/index.html> for a list of changes!
545
546
 
546
547
  Have fun!
547
-
548
+
548
549
  rdoc_options:
549
550
  - --line-numbers
550
551
  - --inline-source
@@ -568,7 +569,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
568
569
  requirements: []
569
570
 
570
571
  rubyforge_project: webgen
571
- rubygems_version: 1.2.0
572
+ rubygems_version: 1.3.0
572
573
  signing_key:
573
574
  specification_version: 2
574
575
  summary: webgen is a fast, powerful, and extensible static website generator.