From andrea.censi at dis.uniroma1.it Sun Mar 4 16:03:02 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Sun, 4 Mar 2007 22:03:02 +0100
Subject: [webgen-users] Maruku + webgen - access to meta-information from
content converter
Message-ID:
Hi!
I am the author of Maruku (http://maruku.rubyforge.org/), a
Markdown-superset interpreter.
At the moment I am
1) learning webgen
2) integrating Maruku+webgen
3) converting my website to webgen,
so I have many questions (one question, one message).
First one: I wrote the straightforward maruku.rb converter (see attachment).
In a content converter, how can I access the meta-information of the page?
Maruku has many configuration options, and I want to take advantage of
webgen's system, so that I can define defaults in config.yaml, etc.
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
From andrea.censi at dis.uniroma1.it Sun Mar 4 16:03:12 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Sun, 4 Mar 2007 22:03:12 +0100
Subject: [webgen-users] Questions about tags
Message-ID:
Two questions about tags:
1) How can I disable tags execution? In my webpage I use a lot of "{"
"}" (LaTeX / Bibtex); also Maruku uses the brackets for uses; plus, I
don't need tags.
2) Is it possible to change the magic characters "{" and "}"? Ok, not
really a question -- the answer is no, I looked at the source code.
If it was possible to customize, I would have used "{wg:" in place of "{".
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
From andrea.censi at dis.uniroma1.it Sun Mar 4 17:08:23 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Sun, 4 Mar 2007 23:08:23 +0100
Subject: [webgen-users] default.template listed in the menu
Message-ID:
I'm not really sure if this is a bug or a feature :-)
If I use in config.yaml:
File/PageHandler:
defaultMetaInfo:
inMenu: true
I get also the file "default.template" listed in the left menu.
(this happens with the repository version)
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
From t_leitner at gmx.at Mon Mar 5 05:07:46 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Mon, 5 Mar 2007 11:07:46 +0100
Subject: [webgen-users] Questions about tags
In-Reply-To:
References:
Message-ID: <8F66F9A8-F9D4-4DCD-A705-39788A9BD4A4@gmx.at>
On 04.03.2007, at 22:03, Andrea Censi wrote:
> Two questions about tags:
>
> 1) How can I disable tags execution? In my webpage I use a lot of "{"
> "}" (LaTeX / Bibtex); also Maruku uses the brackets for uses; plus, I
> don't need tags.
>
Currently it is not possible to disable the processing of webgen tags
globally or page-wise. However, if you prefix a tag with a backslash
webgen does not process it.
> 2) Is it possible to change the magic characters "{" and "}"? Ok, not
> really a question -- the answer is no, I looked at the source code.
>
This is also not possible currently.
However, I could implement an option similar to useERB which enables/
disables webgen tag processing.
Best regards,
Thomas
From t_leitner at gmx.at Mon Mar 5 05:29:32 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Mon, 5 Mar 2007 11:29:32 +0100
Subject: [webgen-users] Maruku + webgen - access to meta-information
from content converter
In-Reply-To:
References:
Message-ID: <287A1E69-30A7-4643-A4B8-73FF5EDE52FA@gmx.at>
Hi,
> At the moment I am
>
> 1) learning webgen
> 2) integrating Maruku+webgen
> 3) converting my website to webgen,
>
> so I have many questions (one question, one message).
I will try to answer all your questions :)
> First one: I wrote the straightforward maruku.rb converter (see
> attachment).
> In a content converter, how can I access the meta-information of
> the page?
>
> Maruku has many configuration options, and I want to take advantage of
> webgen's system, so that I can define defaults in config.yaml, etc.
A content converter in webgen is just a piece of code which takes a
string and converts it to HTML. Therefore it can not only be used by
the class handling files in WebPage Format but also everywhere else.
However, this also means that it does not know of the concept of a
page file. So it cannot access the meta-information of the page.
However, changing the content converters to take an optional argument
with an options hash should not be too hard. Then the value of the
meta information key contentOptions (any better naming ideas?) could
be passed to the content converter.
Bye,
Thomas
From t_leitner at gmx.at Mon Mar 5 05:33:16 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Mon, 5 Mar 2007 11:33:16 +0100
Subject: [webgen-users] default.template listed in the menu
In-Reply-To:
References:
Message-ID: <482FCCAE-CDBF-435A-B29D-CBCA935BA51F@gmx.at>
> I'm not really sure if this is a bug or a feature :-)
>
> If I use in config.yaml:
>
> File/PageHandler:
> defaultMetaInfo:
> inMenu: true
>
> I get also the file "default.template" listed in the left menu.
:) More a bug than a feature. The template handler uses the default
meta information set for the File/PageHandler and updates it with its
own default meta information. However, the two should be strictly
separated. I open a bug ticket for this.
Thanks and bye,
Thomas
From andrea.censi at dis.uniroma1.it Mon Mar 5 17:01:37 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Mon, 5 Mar 2007 23:01:37 +0100
Subject: [webgen-users] Creating a simple tag plugin
Message-ID:
I want to create a tag processor that is activated by something like:
{flickr: http://www.flickr.com/photos/censi/232006603/}
(it then downloads from flickr the description of the photo -- look
for example at http://www.dis.uniroma1.it/~acensi/category/sss06.html)
This is my flickr.rb:
load_plugin 'webgen/plugins/tags/tag_processor'
module Tags
class FlickrTag < DefaultTag
param 'url', nil, 'Url of the photo on Flickr.'
register_tag 'flickr'
def process_tag( tag, chain )
url = param( 'url' )
...
end
end
end
I get 'ERROR -- No default mandatory parameter specified for tag
'Tag/Flickr' but set in < ... sss062.page>'
I can't understand what's wrong.
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
From andrea.censi at dis.uniroma1.it Mon Mar 5 17:05:47 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Mon, 5 Mar 2007 23:05:47 +0100
Subject: [webgen-users] Changing the order in the menu for a directory
Message-ID:
I find the file metaconfig.yaml very useful and I use it for setting
the title and order of files.
However, I can't find a way to change the order of a directory.
Consider the file layout:
index.page
dir/sub1.page
I want to choose whether the order in the menu is [index,dir] or [dir, index].
I tried with:
dir/:
orderInfo: 1
or
dir:
orderInfo: 1
or other variations, and I couldn't find a way.
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
From t_leitner at gmx.at Tue Mar 6 05:27:33 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Tue, 6 Mar 2007 11:27:33 +0100
Subject: [webgen-users] Creating a simple tag plugin
In-Reply-To:
References:
Message-ID: <386E1316-E5B6-40E9-95F5-32A803FDFF61@gmx.at>
On 05.03.2007, at 23:01, Andrea Censi wrote:
> I want to create a tag processor that is activated by something like:
>
> {flickr: http://www.flickr.com/photos/censi/232006603/}
>
> (it then downloads from flickr the description of the photo -- look
> for example at http://www.dis.uniroma1.it/~acensi/category/sss06.html)
>
> This is my flickr.rb:
>
> load_plugin 'webgen/plugins/tags/tag_processor'
> module Tags
> class FlickrTag < DefaultTag
> param 'url', nil, 'Url of the photo on Flickr.'
> register_tag 'flickr'
>
> def process_tag( tag, chain )
> url = param( 'url' )
> ...
> end
> end
> end
>
>
> I get 'ERROR -- No default mandatory parameter specified for tag
> 'Tag/Flickr' but set in < ... sss062.page>'
>
> I can't understand what's wrong.
You need to specify which parameter should be used as default
mandatory parameter. webgen normally needs a YAML hash as argument to
a tag, like this {myTag: {option: value, option2: value2}}. However,
as some tags sometimes only have one mandatory parameter (eg. Tag/
Relocatable just needs to know the file it should make relocatable) I
introduced the default mandatory parameter. This parameter always
needs to have a value and can be set by using the shortcut {myTag:
value}.
Just add the following under the "param 'url'..." line:
set_mandatory 'url', true
After that it will work!
Bye,
Thomas
From t_leitner at gmx.at Tue Mar 6 05:32:58 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Tue, 6 Mar 2007 11:32:58 +0100
Subject: [webgen-users] Changing the order in the menu for a directory
In-Reply-To:
References:
Message-ID: <62AD82C0-F12B-46D3-AF48-A81435886A9F@gmx.at>
On 05.03.2007, at 23:05, Andrea Censi wrote:
> I find the file metaconfig.yaml very useful and I use it for setting
> the title and order of files.
>
> However, I can't find a way to change the order of a directory.
> Consider the file layout:
>
> index.page
> dir/sub1.page
>
>
> I want to choose whether the order in the menu is [index,dir] or
> [dir, index].
>
> I tried with:
>
> dir/:
> orderInfo: 1
>
> or
>
> dir:
> orderInfo: 1
>
> or other variations, and I couldn't find a way.
When using orderInfo, you need to set it for all menu items (default
orderInfo is 0). For example
index.page:
orderInfo: 1
dir/:
orderInfo: 2
This works! Be sure to name the metainfo.yaml and not metaconfig.yaml!
Bye,
Thomas
From ml at vecernik.at Tue Mar 6 05:58:20 2007
From: ml at vecernik.at (Oliver =?utf-8?q?Ve=C4=8Dernik?=)
Date: Tue, 6 Mar 2007 11:58:20 +0100
Subject: [webgen-users] photo_gallery
Message-ID: <200703061158.20298.ml@vecernik.at>
Hi,
I'm trying to build the photo_gallery (example), but receive the following
error:
$ webgen
/home/ov/work/photo_gallery/plugin/collage.rb:90:in `load_plugin':
uninitialized constant #::Collage::FileHandlers
(NameError)
? ? ? ?
from /usr/lib/ruby/gems/1.8/gems/webgen-0.4.2/lib/webgen/plugin.rb:224:in
`load_from_file'
? ? ? ?
from /usr/lib/ruby/gems/1.8/gems/webgen-0.4.2/lib/webgen/plugin.rb:223:in
`catch'
? ? ? ?
from /usr/lib/ruby/gems/1.8/gems/webgen-0.4.2/lib/webgen/plugin.rb:223:in
`load_from_file'
? ? ? ?
from /usr/lib/ruby/gems/1.8/gems/webgen-0.4.2/lib/webgen/plugin.rb:237:in
`load_from_block'
? ? ? ?
from /usr/lib/ruby/gems/1.8/gems/webgen-0.4.2/lib/webgen/plugin.rb:237:in
`catch'
? ? ? ?
from /usr/lib/ruby/gems/1.8/gems/webgen-0.4.2/lib/webgen/plugin.rb:237:in
`load_from_block'
? ? ? ?
from /usr/lib/ruby/gems/1.8/gems/webgen-0.4.2/lib/webgen/plugin.rb:236:in
`catch'
? ? ? ?
from /usr/lib/ruby/gems/1.8/gems/webgen-0.4.2/lib/webgen/plugin.rb:236:in
`load_from_block'
? ? ? ? ?... 11 levels...
? ? ? ? from /usr/lib/ruby/gems/1.8/gems/webgen-0.4.2/lib/webgen/cli.rb:454:in
`cli_main'
? ? ? ? from /usr/lib/ruby/gems/1.8/gems/webgen-0.4.2/bin/webgen:4
? ? ? ? from /usr/bin/webgen:18:in `load'
? ? ? ? from /usr/bin/webgen:18
I'm running this on Gentoo. Is this a known bug, or am I missing something?
--
Cheers,
Oliver
From t_leitner at gmx.at Tue Mar 6 09:13:03 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Tue, 6 Mar 2007 15:13:03 +0100
Subject: [webgen-users] photo_gallery
In-Reply-To: <200703061158.20298.ml@vecernik.at>
References: <200703061158.20298.ml@vecernik.at>
Message-ID: <532A0563-2B46-4390-8290-76F14BA0D025@gmx.at>
Hi Oliver,
> I'm trying to build the photo_gallery (example), but receive the
> following
> error:
>
> $ webgen
> /home/ov/work/photo_gallery/plugin/collage.rb:90:in `load_plugin':
> uninitialized constant #::Collage::FileHandlers
> (NameError)
This is my fault, I did not update the example after releasing webgen
0.4.2. I have uploaded a modified example that actually works.
Thanks for pointing this out!
Bye,
Thomas
From andrea.censi at dis.uniroma1.it Tue Mar 6 13:38:48 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Tue, 6 Mar 2007 19:38:48 +0100
Subject: [webgen-users] I'm crashing my head on this
Message-ID:
I get this error:
ERROR -- Invalid page file
:
Invalid structure of meta information part
on a file that starts with:
---
title: Sample hello page
inMenu: true
---
which is copied from one of the examples.
I attach the whole file.
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: index.page
Type: application/octet-stream
Size: 498 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/webgen-users/attachments/20070306/01239d4e/attachment.obj
From andrea.censi at dis.uniroma1.it Wed Mar 7 05:46:50 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Wed, 7 Mar 2007 11:46:50 +0100
Subject: [webgen-users] I'm crashing my head on this
In-Reply-To: <9FCDEA63-D7AC-47CA-8AEA-8E7C01382739@gmx.at>
References:
<9FCDEA63-D7AC-47CA-8AEA-8E7C01382739@gmx.at>
Message-ID:
On 3/7/07, Thomas Leitner wrote:
> The problem are the line endings. Your file uses Dos/Windows file endings
> which webgen apparently doesn't like...
Yep, that was the problem. Now I want to find out why the file had DOS
line endings, given that I work on a Mac.
> So I will have a look around the Ruby Mailing lists to find out what's best
> to do in this case. If nothing works using (?:\n|\r\n) will surely work.
Or, you could just discard the "\r" (gsub("\r","")) from the whole
file (it's useless!), and then still use "$" which carries more
semantic than (?:\n|\r\n).
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
From andrea.censi at dis.uniroma1.it Fri Mar 9 15:40:34 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Fri, 9 Mar 2007 21:40:34 +0100
Subject: [webgen-users] Transformation order
Message-ID:
I see that the well-defined order for transforming a page to HTML is:
- Transform the content using the content converter
...
- Replace tags
I think it should be the other way around.
I wrote this plugin that transform
{flickr: }
into something like:
Foto, caption, etc.
Now, because of the order of transformations, the content-converter
(bluecloth or maruku) will first transform the tag in:
{flickr: }
and then the tag processor will transform this in
Foto, caption, etc.
So, two questions:
1 - is possible to customize the order of transformations?
2 - I was wondering why did you set this order instead of the other
way around: was there a reason, or was it a random decision? I think
that the other order is much more intuitive.
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
From t_leitner at gmx.at Sat Mar 10 02:14:49 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Sat, 10 Mar 2007 08:14:49 +0100
Subject: [webgen-users] Transformation order
In-Reply-To:
References:
Message-ID: <067E3B82-E45E-4165-B0C2-D640E1F466C5@gmx.at>
On 09.03.2007, at 21:40, Andrea Censi wrote:
> I see that the well-defined order for transforming a page to HTML is:
> - Transform the content using the content converter
> ...
> - Replace tags
>
> I think it should be the other way around.
>
> I wrote this plugin that transform
>
> {flickr: }
>
> into something like:
>
> Foto, caption, etc.
>
>
> Now, because of the order of transformations, the content-converter
> (bluecloth or maruku) will first transform the tag in:
>
> {flickr: }
>
> and then the tag processor will transform this in
>
> Foto, caption, etc.
>
>
> So, two questions:
> 1 - is possible to customize the order of transformations?
> 2 - I was wondering why did you set this order instead of the other
> way around: was there a reason, or was it a random decision? I think
> that the other order is much more intuitive.
There are always trade-offs involved. I thought long about the pros
and cons of the current transformation order. Some reasons I chose
this one:
* The tag plugins know what to output, namely pure HTML. If
converting a page file to HTML after replacing tags, it depends on
the content converter to the right thing with the embedded HTML. If
the page file is converted to HTML first, replacing the tags with
pure HTML is easy. Same is true for ERB output.
* And generally: after reading a page file, it is automatically
converted to HTML. Therefore all plugins working with the page file
can be assured that can work on HTML.
* The in-page menu only works because of this ordering. After reading
in a page file, it is converted to HTML and then all header elementes
h1, h2, ... with id="..." are searched for and fragment nodes for
each such element are generated. This would not be possible without
transforming the page to HTML.
I know that this transformation order is not perfect but it turned
out to be the best viable solution for me. However, I'm open for
other/better suggestions concerning the transformation pipeline. One
major reason for choosing this particular order was the ability to
use in-page menus afterwards and this should be possible with another
order, too!
Currently it is not possible to customize the order of
transformations. Maybe this will be possible in the next bigger
release (0.5.0 - which is also worked on already, more to that later
on webgen-users). Your problem with the additional ...
tags
can be overcome, for example with Textile markup, by specifying that
some parts should not be formatted by Textile using the
... tags. I don't know if something like this
exists for Markdown or Maruku.
Bye,
Thomas
From andrea.censi at dis.uniroma1.it Sun Mar 11 09:29:49 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Sun, 11 Mar 2007 14:29:49 +0100
Subject: [webgen-users] Transformation order
In-Reply-To: <067E3B82-E45E-4165-B0C2-D640E1F466C5@gmx.at>
References:
<067E3B82-E45E-4165-B0C2-D640E1F466C5@gmx.at>
Message-ID:
> There are always trade-offs involved.
Of course.
> Currently it is not possible to customize the order of
> transformations.
Or, maybe a little less: give each processor a flag that tell webgen
to run it before or after the content converter.
> Maybe this will be possible in the next bigger
> release
... which includes extensive blogging support?
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
From andrea.censi at dis.uniroma1.it Sun Mar 11 11:20:24 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Sun, 11 Mar 2007 16:20:24 +0100
Subject: [webgen-users] Two questions about menus
Message-ID:
1) Feature request: the possibility to indicate a "short title" to
appear in the menu when the title would be too long.
2) Consider this site:
a.page
misc/
sub.page
Now I see in the menu:
A
Misc
| Sub
Is there any way to change "Misc" to an arbitrary string?
I tried with
misc:
title: arbitrary
with no luck.
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
From t_leitner at gmx.at Sun Mar 11 12:07:45 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Sun, 11 Mar 2007 17:07:45 +0100
Subject: [webgen-users] Two questions about menus
In-Reply-To:
References:
Message-ID:
On 11.03.2007, at 16:20, Andrea Censi wrote:
> 1) Feature request: the possibility to indicate a "short title" to
> appear in the menu when the title would be too long.
Hmm... you can try this in your page file:
---
title: This is my rather long title I wished was shorter
linkAttrs:
:link_text: Short Title
---
My content.
> 2) Consider this site:
>
> a.page
> misc/
> sub.page
>
> Now I see in the menu:
>
> A
> Misc
> | Sub
>
> Is there any way to change "Misc" to an arbitrary string?
>
> I tried with
>
> misc:
> title: arbitrary
>
> with no luck.
If you have a directory index file, then it's easy: just specify a
meta info called directoryName - this is then used as localized
directory name.
Or: put the following in the OUTPUT backing section of your meta info
backing file:
misc:
title: arbitrary
However, using this way the directory name cannot be localized.
Bye,
Thomas
From andrea.censi at dis.uniroma1.it Sun Mar 11 12:48:20 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Sun, 11 Mar 2007 17:48:20 +0100
Subject: [webgen-users] Tag plugin for writing META elements
Message-ID:
I like (and Google likes it too) that each page has a different description.
Use the tag {metainfo: } in your , and add the
"description","author","keywords" fields to the pages' metainfo.
---
title: Title for the page
description: Description for this page.
keywords: example, plugin, input
---
Content
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: metainfo.rb
Type: application/octet-stream
Size: 656 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/webgen-users/attachments/20070311/d0f04382/attachment.obj
From t_leitner at gmx.at Sat Mar 17 03:25:58 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Sat, 17 Mar 2007 08:25:58 +0100
Subject: [webgen-users] Transformation order
In-Reply-To:
References:
<067E3B82-E45E-4165-B0C2-D640E1F466C5@gmx.at>
Message-ID:
On 11.03.2007, at 14:29, Andrea Censi wrote:
>> There are always trade-offs involved.
>
> Of course.
>
>> Currently it is not possible to customize the order of
>> transformations.
>
> Or, maybe a little less: give each processor a flag that tell webgen
> to run it before or after the content converter.
>
>> Maybe this will be possible in the next bigger
>> release
>
> ... which includes extensive blogging support?
There is already a plugin in the feature request tracker (created by
Fritz Heinrichmeyer) which provides blogging and rss support
(although for webgen 0.3.8). Based on this and comments of other
people I have taken notes so as to what one would expect from such a
plugin and when I have enough time I will post them to this mailing
list for further discussion!
Bye,
Thomas
From andrea.censi at dis.uniroma1.it Sat Mar 17 12:37:01 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Sat, 17 Mar 2007 17:37:01 +0100
Subject: [webgen-users] Webgen and incremental generation (nukumi2 did it)
Message-ID:
> There is already a plugin in the feature request tracker (created by
> Fritz Heinrichmeyer) which provides blogging and rss support
> (although for webgen 0.3.8). Based on this and comments of other
> people I have taken notes so as to what one would expect from such a
> plugin and when I have enough time I will post them to this mailing
> list for further discussion!
I add one feature request:
How about incremental generation?
On my Powerbook G4, webgen takes 4 seconds for generating a site with
32 pages. I don't really care about the speed (it's ruby after all),
but it should have the right complexity -- i.e. if I write a post a
day, after 100 days, it should not take 100 times more than the first
day.
The program I used before webgen is nukumi2:
http://chneukirchen.org/blog/static/projects/nukumi2.html
which I left because it's not actively developed.
One cool thing about nukumi2 is that each regeneration only
regenerates the minimum set of files, and it seemed very smart.
So I CCed this to Chris, nukumi2's author, maybe he can share its
experience about how to implement incremental generation: myself, I
can only think of naive ways, when there probably is a very good
solution.
Cheers,
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
From mailing_lists at railsnewbie.com Fri Mar 30 04:00:04 2007
From: mailing_lists at railsnewbie.com (Scott Taylor)
Date: Fri, 30 Mar 2007 04:00:04 -0400
Subject: [webgen-users] Adding html tags to a template
Message-ID:
Would I be able to add custom html tags to a template, such that they
are parsed by a plugin? If so, could you give some guidelines?
Thanks,
Scott Taylor
From chneukirchen at gmail.com Sat Mar 17 15:08:48 2007
From: chneukirchen at gmail.com (Christian Neukirchen)
Date: Sat, 17 Mar 2007 20:08:48 +0100
Subject: [webgen-users] Webgen and incremental generation (nukumi2 did
it)
In-Reply-To:
(Andrea Censi's message of "Sat, 17 Mar 2007 17:37:01 +0100")
References:
Message-ID:
"Andrea Censi" writes:
> One cool thing about nukumi2 is that each regeneration only
> regenerates the minimum set of files, and it seemed very smart.
>
> So I CCed this to Chris, nukumi2's author, maybe he can share its
> experience about how to implement incremental generation: myself, I
> can only think of naive ways, when there probably is a very good
> solution.
Hehe. It's not that clever, but let me explain it.
Nukumi2 constructs a tree that describes which source files map to
which target files (blog entries -> front page, archive page, etc.) I
look at the mtimes of all target files, and the mtimes of all source
files, and then regenerate the targets which contain newer parts.
Due to the general aspect of Nukumi2, and the rather complex data
structure below it, this turns a bit hairy, but I think for webgen
this approach should be easy to do. It works a lot like make.
I currently run into scaling problems regarding the set of data to be
published, since it needs to read all entries at the moment, and
Anarchaia has about 700 entries by now that are read from disk
everytime. I'll probably move to dynamic publishing in the future.
--
Christian Neukirchen http://chneukirchen.org
From t_leitner at gmx.at Fri Mar 30 06:41:37 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Fri, 30 Mar 2007 12:41:37 +0200
Subject: [webgen-users] Adding html tags to a template
In-Reply-To:
References:
Message-ID: <34266486-1325-4630-B4DF-E20D2A0F9373@gmx.at>
> Would I be able to add custom html tags to a template, such that they
> are parsed by a plugin? If so, could you give some guidelines?
There is currently no way to add custom html tags. However, you can
use the webgen tag system for this. You need to write a tag plugin
that responds to a given tag name. Have a look at the plugins shipped
with webgen for how to do this.
Bye,
Thomas
From t_leitner at gmx.at Fri Mar 30 09:14:59 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Fri, 30 Mar 2007 15:14:59 +0200
Subject: [webgen-users] Current status of webgen 0.4.3 and 0.5.0 (new plugin
system)
Message-ID:
Hi everybody!
As the easter holidays have now finally arrived and all the exams are
over, I will have more time for webgen again!
Summary
=======
* Changes included in the upcoming 0.4.3 release
* webgen repository
* Status on 0.5.0
* Detailed information on the new 0.5.0 plugin system
Changes for 0.4.3
-----------------
I have collected all mails/forum entries/ML postings in which bugs
were reported, features requested, patches submitted, ... However, I
did not have time to make changes to the repository till now. So,
here is a small list of changes for the upcoming 0.4.3 release:
* Include plugins by Andrea Censi (a metainfo and a flickr tag plugin)
* Add the parameters from MenuStyle/Vertical to MenuStyle/Horizontal
* Normalize EOL to \n so that page files with any EOL encoding work
properly
* Change the way webgen locates it's data directory (first local,
then /usr/share/webgen - add info log message with used data dir)
* File/TemplateHandler gets its own set of metainfo and will not use
File/PageHandler metainfo anymore
* Update examples/templates to now use Textile sothat they work out
of the box
* Plain website style will be removed due to incompatible license
* Add the possibility to add a prefix to webgen tags sothat the look
like {wg:menu:} or {webgen:relocatable: default.css}
If you have any comments or suggestions regarding the list above:
please tell me! :)
webgen repository
-----------------
Andrea Censi asked if it's possible to have repository access for
webgen. Since I develop webgen mainly on my laptop using subversion I
needed the possibility to make local check-ins which would not be
possible with the subversion repository hosted on Rubyforge. However,
Andrea was so kind to point me to SVK which solves this dilemma.
Therefore, Rubyforge hosts the main webgen repository now with
anonymous read access!
You can access via the following URL: svn://rubyforge.org/var/svn/webgen
Development version 0.5.0
-------------------------
Since the initial release of webgen 0.4.0 I started working on the
next generation release of webgen, 0.5.0. This release will feature,
you may believe it or not ;-), an entirely new plugin system! This
may not come as a surprise for those of you who watched webgen
develop over time since each major release included a new way of
handling plugins.
Why a new plugins system, again? Well, the current one works fine,
but has some limitations which the new one addresses:
* all plugins are loaded at the start
* no way for plugins to provide resources
* no way for coherent plugin documentation
* plugins must be derived from certain base classes
* problems with modules and constant name resolution
The new plugin system addresses all of the above issues and provides:
* on-demand loading of plugins the first time they are accessed
* coherent way to specify documentation for a plugin
* the possibility to provide resources
* any class can be a plugin, only prerequisite is that the
constructor takes no argument
* easy bundling/sharing of plugins
Those who got interested can view the current development version of
webgen in the repository: svn://rubyforge.org/var/svn/webgen/devel
and/or read on to get more detailed information.
As plugins are loaded on demand, the webgen CLI command gets faster
since only the CLI plugins need to be loaded (currently all plugins
are loaded, including their dependencies).
Currently, the plugin system itself works and I have already ported
some plugins to test the new infrastructure.
Other things planned for webgen 0.5.0:
* possibility to localize any file in the src directory
* blogging support (yeah, I know, already said that for 0.4.0)
Again: if anyone has comments/suggestions/critics, don't hesistate to
tell me!
webgen 0.5.0 plugin system
--------------------------
Prior to webgen 0.5.0 plugins were just Ruby files. This changes in
0.5.0 with the concept of a plugin bundle.
A plugin bundle is a directory containing plugins and their
resources. Consider the following:
websitemanager.plugin/
websitemanager.plugin/plugin.yaml
websitemanager.plugin/manager.rb
websitemanager.plugin/util.rb
websitemanager.plugin/resource.yaml
websitemanager.plugin/resources/templates/...
The file plugin.yaml contains information about the plugins in the
bundle and looks like this:
Support/WebsiteManager:
about:
summary: Provides methods for working with website directories.
author: Thomas Leitner
plugin:
file: manager.rb
docufile: manager.documentation
params:
sample:
default: output
desc: A sample parameter.
Support/Utils:
about:
summary: Provides utils methods
author: Thomas Leitner
plugin:
file: util.rb
As you can see, it's a YAML file containing hashes with information
about the plugins. The about section should contain informational
items about the plugin, like the author or a short description. The
plugin section contains information about the plugin, like the file
where the plugin is defined, the class name of the plugin and
dependencies. Last but not least, the params section contains
information about plugin parameters. Nothing really complicated here!
So, all the information formerly defined using class methods is now
defined in plugin.yaml. Therefore, all this information is available
to the plugin system prior to loading any Ruby source file (and its
dependencies).
A plugin bundle need not have a plugin.yaml file. If no such file
exists, it is assumed that the bundle does not contain any plugins.
The resource.yaml is also optional and in it, all resources of the
bundle are defined. A sample resource.yaml looks like this:
resources/templates/*/:
name: webgen/website/template/$basename
resources/styles/*/*/:
name: webgen/website/style/$dir1/$basename
Again, a YAML file whose keys are file globs that can be handled by
Dir.glob. For each file matching a specific glob, the information
associated with the glob is associated with the resource. Notice:
some variables in the form $VARNAME, like $basename, can be used. For
example, each directory under resources/templates/ is matched by the
first glob and the name for the resource is set to webgen/website/
template/$basename where $basename evaluates to File.basename
( file ). This allows the definition of several resources with just
one glob.
Each plugin defined in a plugin bundle can define a documentation
file. This file should be in Markdown markup because this markup is
easy to read in textual form and it's easy to generate HTML output. I
don't know if Markdown is the right choice for this or if Textile/
RDoc is better - any comments on this???
Existing plugins can be easily translated to the new system: just
define all static information in plugin.yaml and make sure that the
initialize method of the plugin does not need any parameters!
So, how does the plugin system itself work?
First you need to load all plugin bundles you want to be available to
the program. After that the plugin system loads a plugin the first
time it is accessed. Before the plugin itself gets loaded, all its
dependencies are loaded to make sure everything works fine. If a
dependency is not available an error is raised. Loading of a plugin
is done by just evaluating the file for the plugin in a module (every
plugin file gets evaluated in the same module) and then an instance
of the plugin class is created and added to the plugin pool. After
the instance is created a module is mixed into the instance so that
the plugin has access to the plugin manager and the parameters, like
in 0.4.x releases. Therefore any class can act as a plugin!
There is nearly nothing webgen specific in the plugin system now and
it should be possible for other programs to use this plugin system as
well. My question is: should this be possible? Does anyone need an
out-of-the-box plugin system?
That's all for now! Just one more thing: I will have a guide for
creating plugins in 0.5.0 available when it is released since this
was one of the most critized points in the 0.4.x releases!
Bye,
Thomas
From gaspa at yattaweb.it Fri Mar 30 12:13:59 2007
From: gaspa at yattaweb.it (Andrea Gasparini)
Date: Fri, 30 Mar 2007 18:13:59 +0200
Subject: [webgen-users] gallery issue...
Message-ID: <200703301813.59609.gaspa@yattaweb.it>
Hi,
i'm new of both webgen and ruby, so maybe this can be a dumb question, but
i can't recognize any solution by myself.
I use webgen 0.4.1 (the newest webgen .deb package).
I'm trying to make a test gallery, without succeeding in it.
i done (ehm, copied) the yeah.gallery file in the root directory:
1 title: Example Gallery
2 imagesPerPage: 32
3 images: gallery/*.jpg
4
5 mainPageMetaInfo:
6 inMenu: true
7 otherKey: value
8
9 galleryPagesMetaInfo:
10 orderInfo: 10
11 inMenu: true
12 ---
13 gallery/frate.jpg:
14 title: Test title
15 description: Long description of image
16
17 gallery/gas01.jpg:
18 title: Title2 of pic
19 mykey: mydata
of course i have a directory gallery/ with some pictures...
but it makes only empty pages: it creates them, but empty page.
any ideas?
thanks, bye!
--
-gaspa-
-----------------------------------------------
--------- Powered by Debian GNU/Linux ---------
-Il lunedi'dell'arrampicatore: www.lunedi.org -
From andrea.censi at dis.uniroma1.it Fri Mar 30 13:17:54 2007
From: andrea.censi at dis.uniroma1.it (Andrea Censi)
Date: Fri, 30 Mar 2007 19:17:54 +0200
Subject: [webgen-users] Current status of webgen 0.4.3 and 0.5.0 (new
plugin system)
In-Reply-To:
References:
Message-ID:
> * Include plugins by Andrea Censi (a metainfo and a flickr tag plugin)
What about Maruku's content converter plugin?
> * blogging support (yeah, I know, already said that for 0.4.0)
I am faithfully waiting!
--
Andrea Censi
"Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
From t_leitner at gmx.at Fri Mar 30 14:58:06 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Fri, 30 Mar 2007 20:58:06 +0200
Subject: [webgen-users] Current status of webgen 0.4.3 and 0.5.0 (new
plugin system)
In-Reply-To:
References:
Message-ID:
>> * Include plugins by Andrea Censi (a metainfo and a flickr tag
>> plugin)
>
> What about Maruku's content converter plugin?
Yeah, sorry that I missed that when going over the mails: will also
be included!
From t_leitner at gmx.at Fri Mar 30 15:12:32 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Fri, 30 Mar 2007 21:12:32 +0200
Subject: [webgen-users] gallery issue...
In-Reply-To: <200703301813.59609.gaspa@yattaweb.it>
References: <200703301813.59609.gaspa@yattaweb.it>
Message-ID: <1133D88E-A1E6-4CE8-9096-9AA9C08C7E09@gmx.at>
> i'm new of both webgen and ruby, so maybe this can be a dumb
> question, but
> i can't recognize any solution by myself.
My teachers always said: there are no dumb question, only dumb
answers :) So, just ask anything and I will try to answer it!
> I use webgen 0.4.1 (the newest webgen .deb package).
> I'm trying to make a test gallery, without succeeding in it.
> i done (ehm, copied) the yeah.gallery file in the root directory:
>
> 1 title: Example Gallery
> 2 imagesPerPage: 32
> 3 images: gallery/*.jpg
> 4
> 5 mainPageMetaInfo:
> 6 inMenu: true
> 7 otherKey: value
> 8
> 9 galleryPagesMetaInfo:
> 10 orderInfo: 10
> 11 inMenu: true
> 12 ---
> 13 gallery/frate.jpg:
> 14 title: Test title
> 15 description: Long description of image
> 16
> 17 gallery/gas01.jpg:
> 18 title: Title2 of pic
> 19 mykey: mydata
Okay, do you have files called gallery_main.template,
gallery_gallery.template and gallery_image.template in your src/
directory? These templates do the actual rendering of a gallery and
can either be created by yourself or you can use a predefined gallery
style by using the command:
webgen use gallery_style
webgen currently ships with two gallery styles: default and slides.
The default style is very simple (useful as basis for creating a more
sophisticated one) and the slides style looks quite nice. Have a look
at http://webgen.rubyforge.org/examples/gallery_styles/index.html to
view sample pages showing them.
Also make sure you have rmagick installed (have a look at the output
of 'webgen check libs')!
Bye,
Thomas
From jeremy at hinegardner.org Fri Mar 30 16:03:07 2007
From: jeremy at hinegardner.org (Jeremy Hinegardner)
Date: Fri, 30 Mar 2007 14:03:07 -0600
Subject: [webgen-users] Current status of webgen 0.4.3 and 0.5.0 (new
plugin system)
In-Reply-To:
References:
Message-ID: <20070330200306.GC8198@hinegardner.org>
On Fri, Mar 30, 2007 at 03:14:59PM +0200, Thomas Leitner wrote:
> * blogging support (yeah, I know, already said that for 0.4.0)
I don't know if it will help, but I created a 'news' tag that I use for
a my keybox site. Makes it pretty easy to have news release or blog
type content. You can see its usage in the sidebar of
keybox.rubyforge.org and on the news page
http://keybox.rubyforge.org/news.html
I've happily donated it to webgen. Its now uploaded to the Feature
Requests tracker and can be found there.
Feature Request: http://rubyforge.org/tracker/index.php?func=detail&aid=9707&group_id=296&atid=1210
Download link: http://rubyforge.org/tracker/download.php/296/1210/9707/1709/news.rb
enjoy,
-jeremy
--
========================================================================
Jeremy Hinegardner jeremy at hinegardner.org
From mailing_lists at railsnewbie.com Fri Mar 30 23:45:02 2007
From: mailing_lists at railsnewbie.com (Scott Taylor)
Date: Fri, 30 Mar 2007 23:45:02 -0400
Subject: [webgen-users] Adding html tags to a template
Message-ID: <17142FCF-E911-474C-9BE9-EF84334D76B4@railsnewbie.com>
How about writing a content converter plugin? Or how about reopening
the class which deals with the block: tag to first parse any custom
html tags, and then hand off execution as normal?
Thanks,
Scott
From t_leitner at gmx.at Sat Mar 31 03:45:49 2007
From: t_leitner at gmx.at (Thomas Leitner)
Date: Sat, 31 Mar 2007 09:45:49 +0200
Subject: [webgen-users] Current status of webgen 0.4.3 and 0.5.0 (new
plugin system)
In-Reply-To: <20070330200306.GC8198@hinegardner.org>
References:
<20070330200306.GC8198@hinegardner.org>
Message-ID: <5947D7C4-35F0-41E4-BF6B-A6EFCBA34E92@gmx.at>
> On Fri, Mar 30, 2007 at 03:14:59PM +0200, Thomas Leitner wrote:
>> * blogging support (yeah, I know, already said that for 0.4.0)
>
> I don't know if it will help, but I created a 'news' tag that I use
> for
> a my keybox site. Makes it pretty easy to have news release or blog
> type content. You can see its usage in the sidebar of
> keybox.rubyforge.org and on the news page
>
> http://keybox.rubyforge.org/news.html
>
> I've happily donated it to webgen. Its now uploaded to the Feature
> Requests tracker and can be found there.
>
> Feature Request: http://rubyforge.org/tracker/index.php?
> func=detail&aid=9707&group_id=296&atid=1210
> Download link: http://rubyforge.org/tracker/download.php/
> 296/1210/9707/1709/news.rb
>
> enjoy,
Thanks, Jeremy! Will be included in the next release!
Bye,
Thomas