webgen 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,44 +1,46 @@
1
1
  ----------------------------------------------------------------------
2
- r171: thomasleitner | 2007-09-08 11:38:30 +0200
2
+ r395: thomasleitner | 2007-12-31 10:38:24 +0100
3
3
  Changed paths:
4
- M /local/webgen/trunk/THANKS
4
+ M /local/webgen/trunk/TODO
5
5
  M /local/webgen/trunk/doc/src/default.template
6
+ M /local/webgen/trunk/doc/src/documentation/plugins/core/filehandler.page
6
7
  M /local/webgen/trunk/doc/src/news.page
8
+ M /local/webgen/trunk/doc/src/project.todo
9
+ M /local/webgen/trunk/lib/webgen/plugins/filehandlers/filehandler.rb
7
10
 
8
- * added news entry for 0.4.6 release
9
- * updated THANKS file
11
+ * fixed bug T025: Core/FileHandler and file handler plugins are now aware of hidden files if Core/FileHandler:useHiddenFiles is set to true
12
+ * updated documentation
10
13
  ----------------------------------------------------------------------
11
- r170: thomasleitner | 2007-09-08 11:28:35 +0200
14
+ r394: thomasleitner | 2007-12-31 10:33:18 +0100
12
15
  Changed paths:
13
- M /local/webgen/trunk/lib/webgen/plugins/filehandlers/page.rb
16
+ M /local/webgen/trunk/lib/webgen/plugins/filehandlers/gallery.rb
17
+ M /local/webgen/trunk/test/unittests/tc_filehandler_gallery.rb
14
18
 
15
- * bug fix by Andrea Ferro for meta info handling in File/PageHandler
19
+ * fixed failing File/ThumbnailWriter test case
16
20
  ----------------------------------------------------------------------
17
- r169: thomasleitner | 2007-09-08 11:24:53 +0200
21
+ r353: thomasleitner | 2007-12-17 07:58:15 +0100
18
22
  Changed paths:
19
- M /local/webgen/trunk/lib/webgen/config.rb
23
+ M /local/webgen/trunk/data/webgen/gallery_styles/slides/collage.rb
24
+ M /local/webgen/trunk/data/webgen/gallery_styles/slides/gallery_gallery.template
25
+ M /local/webgen/trunk/data/webgen/gallery_styles/slides/gallery_image.template
26
+ M /local/webgen/trunk/data/webgen/gallery_styles/slides/gallery_main.template
27
+ M /local/webgen/trunk/doc/src/documentation/plugins/file/galleryhandler.page
28
+ M /local/webgen/trunk/doc/src/project.todo
29
+ M /local/webgen/trunk/lib/webgen/plugins/filehandlers/gallery.rb
30
+ M /local/webgen/trunk/test/unittests/tc_filehandler_gallery.rb
20
31
 
21
- * bumped version number to 0.4.6
32
+ * fixed bug T027: File/GalleryHandler is now multi-lingual aware, ie. it is possible to create a gallery in multiple languages, updated docu and tests accordingly
22
33
  ----------------------------------------------------------------------
23
- r168: thomasleitner | 2007-09-08 11:24:06 +0200
34
+ r352: thomasleitner | 2007-12-15 09:34:01 +0100
24
35
  Changed paths:
25
- M /local/webgen/branches/head/data/webgen/plugins/core/filehandler.plugin/docu_filehandler.page
26
- M /local/webgen/branches/head/data/webgen/plugins/core/filehandler.plugin/filehandler.rb
27
- M /local/webgen/branches/head/lib/webgen/node.rb
28
- M /local/webgen/branches/head/test/unittests/tc_node.rb
29
- M /local/webgen/trunk/doc/src/documentation/plugins/core/filehandler.page
30
- M /local/webgen/trunk/lib/webgen/node.rb
31
- M /local/webgen/trunk/lib/webgen/plugins/filehandlers/filehandler.rb
32
- M /local/webgen/trunk/lib/webgen/plugins/filehandlers/gallery.rb
33
- M /local/webgen/trunk/lib/webgen/plugins/filehandlers/page.rb
36
+ M /local/webgen/trunk/doc/src/documentation/plugins/file/galleryhandler.page
37
+ M /local/webgen/trunk/doc/src/project.todo
34
38
 
35
- * fixed bug RF#13757 in trunk and head: src path with special characters is now handled correctly
36
- * documented which characters must not be used in directory and file names
39
+ * fixed typo spotted by Phil Hughes
37
40
  ----------------------------------------------------------------------
38
- r159: thomasleitner | 2007-08-20 11:49:35 +0200
41
+ r325: thomasleitner | 2007-12-07 16:25:52 +0100
39
42
  Changed paths:
40
- A /local
41
- A /local/webgen (from /mirror/webgen:158)
42
-
43
+ A /local/webgen (from /mirror/webgen:322)
43
44
 
45
+ * fresh start
44
46
  ----------------------------------------------------------------------
data/TODO CHANGED
@@ -1,5 +1,6 @@
1
1
  ---- CURRENT ----
2
2
 
3
+ * bug in menu style section: should work although page is not in menu, should either be totally independent from Tag/Menu or better integrated
3
4
  * modify WebSite to allow better use (factor out loading of plugins into own method, do not call init in #render method, ...)
4
5
  * show error message when configuration file is invalid (Webgen::WebSite)
5
6
  * add a common class to the menu element (either a or span, depending on Fil/DefaultFileHandler:linkToCurrentPage) for easier referencing in CSS styles (update menu CSS style afterwards for horiz-dd, vert-dd, ...)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.6
1
+ 0.4.7
@@ -71,7 +71,7 @@ module Collage
71
71
  #######
72
72
 
73
73
  def collage_title( ginfo )
74
- ginfo['title'].tr( ' ', '_' )
74
+ ginfo['filename'].tr( ' ', '_' )
75
75
  end
76
76
 
77
77
  def collage_name( ginfo )
@@ -14,7 +14,7 @@ else
14
14
  <% if ginfo.prev_gallery %>
15
15
  <a href="{relocatable: <%= ginfo.prev_gallery.pagename %>}">
16
16
  &lt;&lt; previous gallery
17
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
17
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
18
18
  <%= ginfo.prev_gallery.thumbnail('style'=>'vertical-align: middle', 'class'=>'webgen-gallery-thumbnail') %>
19
19
  </span>
20
20
  </a>
@@ -29,7 +29,7 @@ else
29
29
  <% if ginfo.next_gallery %>
30
30
  <a href="{relocatable: <%= ginfo.next_gallery.pagename %>}">
31
31
  next gallery &gt;&gt;
32
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
32
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
33
33
  <%= ginfo.next_gallery.thumbnail('style'=>'vertical-align: middle', 'class'=>'webgen-gallery-thumbnail') %>
34
34
  </span>
35
35
  </a>
@@ -44,7 +44,7 @@ else
44
44
  <% row_index.upto( [row_index + 4, ginfo.cur_gallery.images.length - 1].min ) do |col_index|%>
45
45
  <td align="center">
46
46
  <a href="{relocatable: <%= ginfo.cur_gallery.images[col_index].pagename %>}">
47
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
47
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
48
48
  <%= ginfo.cur_gallery.images[col_index].thumbnail('class'=>'webgen-gallery-thumbnail') %>
49
49
  </span>
50
50
  <br />
@@ -14,7 +14,7 @@ else
14
14
  <% if ginfo.prev_image %>
15
15
  <a href="{relocatable: <%= ginfo.prev_image.pagename %>}">
16
16
  &lt;&lt; previous image
17
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
17
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
18
18
  <%= ginfo.prev_image.thumbnail('style'=>'vertical-align: middle', 'class'=>'webgen-gallery-thumbnail') %>
19
19
  </span>
20
20
  </a>
@@ -22,7 +22,7 @@ else
22
22
  </td>
23
23
  <td style="width: 34%; padding: 2px;" valign="top" align="center">
24
24
  <a href="{relocatable: <%= ginfo.cur_gallery.pagename %>}">
25
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
25
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
26
26
  <%= ginfo.cur_gallery.thumbnail('class'=>'webgen-gallery-thumbnail') %>
27
27
  </span>
28
28
  ^<%= ginfo.cur_gallery.title %>^
@@ -32,7 +32,7 @@ else
32
32
  <% if ginfo.next_image %>
33
33
  <a href="{relocatable: <%= ginfo.next_image.pagename %>}">
34
34
  next image &gt;&gt;
35
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
35
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
36
36
  <%= ginfo.next_image.thumbnail('style'=>'vertical-align: middle', 'class'=>'webgen-gallery-thumbnail') %>
37
37
  </span>
38
38
  </a>
@@ -15,7 +15,7 @@ else
15
15
  <% row_index.upto( [row_index + 4, ginfo.galleries.length - 1].min ) do |col_index| %>
16
16
  <td align="center">
17
17
  <a href="{relocatable: <%= ginfo.galleries[col_index].pagename %>}">
18
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
18
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
19
19
  <%= ginfo.galleries[col_index].thumbnail('class'=>'webgen-gallery-thumbnail') %>
20
20
  </span>
21
21
  <br />
@@ -71,7 +71,7 @@ module Collage
71
71
  #######
72
72
 
73
73
  def collage_title( ginfo )
74
- ginfo['title'].tr( ' ', '_' )
74
+ ginfo['filename'].tr( ' ', '_' )
75
75
  end
76
76
 
77
77
  def collage_name( ginfo )
@@ -48,6 +48,10 @@
48
48
 
49
49
  <div id="rightside">
50
50
  <h1>Latest news</h1>
51
+ <p><strong>2007-12-31: </strong>
52
+ Minor release with feature enhancements.
53
+ <a href="{relocatable: news.en.page#news-2007-12-31}">More...</a>
54
+ </p>
51
55
  <p><strong>2007-09-08: </strong>
52
56
  Small bug fix release.
53
57
  <a href="{relocatable: news.en.page#news-2007-09-08}">More...</a>
@@ -56,10 +60,6 @@
56
60
  Some bug fixes and one small feature enhancement.
57
61
  <a href="{relocatable: news.en.page#news-2007-06-29}">More...</a>
58
62
  </p>
59
- <p><strong>2007-05-20: </strong>
60
- Fixed bug which prevented installation via Rubygems.
61
- <a href="{relocatable: news.en.page#news-2007-05-20}">More...</a>
62
- </p>
63
63
 
64
64
  <h1>Links</h1>
65
65
  <ul class="linklist">
@@ -0,0 +1,21 @@
1
+ ---
2
+ title: Haml
3
+ inMenu: true
4
+ template: /plugin.template
5
+ plugin: ContentConverter/Haml
6
+ ---
7
+ h2(#description). Description
8
+
9
+
10
+ Converts content written using Haml markup
11
+ ("Homepage":http://haml.hamptoncatlin.com/) to HTML.
12
+
13
+
14
+ h2(#caveat). Caveat
15
+
16
+
17
+ This plugin is only available if you have installed the
18
+ "haml":http://haml.hamptoncatlin.com/ library. The preferred way to do this is via
19
+ Rubygems:
20
+
21
+ gem install haml
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: Sass
3
+ inMenu: true
4
+ template: /plugin.template
5
+ plugin: ContentConverter/Sass
6
+ ---
7
+ h2(#description). Description
8
+
9
+
10
+ Converts content written using Sass markup ("Homepage":http://haml.hamptoncatlin.com/) to CSS. This
11
+ content converter is only useful for writing CSS page files. You have to make sure to change the
12
+ output name style sothat the extension @css@ is used and to stop the template chain - see the
13
+ example below!
14
+
15
+ You can use the following page file as a template for your sass files:
16
+
17
+ <pre>
18
+ \---
19
+ outputNameStyle: [:name, [., :lang], .css]
20
+ template: ~
21
+ validator: ~
22
+ \--- content, sass
23
+ p
24
+ :background-color grey
25
+ :padding 5px
26
+ </pre>
27
+
28
+
29
+ h2(#caveat). Caveat
30
+
31
+
32
+ This plugin is only available if you have installed the
33
+ "haml":http://haml.hamptoncatlin.com/ library. The preferred way to do this is via
34
+ Rubygems:
35
+
36
+ gem install haml
@@ -27,7 +27,7 @@ h2(#filehandling). Handling of files in the source directory
27
27
  Following is the list of rules how files in the source directory are handled by webgen:
28
28
 
29
29
  # All file/directory names in the source directory are fetched (actually, only those file/directory
30
- names without a leading dot)
30
+ names without a leading dot unless {param: Core/FileHandler:useHiddenFiles} is set to @true@)
31
31
  # Those files which match an {param: Core/FileHandler:ignorePaths} pattern are excluded
32
32
  # The path patterns for each file handler plugin are matched against the remaining files and all
33
33
  matching files are then handled by the file handler plugin
@@ -81,8 +81,12 @@ using the name of a gallery handler parameter as key you can override its value.
81
81
  following keys are used by the gallery handler:
82
82
 
83
83
  * *title*: The title of the gallery. If this key is not specified, the capitalized file name is used.
84
+ * *filename*: The base filename used for creating the page files. If not specified it is created from
85
+ the title.
86
+ * *lang*: The language used by the gallery. If not specified, the default language is used.
84
87
  * *mainPageMetaInfo*: Used for setting additional meta information for the main page.
85
88
  * *galleryPagesMetaInfo*: Used for setting additional meta information for the gallery pages.
89
+ * *imagePagesMetaInfo*: Used for setting additional meta information for all image pages.
86
90
  * *layouter*: Plugin used for additional gallery tasks, has to be registered under
87
91
  @GalleryLayouter/&lt;layouter-name&gt;@
88
92
  * *thumbnailSize*: The size of the thumbnails, can also be set individually for each image.
@@ -98,6 +102,11 @@ be used the whole image gallery. These images have to be somewhere in the websit
98
102
  You can/should not specify images outside the source directory as these images are not automatically
99
103
  copied to the output directory and automatic thumbnail creation may not work correctly!
100
104
 
105
+ If you want to create a multi-lingual gallery, you need to create two gallery files which specify
106
+ the same @filename@ key and different @lang@ keys. It's best to first create one gallery file, fill
107
+ in all the information and then copy it and change the @filename@ and @lang@ keys as well as all the
108
+ other language specific information like titles and descriptions.
109
+
101
110
  All other key-value pairs specified are not used by webgen. However, as layouter plugins have access
102
111
  to the whole configuration section they may use their own configuration keys.
103
112
 
@@ -163,7 +172,7 @@ example/dir1/img1.jpg:
163
172
  title: Test title
164
173
  description: Long description of image
165
174
 
166
- example/img2.jpg
175
+ example/img2.jpg:
167
176
  title: Title2 of pic
168
177
  mykey: mydata
169
178
  </pre>
@@ -14,7 +14,7 @@ else
14
14
  <% if ginfo.prev_gallery %>
15
15
  <a href="{relocatable: <%= ginfo.prev_gallery.pagename %>}">
16
16
  &lt;&lt; previous gallery
17
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
17
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
18
18
  <%= ginfo.prev_gallery.thumbnail('style'=>'vertical-align: middle', 'class'=>'webgen-gallery-thumbnail') %>
19
19
  </span>
20
20
  </a>
@@ -29,7 +29,7 @@ else
29
29
  <% if ginfo.next_gallery %>
30
30
  <a href="{relocatable: <%= ginfo.next_gallery.pagename %>}">
31
31
  next gallery &gt;&gt;
32
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
32
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
33
33
  <%= ginfo.next_gallery.thumbnail('style'=>'vertical-align: middle', 'class'=>'webgen-gallery-thumbnail') %>
34
34
  </span>
35
35
  </a>
@@ -44,7 +44,7 @@ else
44
44
  <% row_index.upto( [row_index + 4, ginfo.cur_gallery.images.length - 1].min ) do |col_index|%>
45
45
  <td align="center">
46
46
  <a href="{relocatable: <%= ginfo.cur_gallery.images[col_index].pagename %>}">
47
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
47
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
48
48
  <%= ginfo.cur_gallery.images[col_index].thumbnail('class'=>'webgen-gallery-thumbnail') %>
49
49
  </span>
50
50
  <br />
@@ -14,7 +14,7 @@ else
14
14
  <% if ginfo.prev_image %>
15
15
  <a href="{relocatable: <%= ginfo.prev_image.pagename %>}">
16
16
  &lt;&lt; previous image
17
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
17
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
18
18
  <%= ginfo.prev_image.thumbnail('style'=>'vertical-align: middle', 'class'=>'webgen-gallery-thumbnail') %>
19
19
  </span>
20
20
  </a>
@@ -22,7 +22,7 @@ else
22
22
  </td>
23
23
  <td style="width: 34%; padding: 2px;" valign="top" align="center">
24
24
  <a href="{relocatable: <%= ginfo.cur_gallery.pagename %>}">
25
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
25
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
26
26
  <%= ginfo.cur_gallery.thumbnail('class'=>'webgen-gallery-thumbnail') %>
27
27
  </span>
28
28
  ^<%= ginfo.cur_gallery.title %>^
@@ -32,7 +32,7 @@ else
32
32
  <% if ginfo.next_image %>
33
33
  <a href="{relocatable: <%= ginfo.next_image.pagename %>}">
34
34
  next image &gt;&gt;
35
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
35
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
36
36
  <%= ginfo.next_image.thumbnail('style'=>'vertical-align: middle', 'class'=>'webgen-gallery-thumbnail') %>
37
37
  </span>
38
38
  </a>
@@ -15,7 +15,7 @@ else
15
15
  <% row_index.upto( [row_index + 4, ginfo.galleries.length - 1].min ) do |col_index| %>
16
16
  <td align="center">
17
17
  <a href="{relocatable: <%= ginfo.galleries[col_index].pagename %>}">
18
- <span class="thumb thumb-<%= ginfo['title'].tr(' ', '_') %>">
18
+ <span class="thumb thumb-<%= ginfo['filename'].tr(' ', '_') %>">
19
19
  <%= ginfo.galleries[col_index].thumbnail('class'=>'webgen-gallery-thumbnail') %>
20
20
  </span>
21
21
  <br />
@@ -4,6 +4,18 @@ inMenu: true
4
4
  ---
5
5
  h2. News
6
6
 
7
+
8
+ h3(#news-2007-12-31). 31.12.2007 - webgen 0.4.7
9
+
10
+ Minor release with feature enhancements:
11
+
12
+ * added support for Haml markup {plugin: ContentConverter/Haml}
13
+ * added support for Sass markup {plugin: ContentConverter/Sass}
14
+ * gallery file handler is now multilingual aware
15
+ * hidden files can now be used by the file handler plugins if the parameter {param:
16
+ Core/FileHandler:useHiddenFiles} is set to true
17
+
18
+
7
19
  h3(#news-2007-09-08). 08.09.2007 - webgen 0.4.6
8
20
 
9
21
  This is a bug fix release:
@@ -9,6 +9,8 @@ The following category defines all milestones for webgen:
9
9
 
10
10
  ###### Milestones ######
11
11
 
12
+ * Dez07 (2007-12-31) Bug fixes and small enhancements
13
+
12
14
  * Jun07 (2007-06-30) Bug fixes
13
15
 
14
16
  * Apr07 (2007-04-30) Bug fixes and small enhancements
@@ -35,16 +37,18 @@ Categories for implementation issues:
35
37
  ###### Implementation (open) ######
36
38
 
37
39
 
38
- * T002 [F] add localization support for all files
39
- See also FR#7891
40
+ ## Implementation (closed) ##
40
41
 
41
42
  * T003 [F] add additional tests for sipttra implementation
43
+ done in the next major version of webgen 0.5.0
42
44
 
43
45
  * T023 [F] Add the possibility to add a prefix to webgen tags
44
46
  If the prefix is wg then a tag should look like \\{wg:menu:} or \\{wg:relocatable: default.css}
47
+ this is available in the next major version 0.5.0
45
48
 
46
-
47
- ## Implementation (closed) ##
49
+ * T002 [F] add localization support for all files
50
+ See also FR#7891
51
+ This is available in the next major version 0.5.0
48
52
 
49
53
  * T004 [Feb07] use HTML as default format for templates
50
54
  See also FR#7893
@@ -68,6 +72,14 @@ Categories for implementation issues:
68
72
 
69
73
  ## Bugs (closed) ##
70
74
 
75
+ * T026 [Dez07] make Core/FileHandler aware of hidden files
76
+ use a parameter to enable usage of hidden files or enable it by default
77
+
78
+ now using a parameter Core/FileHandler:useHiddenFiles which is false by default
79
+
80
+ * T027 [Dez07] make gallery file handler multi-lingual aware
81
+ see mail exchange with Phil Hughes
82
+
71
83
  * T005 [Feb07] check all styles for correctly selected menu items
72
84
  style issues because of new span element when File/DefaultHandler:linkToCurrentPage is false
73
85
 
@@ -116,12 +128,12 @@ Category for documentation issues:
116
128
  ###### Documentation (open) ######
117
129
 
118
130
 
131
+ ## Documentation (closed) ##
132
+
119
133
  * T014 [F] add plugin developer documentation
120
134
  - document how to write various plugins (file handler, tag, CLI command, ...)
121
135
  - caveat when using classes in modules
122
-
123
-
124
- ## Documentation (closed) ##
136
+ --> done in version 0.5.0
125
137
 
126
138
  * T010 [Feb07] add some example sites
127
139
  It was requested that one should be able to download some zipped examples sites from the examples
@@ -24,7 +24,7 @@ require 'rbconfig'
24
24
 
25
25
  module Webgen
26
26
 
27
- VERSION = [0, 4, 6]
27
+ VERSION = [0, 4, 7]
28
28
  AUTHOR = 'Thomas Leitner <t_leitner@gmx.at>'
29
29
  SUMMARY = "webgen is a templated based static Web site generator."
30
30
  DESCRIPTION = "webgen is a Web site generator implemented in Ruby. " \
@@ -0,0 +1,71 @@
1
+ #
2
+ #--
3
+ #
4
+ # $Id: markdown.rb 531 2006-11-17 17:56:14Z thomas $
5
+ #
6
+ # webgen: template based static website generator
7
+ # Copyright (C) 2004 Thomas Leitner
8
+ #
9
+ # This program is free software; you can redistribute it and/or modify it under the terms of the GNU
10
+ # General Public License as published by the Free Software Foundation; either version 2 of the
11
+ # License, or (at your option) any later version.
12
+ #
13
+ # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
14
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ # General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU General Public License along with this program; if not,
18
+ # write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
+ #
20
+ #++
21
+ #
22
+
23
+ load_optional_part( 'content-converter-haml-sass',
24
+ :needed_gems => ['haml'],
25
+ :error_msg => "Haml and sass not available as content format as the haml library could not be loaded",
26
+ :info => "Haml/Sass can be used as content format" ) do
27
+
28
+ require 'haml'
29
+ load_plugin 'webgen/plugins/contentconverters/default'
30
+
31
+ module ContentConverters
32
+
33
+ class HamlConverter < DefaultContentConverter
34
+
35
+ infos( :name => 'ContentConverter/Haml',
36
+ :author => Webgen::AUTHOR,
37
+ :summary => "Handles content formatted in Haml format"
38
+ )
39
+
40
+ register_handler 'haml'
41
+
42
+ def call( content )
43
+ Haml::Engine.new( content ).render
44
+ rescue Exception => e
45
+ log(:error) { "Error converting Haml text to HTML: #{e.message}" }
46
+ content
47
+ end
48
+
49
+ end
50
+
51
+ class SassConverter < DefaultContentConverter
52
+
53
+ infos( :name => 'ContentConverter/Sass',
54
+ :author => Webgen::AUTHOR,
55
+ :summary => "Handles content formatted in Sass format"
56
+ )
57
+
58
+ register_handler 'sass'
59
+
60
+ def call( content )
61
+ Sass::Engine.new( content ).render
62
+ rescue Exception => e
63
+ log(:error) { "Error converting Sass text to HTML: #{e.message}" }
64
+ content
65
+ end
66
+
67
+ end
68
+
69
+ end
70
+
71
+ end
@@ -54,6 +54,8 @@ module FileHandlers
54
54
  param 'defaultMetaInfo', {}, 'The keys for this hash are the names of file handlers, the ' +
55
55
  'values hashes with meta data.'
56
56
 
57
+ param 'useHiddenFiles', false, 'Files starting with a dot can also used by the file handler plugins if set to true.'
58
+
57
59
  depends_on 'Core/Configuration'
58
60
 
59
61
  include Listener
@@ -283,7 +285,7 @@ module FileHandlers
283
285
 
284
286
  # Returns an array of files of the source directory matching +pattern+
285
287
  def files_for_pattern( pattern )
286
- files = Dir.glob( File.join( param( 'srcDir', 'Core/Configuration' ), pattern ), File::FNM_CASEFOLD ).to_set
288
+ files = Dir.glob( File.join( param( 'srcDir', 'Core/Configuration' ), pattern ), (param('useHiddenFiles') ? File::FNM_DOTMATCH : 0) | File::FNM_CASEFOLD ).to_set
287
289
  files.delete( File.join( param( 'srcDir', 'Core/Configuration' ), '/' ) )
288
290
  files.collect! do |f|
289
291
  f = f.sub( /([^.])\.{1,2}$/, '\1' ) # remove '.' and '..' from end of paths
@@ -139,7 +139,7 @@ module FileHandlers
139
139
  # The main page object if it exists; otherwise +nil+.
140
140
  attr_accessor :mainpage
141
141
 
142
- # The whole data hahs for the image gallery.
142
+ # The whole data hash for the image gallery.
143
143
  attr_reader :data
144
144
 
145
145
  def initialize( gallery_data, gIndex = nil, iIndex = nil )
@@ -247,6 +247,8 @@ module FileHandlers
247
247
  end
248
248
 
249
249
  @filedata['title'] ||= File.basename( file, '.*' ).capitalize
250
+ @filedata['filename'] ||= @filedata['title'].downcase
251
+ @filedata['lang'] ||= param( 'lang', 'Core/Configuration' )
250
252
  log(:info) { "Creating gallery for file <#{file}> with #{images.length} images" }
251
253
  ginfo = create_gallery( images, parent )
252
254
  @plugin_manager["GalleryLayouter/#{@filedata['layouter']}"].handle_gallery( ginfo, parent ) if @filedata.has_key?('layouter') && @plugin_manager["GalleryLayouter/#{@filedata['layouter']}"]
@@ -268,6 +270,7 @@ module FileHandlers
268
270
  end
269
271
 
270
272
  def page_data( metainfo )
273
+ metainfo['lang'] = @filedata['lang']
271
274
  temp = metainfo.to_yaml
272
275
  temp = "---\n" + temp unless /^---\s*$/ =~ temp
273
276
  "#{temp}\n---\n"
@@ -293,7 +296,7 @@ module FileHandlers
293
296
  gallery_data['imagesPerPage'] = param('imagesPerPage'),
294
297
 
295
298
  if main_page_used
296
- main_node = create_page_node( gallery_file_name( main_data['title'] ), parent, page_data( main_data ) )
299
+ main_node = create_page_node( gallery_file_name( @filedata['filename'] ), parent, page_data( main_data ) )
297
300
  main_page = GalleryInfo::MainPage.new( main_node.path, main_data )
298
301
  main_node.node_info[:ginfo] = GalleryInfo.new( gallery_data )
299
302
  main_node.node_info[:ginfo].mainpage = main_page
@@ -328,15 +331,17 @@ module FileHandlers
328
331
  data = (@filedata['galleryPagesMetaInfo'] || {}).dup
329
332
  data['template'] ||= param( 'galleryPageTemplate' )
330
333
  data['orderInfo'] += gIndex if data['orderInfo']
331
- data['title'] = @filedata['title'] + ' ' + gIndex.to_s
334
+ data['title'] = (data['title'] || @filedata['title']) + ' ' + gIndex.to_s
335
+ filename = @filedata['filename'] + ' ' + gIndex.to_s
332
336
 
333
337
  if images.length <= param( 'imagesPerPage' ) && gIndex == 1
334
338
  template = data['template']
335
339
  data.update( main_page_data )
336
340
  data['template'] = template
341
+ filename = @filedata['filename']
337
342
  end
338
343
 
339
- node = create_page_node( gallery_file_name( data['title'] ), parent, page_data( data ) )
344
+ node = create_page_node( gallery_file_name( filename ), parent, page_data( data ) )
340
345
  gal_images = create_image_pages( images[i..(i + picsPerPage - 1)], parent )
341
346
  gallery = GalleryInfo::Gallery.new( node.path, data, gal_images.collect {|n,i| i} )
342
347
  galleries << [node, gallery, gal_images]
@@ -351,7 +356,8 @@ module FileHandlers
351
356
  def create_image_pages( images, parent )
352
357
  imageList = []
353
358
  images.each do |image|
354
- data = (@imagedata[image] || {}).dup
359
+ data = (@filedata['imagePagesMetaInfo'] || {}).dup
360
+ data.update( @imagedata[image] || {} )
355
361
  data['template'] ||= param( 'imagePageTemplate' )
356
362
  data['title'] ||= "Image #{File.basename( image )}"
357
363
  data['thumbnailSize'] ||= @filedata['thumbnailSize']
@@ -364,7 +370,7 @@ module FileHandlers
364
370
  data['thumbnail'] ||= thumbnail_for( image, data, parent )
365
371
  end
366
372
 
367
- filename = @filedata['title'] + ' ' + image
373
+ filename = @filedata['filename'] + ' ' + image
368
374
  node = create_page_node( gallery_file_name( filename ), parent, page_data( data ) )
369
375
  image = GalleryInfo::Image.new( node.path, data, image )
370
376
  imageList << [node, image]
@@ -435,7 +441,7 @@ module FileHandlers
435
441
 
436
442
  def create_node( file, parent, meta_info, thumbnailSize = nil, method = nil )
437
443
  name = 'tn_' + File.basename( file ).tr( ' ', '_' )
438
- if !(node = parent.find {|c| c =~ name })
444
+ if !parent || !(node = parent.find {|c| c =~ name })
439
445
  node = Node.new( parent, name )
440
446
  node.meta_info.update( meta_info )
441
447
  node['title'] = node.path
@@ -88,41 +88,41 @@ class GalleryFileHandlerTest < Webgen::PluginTestCase
88
88
 
89
89
  # with a main page
90
90
  assert_nil( @plugin.create_node( fixture_path( 'test.gallery' ), root, {} ) )
91
- assert_not_nil( root.resolve_node( 'Test.page' ) )
92
- assert_not_nil( root.resolve_node( 'Test_1.page' ) )
93
- assert_not_nil( root.resolve_node( 'Test_2.page' ) )
94
- assert_not_nil( root.resolve_node( 'Test_test1_jpg.page' ) )
95
- assert_not_nil( root.resolve_node( 'Test_test2_jpg.page' ) )
96
- assert_not_nil( root.resolve_node( 'Test_test3_jpg.page' ) )
97
- assert_not_nil( root.resolve_node( 'Test_test4_jpg.page' ) )
98
-
99
- node = root.resolve_node( 'Test_test3_jpg.page' )
91
+ assert_not_nil( root.resolve_node( 'test.page' ) )
92
+ assert_not_nil( root.resolve_node( 'test_1.page' ) )
93
+ assert_not_nil( root.resolve_node( 'test_2.page' ) )
94
+ assert_not_nil( root.resolve_node( 'test_test1_jpg.page' ) )
95
+ assert_not_nil( root.resolve_node( 'test_test2_jpg.page' ) )
96
+ assert_not_nil( root.resolve_node( 'test_test3_jpg.page' ) )
97
+ assert_not_nil( root.resolve_node( 'test_test4_jpg.page' ) )
98
+
99
+ node = root.resolve_node( 'test_test3_jpg.page' )
100
100
  assert_kind_of( ginfoclass, node.node_info[:ginfo] )
101
101
  assert_equal( 'test3.jpg', node.node_info[:ginfo].cur_image.filename )
102
102
  assert_equal( node.path, node.node_info[:ginfo].cur_image.pagename )
103
103
  assert_equal( 'gallery_image.template', node['template'] )
104
104
 
105
- node = root.resolve_node( 'Test_2.page' )
105
+ node = root.resolve_node( 'test_2.page' )
106
106
  assert_kind_of( ginfoclass, node.node_info[:ginfo] )
107
107
  assert_equal( node.path, node.node_info[:ginfo].cur_gallery.pagename )
108
108
  assert_equal( 'gallery_gallery.template', node['template'] )
109
109
 
110
- node = root.resolve_node( 'Test.page' )
110
+ node = root.resolve_node( 'test.page' )
111
111
  assert_kind_of( ginfoclass, node.node_info[:ginfo] )
112
112
  assert_equal( 'gallery_main.template', node['template'] )
113
113
 
114
114
  # without a main page
115
115
  root.del_children
116
116
  @plugin.create_node( fixture_path( 'test1.gallery' ), root, {} )
117
- assert_not_nil( root.resolve_node( 'Test1.page' ) )
118
- assert_nil( root.resolve_node( 'Test1_1.page' ) )
119
- assert_nil( root.resolve_node( 'Test1_2.page' ) )
120
- assert_not_nil( root.resolve_node( 'Test1_test1_jpg.page' ) )
121
- assert_not_nil( root.resolve_node( 'Test1_test2_jpg.page' ) )
122
- assert_not_nil( root.resolve_node( 'Test1_test3_jpg.page' ) )
123
- assert_not_nil( root.resolve_node( 'Test1_test4_jpg.page' ) )
124
-
125
- node = root.resolve_node( 'Test1.page' )
117
+ assert_not_nil( root.resolve_node( 'test1.page' ) )
118
+ assert_nil( root.resolve_node( 'test1_1.page' ) )
119
+ assert_nil( root.resolve_node( 'test1_2.page' ) )
120
+ assert_not_nil( root.resolve_node( 'test1_test1_jpg.page' ) )
121
+ assert_not_nil( root.resolve_node( 'test1_test2_jpg.page' ) )
122
+ assert_not_nil( root.resolve_node( 'test1_test3_jpg.page' ) )
123
+ assert_not_nil( root.resolve_node( 'test1_test4_jpg.page' ) )
124
+
125
+ node = root.resolve_node( 'test1.page' )
126
126
  assert_kind_of( ginfoclass, node.node_info[:ginfo] )
127
127
  assert_equal( 'gallery_gallery.template', node['template'] )
128
128
  end
@@ -156,7 +156,7 @@ begin
156
156
  tn_node = root.resolve_node( 'tn_test1.jpg' )
157
157
  assert_not_nil( tn_node )
158
158
  assert_equal( fixture_path( 'test1.jpg' ), tn_node.node_info[:thumbnail_file] )
159
- assert_equal( tn_node.absolute_path, root.resolve_node( 'Test_test1_jpg.page' ).node_info[:ginfo].cur_image.data['thumbnail'] )
159
+ assert_equal( tn_node.absolute_path, root.resolve_node( 'test_test1_jpg.page' ).node_info[:ginfo].cur_image.data['thumbnail'] )
160
160
  end
161
161
 
162
162
  end
metadata CHANGED
@@ -1,33 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
3
- specification_version: 1
4
2
  name: webgen
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.4.6
7
- date: 2007-09-08 00:00:00 +02:00
8
- summary: webgen is a templated based static Web site generator.
9
- require_paths:
10
- - lib
11
- email: t_leitner@gmx.at
12
- homepage: http://webgen.rubyforge.org
13
- rubyforge_project: webgen
14
- description: webgen is a Web site generator implemented in Ruby. It is used to generate static Web pages from templates and page description files.
15
- autorequire:
16
- default_executable: webgen
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.4.7
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Thomas Leitner
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2007-12-31 00:00:00 +01:00
13
+ default_executable: webgen
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: cmdparse
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.0
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: RedCloth
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 3.0.0
32
+ version:
33
+ description: webgen is a Web site generator implemented in Ruby. It is used to generate static Web pages from templates and page description files.
34
+ email: t_leitner@gmx.at
35
+ executables:
36
+ - webgen
37
+ extensions: []
38
+
39
+ extra_rdoc_files:
40
+ - README
31
41
  files:
32
42
  - setup.rb
33
43
  - TODO
@@ -51,6 +61,7 @@ files:
51
61
  - lib/webgen/node.rb
52
62
  - lib/webgen/plugin.rb
53
63
  - lib/webgen/plugins/contentconverters/default.rb
64
+ - lib/webgen/plugins/contentconverters/haml.rb
54
65
  - lib/webgen/plugins/contentconverters/html.rb
55
66
  - lib/webgen/plugins/contentconverters/markdown.rb
56
67
  - lib/webgen/plugins/contentconverters/maruku.rb
@@ -705,10 +716,12 @@ files:
705
716
  - doc/src/documentation/plugins
706
717
  - doc/src/documentation/plugins/contentconverter
707
718
  - doc/src/documentation/plugins/contentconverter/default.page
719
+ - doc/src/documentation/plugins/contentconverter/haml.page
708
720
  - doc/src/documentation/plugins/contentconverter/html.page
709
721
  - doc/src/documentation/plugins/contentconverter/markdown.page
710
722
  - doc/src/documentation/plugins/contentconverter/maruku.page
711
723
  - doc/src/documentation/plugins/contentconverter/rdoc.page
724
+ - doc/src/documentation/plugins/contentconverter/sass.page
712
725
  - doc/src/documentation/plugins/contentconverter/textile.page
713
726
  - doc/src/documentation/plugins/contentconverter/xmlbuilder.page
714
727
  - doc/src/documentation/plugins/core
@@ -854,36 +867,33 @@ files:
854
867
  - doc/src/sipttra.template
855
868
  - man/man1
856
869
  - man/man1/webgen.1
857
- test_files: []
858
-
870
+ has_rdoc: true
871
+ homepage: http://webgen.rubyforge.org
872
+ post_install_message:
859
873
  rdoc_options:
860
874
  - --line-numbers
861
875
  - -m
862
876
  - README
863
- extra_rdoc_files:
864
- - README
865
- executables:
866
- - webgen
867
- extensions: []
868
-
877
+ require_paths:
878
+ - lib
879
+ required_ruby_version: !ruby/object:Gem::Requirement
880
+ requirements:
881
+ - - ">="
882
+ - !ruby/object:Gem::Version
883
+ version: "0"
884
+ version:
885
+ required_rubygems_version: !ruby/object:Gem::Requirement
886
+ requirements:
887
+ - - ">="
888
+ - !ruby/object:Gem::Version
889
+ version: "0"
890
+ version:
869
891
  requirements: []
870
892
 
871
- dependencies:
872
- - !ruby/object:Gem::Dependency
873
- name: cmdparse
874
- version_requirement:
875
- version_requirements: !ruby/object:Gem::Version::Requirement
876
- requirements:
877
- - - ~>
878
- - !ruby/object:Gem::Version
879
- version: 2.0.0
880
- version:
881
- - !ruby/object:Gem::Dependency
882
- name: RedCloth
883
- version_requirement:
884
- version_requirements: !ruby/object:Gem::Version::Requirement
885
- requirements:
886
- - - ">="
887
- - !ruby/object:Gem::Version
888
- version: 3.0.0
889
- version:
893
+ rubyforge_project: webgen
894
+ rubygems_version: 1.0.1
895
+ signing_key:
896
+ specification_version: 2
897
+ summary: webgen is a templated based static Web site generator.
898
+ test_files: []
899
+