From stian at fsfeurope.org Thu Mar 12 09:39:25 2009 From: stian at fsfeurope.org (Stian =?utf-8?q?R=C3=B8dven_Eide?=) Date: Thu, 12 Mar 2009 14:39:25 +0100 Subject: [webgen-users] Sections (footer) Message-ID: <200903121439.25944.stian@fsfeurope.org> Hi, On pdfreaders.org, the footer is entered as a separate section in every .page- file. Ideally, we'd like to have the footer, with all translations, in a separate file instead. The correct footer should then be fetched automatically, according to a priority list (i.e. if the Swedish footer is missing it fetches the Norwegian one, rather than the English one). Is this possible? all the best, /Stian From tuomov at iki.fi Thu Mar 12 13:42:34 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Thu, 12 Mar 2009 17:42:34 +0000 (UTC) Subject: [webgen-users] Markdown support? Message-ID: I've considered switching from Ikiwiki to Webgen, particularly because the former doesn't work under Cygwin. There's a problem, however: Webgen doesn't seem to support proper markdown syntax. In particular, Maruku seems to require (bullet) lists to be unintended, which makes for extra conversion work and unreadable plain text documents. (I have READMEs and such in markdown syntax that I convert for the Web. They sould be readable as plain text.) Changing the processing pipeline to mention markdown doesn't help. Is it possible to use a real markdown engine? -- Stop Gnomes and other pests! Purchase Windows today! From thewoolleyman at gmail.com Thu Mar 12 20:25:02 2009 From: thewoolleyman at gmail.com (Chad Woolley) Date: Thu, 12 Mar 2009 17:25:02 -0700 Subject: [webgen-users] Markdown support? In-Reply-To: References: Message-ID: I know what you mean. I tried to switch to Maruku, failed horribly, wasted a lot of time, and finally stuck with RedCloth. -- Chad On Thu, Mar 12, 2009 at 10:42 AM, Tuomo Valkonen wrote: > > I've considered switching from Ikiwiki to Webgen, particularly > because the former doesn't work under Cygwin. There's a problem, > however: Webgen doesn't seem to support proper markdown syntax. > In particular, Maruku seems to require (bullet) lists to be > unintended, which makes for extra conversion work and unreadable > plain text documents. (I have READMEs and such in markdown syntax > that I convert for the Web. They sould be readable as plain text.) > Changing the processing pipeline to mention markdown doesn't help. > > Is it possible to use a real markdown engine? > > -- > Stop Gnomes and other pests! Purchase Windows today! > > _______________________________________________ > webgen-users mailing list > webgen-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/webgen-users > From tuomov at iki.fi Thu Mar 12 21:07:17 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Fri, 13 Mar 2009 01:07:17 +0000 (UTC) Subject: [webgen-users] Markdown support? References: Message-ID: On 2009-03-13, Chad Woolley wrote: > I know what you mean. I tried to switch to Maruku, failed horribly, > wasted a lot of time, and finally stuck with RedCloth. I actually seem to have found the solution: rdiscount. It renders my pages mostly allright. Now, all I need is an 'inline' extension for collecting FAQ items and news on a single page... Or maybe there's another solution? (Feeds wanted as well:) -- "[Fashion] is usually a form of ugliness so intolerable that we have to alter it every six months." -- Oscar Wilde "The computer industry is the only industry that is more fashion-driven than women's fashion." -- RMS From t_leitner at gmx.at Fri Mar 13 02:47:42 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Fri, 13 Mar 2009 07:47:42 +0100 Subject: [webgen-users] Markdown support? In-Reply-To: References: Message-ID: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> Am Fri, 13 Mar 2009 01:07:17 +0000 (UTC) schrieb Tuomo Valkonen : > On 2009-03-13, Chad Woolley wrote: > > I know what you mean. I tried to switch to Maruku, failed horribly, > > wasted a lot of time, and finally stuck with RedCloth. > > I actually seem to have found the solution: rdiscount. > It renders my pages mostly allright. Now, all I need > is an 'inline' extension for collecting FAQ items and > news on a single page... Or maybe there's another > solution? (Feeds wanted as well:) RDiscount is a Markdown-only parser but does not have the extensions provided by Maruku. However, it is definitly the fastest option! And it complies with the Markdown rules set by the original Markdown implementation. So I would go for it! Regarding the FAQ items: if I should help you, I need a little bit more information on how the FAQ items are structured etc. RSS feed generation is possible with webgen - see the documentation! Some thoughts on Markdown/Textile: I find it rather peculiar that there is only one Textile library for Ruby but that there are several Markdown libraries (BlueCloth, Maruku, RDiscount, and maybe some more). I think that this is also because of some people being not satisfied with the default Markdown syntax - I certainly really like the basic set of Markdown syntax but it lacks essential things like assigning header IDs. This is possible with extensions pioneered by PHP Markdown Extra and implement in Maruku. And this is the reason for Maruku being the default markup converter in webgen. However, since Maruku itself isn't perfect and there are not definite rules for the translation of Markdown syntax (and the extra syntax) to HTML, I have started to implement my own Markdown+Extras parsing/converting library. It will become the default converter for webgen once it has all the needed features. The main aspects of kramdown, the name of this new library, are: * Based on the basic Markdown syntax but with definite rules stating what happens in every possible situation. Therefore the output of kramdown may be slightly different to that of rdiscount or any other 'conforming' Markdown converter. The upside is that you know the outcome when you write the markup - you don't have to test various possibilities! * Support for extras like automatic creation of header IDs, fenced code blocks, Markdown inside HTML, foot notes etc. * Fast. In current benchmarks it is around 3 to 4 times faster than Maruku on Ruby 1.8. It is still 20x slower than rdiscount but provides more features. * Since it creates an internal representation like Maruku, it is possible to create other output formats in the future or manipulate the representation before converting to an output format. Most features are already implemented, I still need to fix some minor issues with the HTML parsing part. So maybe kramdown will become a viable alternative to Maruku and/or RedCloth ;-) -- Thomas From tuomov at iki.fi Fri Mar 13 03:50:19 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Fri, 13 Mar 2009 07:50:19 +0000 (UTC) Subject: [webgen-users] Markdown support? References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> Message-ID: On 2009-03-13, Thomas Leitner wrote: > RDiscount is a Markdown-only parser but does not have the extensions > provided by Maruku. However, it is definitly the fastest option! And it > complies with the Markdown rules set by the original Markdown > implementation. So I would go for it! Actually, I'm not sure I want the extensions. I haven't looked at them in detail yet, but one of the reasons I like markdown is that it's the lightest of the "ASCII markup" language in syntax. I don't like dodging a gazillion cases of special-case syntax everywhere, as most of these languages have. > Regarding the FAQ items: if I should help you, I need a little bit more > information on how the FAQ items are structured etc. RSS feed > generation is possible with webgen - see the documentation! It's the Ion homepage http://iki.fi/tuomov/ion/faq.html, currently using Ikiwiki's 'inline' plugin to generate both feeds and pages containing full file contents and listings. I have individual FAQ entries in faq/entries/*.mdwn. These are fully included in faq/some_tag.mdwn based on tags set in the entry files themselves, as well as listed by heading in 'faq/entries.mdwn' that also generates a feed. (The old version of Ikiwiki I've been using doesn't support index.html.) I don't necessarily need the tagging part. At minimum I need a way to list all the entries by title; basically an additional menu. For the news page, it would be very nice to be able to inline the contents. Perhaps even tagging could be implemented by support for multiple menus, and 'in_menu: bugs, features' -- just one possibility, probably not the best. This is really all part of the planned blog features... -- Stop Gnomes and other pests! Purchase Windows today! From t_leitner at gmx.at Fri Mar 13 05:55:39 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Fri, 13 Mar 2009 10:55:39 +0100 Subject: [webgen-users] Sections (footer) In-Reply-To: <200903121439.25944.stian@fsfeurope.org> References: <200903121439.25944.stian@fsfeurope.org> Message-ID: <20090313105539.6fb16a04@77.118.56.134.wireless.dyn.drei.com> > On pdfreaders.org, the footer is entered as a separate section in > every .page- file. > > Ideally, we'd like to have the footer, with all translations, in a > separate file instead. > > The correct footer should then be fetched automatically, according to > a priority list (i.e. if the Swedish footer is missing it fetches the > Norwegian one, rather than the English one). > > Is this possible? Certainly. I assume you have the following or a similar layout: src/ src/default.template src/footer.en.template src/footer.de.template src/footer.nb.template src/index.de.page src/index.en.page src/index.sv.page One src/footer.??.template file for each language you have. Then you can put the following into your src/default.template where the footer should be included: <% languages = case context.content_node.lang when 'de' then ['de'] when 'en' then ['en'] when 'sv' then ['sv', 'nb'] when 'nb' then ['nb'] end used_node = languages.map {|l| context.content_node.tree["/footer.#{l}.template"]}.compact.first if used_node %> <% end %> The result is that the english footer is used in the english index page, the german footer in the german index page and the norwegian (nb) footer in the swedish index page. The only thing you have to adjust now are the preferences for each language (in the case statement of the ERB code). Let me know if you need further help! -- Thomas From t_leitner at gmx.at Fri Mar 13 06:15:09 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Fri, 13 Mar 2009 11:15:09 +0100 Subject: [webgen-users] Markdown support? In-Reply-To: References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> Message-ID: <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> Am Fri, 13 Mar 2009 07:50:19 +0000 (UTC) schrieb Tuomo Valkonen : > On 2009-03-13, Thomas Leitner wrote: > > RDiscount is a Markdown-only parser but does not have the extensions > > provided by Maruku. However, it is definitly the fastest option! > > And it complies with the Markdown rules set by the original Markdown > > implementation. So I would go for it! > > Actually, I'm not sure I want the extensions. I haven't looked at > them in detail yet, but one of the reasons I like markdown is that > it's the lightest of the "ASCII markup" language in syntax. I don't > like dodging a gazillion cases of special-case syntax everywhere, > as most of these languages have. Kramdown will let you choose the used block and span level parsers. For example, you could select to use foot notes but not use fenced code blocks. > > Regarding the FAQ items: if I should help you, I need a little bit > > more information on how the FAQ items are structured etc. RSS feed > > generation is possible with webgen - see the documentation! > > It's the Ion homepage http://iki.fi/tuomov/ion/faq.html, currently > using Ikiwiki's 'inline' plugin to generate both feeds and pages > containing full file contents and listings. > > I have individual FAQ entries in faq/entries/*.mdwn. These > are fully included in faq/some_tag.mdwn based on tags set > in the entry files themselves, as well as listed by heading > in 'faq/entries.mdwn' that also generates a feed. > (The old version of Ikiwiki I've been using doesn't support > index.html.) This could be done by using a meta information tags in the faq/entries/*.mdwn files and having a small ERB code fragment in faq/some_tag.mdwn which selects only those files in faq/entries/*.mdwn that have a certain tag set. Feed generation should be no problem. > I don't necessarily need the tagging part. At minimum I > need a way to list all the entries by title; basically > an additional menu. For the news page, it would be very > nice to be able to inline the contents. As I said above, a small ERB fragment can be used to list the entries by title, description, ... Inlining content can be done by using the tag with a dynamically generated chain attribute, eg. where `entry` refers to the node of the currently processed faq entry. -- Thomas From stian at fsfeurope.org Fri Mar 13 07:30:10 2009 From: stian at fsfeurope.org (Stian =?iso-8859-1?q?R=F8dven_Eide?=) Date: Fri, 13 Mar 2009 12:30:10 +0100 Subject: [webgen-users] Sections (footer) In-Reply-To: <20090313105539.6fb16a04@77.118.56.134.wireless.dyn.drei.com> References: <200903121439.25944.stian@fsfeurope.org> <20090313105539.6fb16a04@77.118.56.134.wireless.dyn.drei.com> Message-ID: <200903131230.10612.stian@fsfeurope.org> From Thomas Leitner, 2009-03-13: [...] > The result is that the english footer is used in the english index > page, the german footer in the german index page and the norwegian (nb) > footer in the swedish index page. > > The only thing you have to adjust now are the preferences for each > language (in the case statement of the ERB code). Thanks Thomas! This is just what we were looking for. all the best, /Stian From tuomov at iki.fi Fri Mar 13 10:52:38 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Fri, 13 Mar 2009 14:52:38 +0000 (UTC) Subject: [webgen-users] Markdown support? References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> Message-ID: On 2009-03-13, Thomas Leitner wrote: > As I said above, a small ERB fragment can be used to list the > entries by title, description, ... Inlining content can be done by > using the tag with a dynamically generated chain > attribute, eg. > > > > where `entry` refers to the node of the currently processed faq entry. Hm... I'd very much prefer an existing extension/tag, or even ready snippet of code, to starting to learn Ruby/ERB/webgen internals at this point in time. (Would be quicker to write a custom shell script hack than something cleaner.) Already wasted too much time on computer/OS switch, and just want to get the site back into a condition where it can be updated. -- Tuomo From rickbbell at gmail.com Wed Mar 18 21:46:58 2009 From: rickbbell at gmail.com (GeoSync) Date: Wed, 18 Mar 2009 18:46:58 -0700 (PDT) Subject: [webgen-users] Problem getting started... Message-ID: <897c0759-1925-40ed-9879-67edae6179d8@v38g2000yqb.googlegroups.com> Webgen is my first Ruby app. So I'm lost... After what seems like a successful installation of webgen-0.5.7, I can't figure out where to do this: webgen create mytestsite Is there a test I can perform to verify webgen's installation. Please start me at the Windows command prompt. Thank you, Rick From t_leitner at gmx.at Fri Mar 20 09:00:23 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Fri, 20 Mar 2009 14:00:23 +0100 Subject: [webgen-users] Problem getting started... In-Reply-To: <897c0759-1925-40ed-9879-67edae6179d8@v38g2000yqb.googlegroups.com> References: <897c0759-1925-40ed-9879-67edae6179d8@v38g2000yqb.googlegroups.com> Message-ID: <20090320140023.446a7267@77.119.8.237.wireless.dyn.drei.com> Hi, > Webgen is my first Ruby app. So I'm lost... > > After what seems like a successful installation of webgen-0.5.7, I > can't figure out where to do this: > > webgen create mytestsite > > Is there a test I can perform to verify webgen's installation. Please > start me at the Windows command prompt. I assume you have installed ruby via the One-Click-Installer and webgen via gem install webgen on the command prompt. Change into the directory under which you want to create your webgen website, for example: cd C: cd \websites Then you create a new webgen website with webgen create mywebsite The `create` command of the webgen executable is used to create a new website. You can customize the look of your new website via command line options (run `webgen help create` for help). Another way to create a website is via the webgen webgui which can be started by running webgen webgui This opens a browser window where you can enter the path of your new website directory - the input field has path auto completion. Enter the path to your website (e.g. C:\website\mynewwebsite) and click on the button. You can then preview the page with various layouts and templates and then create the website at the entered location. If you enter a valid webgen website directory into the path input field, you can generate the website. *hth*, Thomas From urbence at gmail.com Mon Mar 23 16:47:22 2009 From: urbence at gmail.com (Bence) Date: Mon, 23 Mar 2009 21:47:22 +0100 Subject: [webgen-users] What is a block? Message-ID: Hello, what exactly a block is? Do you explain it on the website? You wrote that a page file can contain multiple blocks. But why is it good? Please provide an example, how to use blocks. I have a code snippet, which I use on a lot of pages (Google Analytics and Adsense code). But if I change this snippet, of course I dont want to change every pages which uses it. I would like to change this snippet only in one file, then all the pages which use this snippet could just insert the snippet. For example, I would like to insert my Google Analytics tracking code snippet into all pages. How to do this? In which file should I put my Analytics snippet? My website uses multiple templates. I mean there are pages which have menu. But for example the first index page is a standalone page, whithout menu. And I have more standalone pages, only accessible from the sitemap page. Now how to insert the analytics code into all pages? And if I have an adsense code snippet, but I don't want to insert it into all pages, just into specific pages, how to do this? (Page = a standalone HTML page) My final issue: where are the sources of example websites, generated with webgen? There is this page: http://webgen.rubyforge.org/documentation/0.4.x/examples/index.html But this page contains only the output! Where are the source files of these websites? I checked webgen-0.5.7.zip, it contains some sources. But in data/webgen. But for example the data\webgen\website_templates\project\ website contains only page files! Webgen cannot generate the output whithout the template file. Also there are no CSS in that folder. So am I dumb, or where to find working source file examples, not just the output? Best Regards, Bence From t_leitner at gmx.at Wed Mar 25 02:07:11 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Wed, 25 Mar 2009 07:07:11 +0100 Subject: [webgen-users] What is a block? In-Reply-To: References: Message-ID: <20090325070711.66637e3d@77.119.8.237.wireless.dyn.drei.com> > what exactly a block is? Do you explain it on the website? A block is the smallest unit of content of a page file. Normally, you have one main block named `content` which holds the body of the page. And then you may have additional blocks for specific duties, e.g. for showing something on the sidebar. > You wrote that a page file can contain multiple blocks. But why is it > good? Please provide an example, how to use blocks. The typical example for using multiple blocks in page files is to that you have a template which layouts your website in two parts: the main content and a sidebar. The `content` block of a page file is used to populate the main content section and the optional `sidebar` block is used to additionally provide content for the sidebar. This is done on the webgen homepage, for example. You can see that there is some information regarding the latest version of webgen on the front page but not on the other pages. This is done by conditionally including a block of the page file that represents the front page. > I have a code snippet, which I use on a lot of pages (Google Analytics > and Adsense code). But if I change this snippet, of course I dont want > to change every pages which uses it. I would like to change this > snippet only in one file, then all the pages which use this snippet > could just insert the snippet. > > For example, I would like to insert my Google Analytics tracking code > snippet into all pages. How to do this? In which file should I put my > Analytics snippet? My website uses multiple templates. I mean there > are pages which have menu. But for example the first index page is a > standalone page, whithout menu. And I have more standalone pages, only > accessible from the sitemap page. Now how to insert the analytics code > into all pages? If you want to put something into all your pages, you should put it into your `default.template` file. Although you use various other templates to define the look and feel of your website, you can still have one template (the default template) into which they are rendered. For example, your `default.template` may look like this: {title:} --- GOOGLE ANALYTICS/ADSENSE CODE --- Note that this is just a very crude example. You would definitely have more information in the `head` section. And if you want to have different head sections for different layout template, you could do this by inserting a block like this: This would insert the block name `head-section` but only if there is such a block - otherwise this line is ignored. > And if I have an adsense code snippet, but I don't want to insert it > into all pages, just into specific pages, how to do this? You could add a second block named `adsense` to the `default.template` and insert it into the `content` block only if the node that is rendered has some meta information set: <% if context.content_node['adsense_enabled'] %> This snippet would insert the block named `adsense` if the meta information `adsense_enabled` is set to `true` in a page file. The ERB code for the `chain` is needed because you need to insert a block that is in the currently processed file and not in the next file of the node chain. I have put an item on my TODO list which will make this easier by allowing to set the `node` attribute to `current`. > (Page = a standalone HTML page) > > My final issue: where are the sources of example websites, generated > with webgen? There is this page: > http://webgen.rubyforge.org/documentation/0.4.x/examples/index.html > But this page contains only the output! Where are the source files of > these websites? I checked webgen-0.5.7.zip, it contains some sources. > But in data/webgen. But for example the > data\webgen\website_templates\project\ website contains only page > files! Webgen cannot generate the output whithout the template file. > Also there are no CSS in that folder. The source files for the examples are mostly generated, so you won't find them in the webgen package (not even in the 0.4.x packages, there you will only find the code to generate the examples). The examples section is just a demonstration of the various website styles/templates that can be used for a webgen website. And since the examples are for the 0.4.x series, you could not use the without some slight changes. So there is no reason to look at them if you are working with the 0.5.x version of webgen. As for the source of the webgen website: it is split into three parts. One part is the pure documentation part which is also shipped with webgen. It can be found in the doc/ directory. The second part are the support files which are used by both the documentation part and the website part. These files can be found in the misc/ directory of the webgen distribution. The third part are the sources of the webgen website which are not shipped with webgen since it makes no sense. However, the sources are checked into the Git repository.The documentation part can be rendered by running rake htmldoc This will put the generated documentation into the htmldoc/ directory. The reason why you can only use the above command and not simply the webgen executable is that the setup for the documentation website and the homepage is a little bit more involved and I didn't want to have two extra configuration files lying around. Best regards, Thomas From urbence at gmail.com Wed Mar 25 09:13:19 2009 From: urbence at gmail.com (Bence) Date: Wed, 25 Mar 2009 14:13:19 +0100 Subject: [webgen-users] What is a block? In-Reply-To: <20090325070711.66637e3d@77.119.8.237.wireless.dyn.drei.com> References: <20090325070711.66637e3d@77.119.8.237.wireless.dyn.drei.com> Message-ID: Hi Thomas, thank you very much for your detailed response! What I would like is to have different example website generated by webgen. But I need their source files, not the output, since I can generate the output if I have the sources. So please if someone could send me complete website sources for webgen, I would appreciate it. Because just the output is useless. If you generated a website with webgen, please share the sources with the list! Regards, Bence On Wed, Mar 25, 2009 at 7:07 AM, Thomas Leitner wrote: >> what exactly a block is? Do you explain it on the website? > > A block is the smallest unit of content of a page file. Normally, you > have one main block named `content` which holds the body of the page. > And then you may have additional blocks for specific duties, e.g. for > showing something on the sidebar. > >> You wrote that a page file can contain multiple blocks. But why is it >> good? Please provide an example, how to use blocks. > > The typical example for using multiple blocks in page files is to that > you have a template which layouts your website in two parts: the main > content and a sidebar. The `content` block of a page file is used to > populate the main content section and the optional `sidebar` block is > used to additionally provide content for the sidebar. > > This is done on the webgen homepage, for example. You can see that > there is some information regarding the latest version of webgen on the > front page but not on the other pages. This is done by conditionally > including a block of the page file that represents the front page. > >> I have a code snippet, which I use on a lot of pages (Google Analytics >> and Adsense code). But if I change this snippet, of course I dont want >> to change every pages which uses it. I would like to change this >> snippet only in one file, then all the pages which use this snippet >> could just insert the snippet. >> >> For example, I would like to insert my Google Analytics tracking code >> snippet into all pages. How to do this? In which file should I put my >> Analytics snippet? My website uses multiple templates. I mean there >> are pages which have menu. But for example the first index page is a >> standalone page, whithout menu. And I have more standalone pages, only >> accessible from the sitemap page. Now how to insert the analytics code >> into all pages? > > If you want to put something into all your pages, you should put it > into your `default.template` file. Although you use various other > templates to define the look and feel of your website, you can still > have one template (the default template) into which they are rendered. > For example, your `default.template` may look like this: > > ? ? > ? ? ?{title:} > ? ? ? > ? ? ? ? > ? ? ? ?--- GOOGLE ANALYTICS/ADSENSE CODE --- > ? ? ? > ? ? > > Note that this is just a very crude example. You would definitely have > more information in the `head` section. And if you want to have > different head sections for different layout template, you could do > this by inserting a block like this: > > ? ? > > This would insert the block name `head-section` but only if there is > such a block - otherwise this line is ignored. > >> And if I have an adsense code snippet, but I don't want to insert it >> into all pages, just into specific pages, how to do this? > > You could add a second block named `adsense` to the `default.template` > and insert it into the `content` block only if the node that is > rendered has some meta information set: > > ? ?<% if context.content_node['adsense_enabled'] %> > ? ? ? ?<% end %> > > This snippet would insert the block named `adsense` if the meta > information `adsense_enabled` is set to `true` in a page file. The ERB > code for the `chain` is needed because you need to insert a block that > is in the currently processed file and not in the next file of the node > chain. I have put an item on my TODO list which will make this easier > by allowing to set the `node` attribute to `current`. > >> (Page = a standalone HTML page) >> >> My final issue: where are the sources of example websites, generated >> with webgen? There is this page: >> http://webgen.rubyforge.org/documentation/0.4.x/examples/index.html >> But this page contains only the output! Where are the source files of >> these websites? I checked webgen-0.5.7.zip, it contains some sources. >> But in data/webgen. But for example the >> data\webgen\website_templates\project\ website contains only page >> files! Webgen cannot generate the output whithout the template file. >> Also there are no CSS in that folder. > > The source files for the examples are mostly generated, so you won't > find them in the webgen package (not even in the 0.4.x packages, there > you will only find the code to generate the examples). The examples > section is just a demonstration of the various website styles/templates > that can be used for a webgen website. And since the examples are for > the 0.4.x series, you could not use the without some slight changes. So > there is no reason to look at them if you are working with the 0.5.x > version of webgen. > > As for the source of the webgen website: it is split into three parts. > One part is the pure documentation part which is also shipped with > webgen. It can be found in the doc/ directory. The second part are the > support files which are used by both the documentation part and the > website part. These files can be found in the misc/ directory of the > webgen distribution. The third part are the sources of the webgen > website which are not shipped with webgen since it makes no sense. > However, the sources are checked into the Git repository.The > documentation part can be rendered by running > > ? ?rake htmldoc > > This will put the generated documentation into the htmldoc/ directory. > The reason why you can only use the above command and not simply the > webgen executable is that the setup for the documentation website and > the homepage is a little bit more involved and I didn't want to have > two extra configuration files lying around. > > Best regards, > ?Thomas > From t_leitner at gmx.at Wed Mar 25 12:46:58 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Wed, 25 Mar 2009 17:46:58 +0100 Subject: [webgen-users] What is a block? In-Reply-To: References: <20090325070711.66637e3d@77.119.8.237.wireless.dyn.drei.com> Message-ID: <20090325174658.470bc04f@77.119.8.237.wireless.dyn.drei.com> > So please if someone could send me complete website sources for > webgen, I would appreciate it. Because just the output is useless. > > If you generated a website with webgen, please share the sources with > the list! I have attached a zip file with the contents of the current webgen website (everything you see at http://webgen.rubyforge.org). Just unpack it, change into the extracted website directory and run webgen You need webgen 0.5.7 for this to work. -- Thomas -------------- next part -------------- A non-text attachment was scrubbed... Name: webgen-website.zip Type: application/octet-stream Size: 559568 bytes Desc: not available URL: From tuomov at iki.fi Thu Mar 26 07:33:37 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Thu, 26 Mar 2009 11:33:37 +0000 (UTC) Subject: [webgen-users] Markdown support? References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> Message-ID: On 2009-03-13, Tuomo Valkonen wrote: >> entries by title, description, ... Inlining content can be done by >> using the tag with a dynamically generated chain >> attribute, eg. >> >> >> >> where `entry` refers to the node of the currently processed faq entry. > > Hm... I'd very much prefer an existing extension/tag, or even ready > snippet of code, I think that nobody knows how to actually loop over the entries or whatever is needed to use that. -- In 1995, Linux was almost a bicycle; an alternative way of live to the Windows petrol beasts that had to be taken to the dealer for service. By 2008, Linux has bloated into a gas-guzzler, and local vendors and artisans have had to yield to "all under one roof" big box hypermarkets. From rick at thirdstagesoftware.com Thu Mar 26 08:29:16 2009 From: rick at thirdstagesoftware.com (Rick Bell) Date: Thu, 26 Mar 2009 08:29:16 -0400 Subject: [webgen-users] What is a block? In-Reply-To: <20090325174658.470bc04f@77.119.8.237.wireless.dyn.drei.com> Message-ID: <90D3137595514E68A2A00972D0039413@MAIN> Thomas, This worked 99% and with great results! Couple error messages when running webgen: #1 An error has occurred: No such file or directory - /Users/thomasleitner/website/version.rb So, in webgen.cache, I replaced this: /Users/thomasleitner/website/version.rb With this: version.rb #2 |An error has occurred: Erb processing failed in : no such file to load -- coderay I still get this message from webgen even after replacing this in all files: /documentation/reference_configuration.en.html With this: /documentation/reference_configuration.html Not sure where the effect of this problem will appear. Overall, the generated website looks great! Thank you! Rick -----Original Message----- From: webgen-users-bounces at rubyforge.org [mailto:webgen-users-bounces at rubyforge.org] On Behalf Of Thomas Leitner Sent: Wednesday, March 25, 2009 12:47 PM To: Bence Cc: webgen-users at rubyforge.org Subject: Re: [webgen-users] What is a block? > So please if someone could send me complete website sources for > webgen, I would appreciate it. Because just the output is useless. > > If you generated a website with webgen, please share the sources with > the list! I have attached a zip file with the contents of the current webgen website (everything you see at http://webgen.rubyforge.org). Just unpack it, change into the extracted website directory and run webgen You need webgen 0.5.7 for this to work. -- Thomas From t_leitner at gmx.at Thu Mar 26 16:32:07 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Thu, 26 Mar 2009 21:32:07 +0100 Subject: [webgen-users] What is a block? In-Reply-To: <90D3137595514E68A2A00972D0039413@MAIN> References: <20090325174658.470bc04f@77.119.8.237.wireless.dyn.drei.com> <90D3137595514E68A2A00972D0039413@MAIN> Message-ID: <20090326213207.01246243@77.119.8.237.wireless.dyn.drei.com> > Couple error messages when running webgen: > #1 > An error has occurred: No such file or directory - > /Users/thomasleitner/website/version.rb > > So, in webgen.cache, I replaced this: > /Users/thomasleitner/website/version.rb > With this: > version.rb Okay, the problem is that I have included the webgen.cache file in the zip. Before running webgen just delete it, then the error above is fixed. > #2 > |An error has occurred: Erb > processing failed in > : no such file to > load -- coderay > > I still get this message from webgen even after replacing this in all > files: /documentation/reference_configuration.en.html > With this: > /documentation/reference_configuration.html The error comes from not having coderay installed. Since the webgen website showcases nearly all features of webgen, you need all optional dependencies installed for a successful run. This also means that you need a working LaTeX installation with TikZ for rendering the src/documentation/tag/tikz.page! -- Thomas From kent.larsson at gmail.com Fri Mar 27 16:59:58 2009 From: kent.larsson at gmail.com (Kent Larsson) Date: Fri, 27 Mar 2009 21:59:58 +0100 Subject: [webgen-users] Some questions about webgen with a focus on bilingualism Message-ID: <65d6a07f0903271359n20dd15bfp6662cbcd75764ef6@mail.gmail.com> Hi, I'm new to webgen, in fact I have only installed it and not generated a site yet. I'm curious about webgen and have some questions which might affect if I'm able to use it or not. So that's why I'm asking now. Please excuse me if I missed some information on the web site, I mostly read enough to install it and get exited over the minimalist philosphy! ;-) As I am from Sweden I'll create a web site which is written in both Swedish and English. Some posts will be in both languages while others will be in only one of them. I want to have a static web site but add a dynamic aspect using JavaScript, if it's possible: I would like the users who has Swedish set as their preferred language in their browsers to only see the Swedish version of posts written in both languages. They will also see posts written in English only. The users who has English as their preferred language would only see English posts and not any posts in Swedish. If a user chooses Swedish and/or English as an active decision this decision will override the users set browser language. I would store the decision in a cookie so that it's remembered (as far as the user lets the cookie live) next time they visit. What do you think? Does it sound possible? Also is webgen able to generate RSS-feeds according to {a : A post in Swedish,English but only Swedish if it exists}, {English}? And lastly, is webgen suitable to use for a blog? I think there is an extension to enable comments using http://disqus.com . If some of the above is features which doesn't exist in webgen, do you think it's possible for me to add them by writing extensions? I've never used Ruby but I do know how to write software. Best regards, Kent From t_leitner at gmx.at Sat Mar 28 02:11:20 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Sat, 28 Mar 2009 07:11:20 +0100 Subject: [webgen-users] Some questions about webgen with a focus on bilingualism In-Reply-To: <65d6a07f0903271359n20dd15bfp6662cbcd75764ef6@mail.gmail.com> References: <65d6a07f0903271359n20dd15bfp6662cbcd75764ef6@mail.gmail.com> Message-ID: <20090328071120.69456719@77.116.131.168.wireless.dyn.drei.com> > I want to have a static web site but add a dynamic aspect using > JavaScript, if it's possible: > > I would like the users who has Swedish set as their preferred language > in their browsers to only see the Swedish version of posts written in > both languages. They will also see posts written in English only. The > users who has English as their preferred language would only see > English posts and not any posts in Swedish. > > If a user chooses Swedish and/or English as an active decision this > decision will override the users set browser language. I would store > the decision in a cookie so that it's remembered (as far as the user > lets the cookie live) next time they visit. > > What do you think? Does it sound possible? It sounds certainly possible but I don't know how to do this with JavaScript. You could use Apache's functionality to correctly select the language base on the filename (see Apache language negotiation and the AddLanguage directive). > Also is webgen able to generate RSS-feeds according to {a : A post in > Swedish,English but only Swedish if it exists}, {English}? It is theoretically possible and everything's there, but it is not implemented in this way currently. There has been another thread with a similar request and I will look into this. > And lastly, is webgen suitable to use for a blog? I think there is an > extension to enable comments using http://disqus.com . webgen is certainly suitable for a static blog. However, it currently lacks out-of-the-box suppport for many things a blog needs (for example, tags). Full blog functionality will be supported in a future release. > If some of the above is features which doesn't exist in webgen, do you > think it's possible for me to add them by writing extensions? I've > never used Ruby but I do know how to write software. It is not hard to write extensions to webgen. Just read through the API documentation. I have included examples for all the major extensions like source handlers and tags. Best regards, Thomas From t_leitner at gmx.at Sat Mar 28 02:13:51 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Sat, 28 Mar 2009 07:13:51 +0100 Subject: [webgen-users] Markdown support? In-Reply-To: References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> Message-ID: <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> Am Thu, 26 Mar 2009 11:33:37 +0000 (UTC) schrieb Tuomo Valkonen : > On 2009-03-13, Tuomo Valkonen wrote: > >> entries by title, description, ... Inlining content can be done by > >> using the tag with a dynamically generated chain > >> attribute, eg. > >> > >> > >> > >> where `entry` refers to the node of the currently processed faq > >> entry. > > > > Hm... I'd very much prefer an existing extension/tag, or even ready > > snippet of code, > > I think that nobody knows how to actually loop over the entries or > whatever is needed to use that. This can be done by using ERB in page or template files (see the documentation for the ERB content processor). However, you would need basic knowledge of the Ruby programming language. -- Thomas From tuomov at iki.fi Sat Mar 28 02:30:22 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Sat, 28 Mar 2009 06:30:22 +0000 (UTC) Subject: [webgen-users] Markdown support? References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> Message-ID: On 2009-03-28, Thomas Leitner wrote: > This can be done by using ERB in page or template files (see the > documentation for the ERB content processor). However, you would need > basic knowledge of the Ruby programming language. Yes, I know that. But more importantly, I would have to learn the webgen internals, which I'm not really interested in doing. The documentation isn't exactly straightforward. And if it's not just a simple two-line for-loop or so, it's really too much to embed... And I expect it to be a huge blob, because nobody just gives the answer. -- Tuomo From t_leitner at gmx.at Sat Mar 28 14:50:56 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Sat, 28 Mar 2009 19:50:56 +0100 Subject: [webgen-users] Markdown support? In-Reply-To: References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> Message-ID: <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> Am Sat, 28 Mar 2009 06:30:22 +0000 (UTC) schrieb Tuomo Valkonen : > On 2009-03-28, Thomas Leitner wrote: > > This can be done by using ERB in page or template files (see the > > documentation for the ERB content processor). However, you would > > need basic knowledge of the Ruby programming language. > > Yes, I know that. But more importantly, I would have to learn > the webgen internals, which I'm not really interested in doing. > The documentation isn't exactly straightforward. And if it's > not just a simple two-line for-loop or so, it's really too > much to embed... And I expect it to be a huge blob, because > nobody just gives the answer. It's hard to provide a general solution for the problem. I have included a generic ERB script below that inserts links to all page files sorted by their `sort_info` meta information in a sub folder called `faqs`: <% context.content_node.tree['/faqs'].children.select {|c| c['kind'] == 'page'}.sort.each do |c| %> * <%= context.dest_node.link_to(c) %> <% end %> -- Thomas From tuomov at iki.fi Sun Mar 29 03:22:38 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Sun, 29 Mar 2009 07:22:38 +0000 (UTC) Subject: [webgen-users] Aggregate pages and feeds [Was: Re: Markdown support?] References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> Message-ID: On 2009-03-28, Thomas Leitner wrote: > It's hard to provide a general solution for the problem. That's fine, just some template to get started with. (Much easier to start work fro templates than from scratch with too extensive documentation to read.) ><% context.content_node.tree['/faqs'].children.select {|c| c['kind'] == 'page'}.sort.each do |c| %> > * <%= context.dest_node.link_to(c) %> ><% end %> Replacing the link_to -line with does not seem to be working. I get the path to the html in chain, but the tag just gets rendered, instead of expanded. I suspect rdiscount is mangling it. Indeed, I tried just running the page through both rdiscount and good old markdown, and the former mangled the starting < into < while the latter didn't. Of course, the ERB stuff not being executed affects the results. Would it be possible to have this code as a separate unprocessed block or something? Or how difficult would it be to turn it into an extension/tag? One thing that came into my mind: Will this webgen:block stuff actually rebase the links? Another thing I've noticed that the feed extension seems to choose the 10 earliest entries! -- In 1995, Linux was almost a bicycle; an alternative way of live to the Windows petrol beasts that had to be taken to the dealer for service. By 2008, Linux has bloated into a gas-guzzler, and local vendors and artisans have had to yield to "all under one roof" big box hypermarkets. From t_leitner at gmx.at Sun Mar 29 10:37:32 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Sun, 29 Mar 2009 16:37:32 +0200 Subject: [webgen-users] Aggregate pages and feeds [Was: Re: Markdown support?] In-Reply-To: References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> Message-ID: <20090329163732.0e694a35@77.116.131.168.wireless.dyn.drei.com> > Replacing the link_to -line with > > > > does not seem to be working. I get the path to the html > in chain, but the tag just gets rendered, instead of expanded. > I suspect rdiscount is mangling it. Indeed, I tried just > running the page through both rdiscount and good old markdown, > and the former mangled the starting < into < while the > latter didn't. Of course, the ERB stuff not being executed > affects the results. > > Would it be possible to have this code as a separate unprocessed > block or something? Or how difficult would it be to turn it > into an extension/tag? You can easily create a separate block for this. Just add a new block in your page file and specify the pipeline that you wish to use. For example, to allow only erb and webgen blocks processing you would do it like this: --- name:entries pipeline:erb,blocks <% context.content_node.tree['/faqs'].children.select {|c| c['kind'] == 'page'}.sort.each do |c| %> <% end %> Then you can include this block in the content section of your page file. However, since you will always need to use the block tag in the main content block, the rdiscount processor will always mangle it. So this seems to be a problem with the rdiscount processor and not webgen per se. Your second idea of using a special tag for this naturally also works, the code for it would look like this (put it into ext/init.rb): ---------------------------------------------------------------- config = Webgen::WebsiteAccess.website.config require 'webgen/tag' class FAQEntriesTag include Webgen::Tag::Base def call(tag, body, context) result = '' context.content_node.tree['/faqs'].children.select {|c| c['kind'] == 'page'}.sort.each do |c| context.dest_node.node_info[:used_nodes] << c.absolute_lcn result += c.node_info[:page].blocks['content'].render(context.clone(:chain => [c])).content + "\n" end result end end config['contentprocessor.tags.map']['faqentries'] = 'FAQEntriesTag' ---------------------------------------------------------------- This would create a tag called `faqentries`. Everytime it is used, it searches for all page files under the `/faqs` directory and inserts the rendered content of the found nodes into document. The third line of the method adds the found node to a special array sothat the page gets automatically re-generated when the node changes. The fourth line renders the found node. > One thing that came into my mind: Will this webgen:block stuff > actually rebase the links? Yes, it will correctly convert all webgen generated links into relative links. -- Thomas From tuomov at iki.fi Sun Mar 29 12:44:20 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Sun, 29 Mar 2009 16:44:20 +0000 (UTC) Subject: [webgen-users] Aggregate pages and feeds [Was: Re: Markdown support?] References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> <20090329163732.0e694a35@77.116.131.168.wireless.dyn.drei.com> Message-ID: On 2009-03-29, Thomas Leitner wrote: > Your second idea of using a special tag for this naturally also works, > the code for it would look like this (put it into ext/init.rb): > This seems to be inserting the entries, but they're incorrectly sorted, just like the feed. I have the dates set in created.metainfo this way: --- name:paths Released_ion-3rc-20071220.page: created_at: 2007-12-20T18:57:36Z modified_at: 2007-12-20T18:57:36Z Released_ion-3rc-20080103.page: created_at: 2008-01-03T18:27:27Z modified_at: 2008-01-03T18:27:27Z etc. Should this work? Rebasing also doesn't seem to be happening. Both [download]({relocatable: /download.html}) and {link: ../download.html} end up pointing outside the target tree, i.e., are not altered. Also the title should be created (but maybe I'll figure it out). -- Tuomo From t_leitner at gmx.at Sun Mar 29 13:39:25 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Sun, 29 Mar 2009 19:39:25 +0200 Subject: [webgen-users] Aggregate pages and feeds [Was: Re: Markdown support?] In-Reply-To: References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> <20090329163732.0e694a35@77.116.131.168.wireless.dyn.drei.com> Message-ID: <20090329193925.13121017@77.116.131.168.wireless.dyn.drei.com> Am Sun, 29 Mar 2009 16:44:20 +0000 (UTC) schrieb Tuomo Valkonen : > On 2009-03-29, Thomas Leitner wrote: > > Your second idea of using a special tag for this naturally also > > works, the code for it would look like this (put it into > > ext/init.rb): > > > > This seems to be inserting the entries, but they're incorrectly > sorted, just like the feed. I have the dates set in created.metainfo > this way: > > --- name:paths > Released_ion-3rc-20071220.page: > created_at: 2007-12-20T18:57:36Z > modified_at: 2007-12-20T18:57:36Z > Released_ion-3rc-20080103.page: > created_at: 2008-01-03T18:27:27Z > modified_at: 2008-01-03T18:27:27Z > > etc. Should this work? Yes, this should work. I tried it on a sample site and the dates are set correctly. However, webgen sorts nodes using the meta information sort_info and uses the title of a node as fallback. So, since the entries don't appear to have the sort_info meta information set, they are sorted by their titles. If you want to sort by modification time, you need to replace the `.sort` call in the code from last mail with .sort {|a,b| a['modified_at'] <=> b['modified_at']} > Rebasing also doesn't seem to be happening. Both > [download]({relocatable: /download.html}) and > {link: ../download.html} end up pointing outside the target tree, > i.e., are not altered. Also the title should be created (but maybe > I'll figure it out). The fragments are correct. For setting the title attribute of a link generated with the link tag, have a look at its documentation at http://webgen.rubyforge.org/documentation/tag/link.html . Are any warnings or errors displayed when you run webgen? Could you send me the sources for your website? This would greatly help figuring out why things are not working the way they should. -- Thomas From tuomov at iki.fi Sun Mar 29 15:32:22 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Sun, 29 Mar 2009 19:32:22 +0000 (UTC) Subject: [webgen-users] Aggregate pages and feeds [Was: Re: Markdown support?] References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> <20090329163732.0e694a35@77.116.131.168.wireless.dyn.drei.com> <20090329193925.13121017@77.116.131.168.wireless.dyn.drei.com> Message-ID: On 2009-03-29, Thomas Leitner wrote: > .sort {|a,b| a['modified_at'] <=> b['modified_at']} I had to change the order of and b in the test to make this work. The same change in feed.rb fixed feeds. The result is as follows (sorry, no proper attachment; reading through gmane with slrn, which has no support): --- config = Webgen::WebsiteAccess.website.config require 'webgen/tag' class InlineTag include Webgen::Tag::Base def call(tag, body, context) pages = param('tag.inline.pages') count = param('tag.inline.count') result = '' nodes = context.content_node.tree[pages].children.\ select {|c| c['kind'] == 'page'}.\ sort {|a,b| b['created_at'] <=> a['created_at']} (count == 0 ? nodes : nodes[0,count]).each do |c| context.dest_node.node_info[:used_nodes] << c.absolute_lcn result += "
\n

" \ + context.dest_node.link_to(c) + "

\n" \ + c.node_info[:page].blocks['content'].render(context.clone(:chain => [c])).content \ + "\nPosted " \ + c['created_at'].strftime("%Y-%m-%d %H:%M") \ + "\n
\n" end result end end config['contentprocessor.tags.map']['inline'] = 'InlineTag' config.tag.inline.pages("/news", :doc => 'page directory', :mandatory => 'default') config.tag.inline.count(0, :doc => 'page count') --- However, the parameters aren't being recognised. If I remove the "/news" default, I get undefined method `children' for nil:NilClass and with it, I still get WARN -- Invalid parameter 'count' for tag 'InlineTag' in WARN -- Invalid parameter 'pages' for tag 'InlineTag' in > The fragments are correct. For setting the title attribute of a link > generated with the link tag, have a look at its documentation at > http://webgen.rubyforge.org/documentation/tag/link.html . Are any > warnings or errors displayed when you run webgen? > > Could you send me the sources for your website? This would greatly help > figuring out why things are not working the way they should. There isn't much to it. Basically: src/news.page: {inline: {pages: /news, count: 3}} src/news/Released_xxxx.page: ([download]({relocatable: /download.html})) or {link: ../download.html} (plus title in metadata section, and created/modified date in src/news/created.metainfo, extracted from version control system). Neither of these link types get rebased for inclusion in the news.html one directory up. -- Stop Gnomes and other pests! Purchase Windows today! From thomas.danckaert at gmail.com Sun Mar 29 16:38:08 2009 From: thomas.danckaert at gmail.com (Thomas Danckaert) Date: Sun, 29 Mar 2009 13:38:08 -0700 (PDT) Subject: [webgen-users] 2 questions: printable version / labels Message-ID: Hi, I'm thinking of using webgen to make website containing restaurant reviews. I've been playing around with webgen and reading the docs, but it's not quite clear to me yet, whether the following things are already possible and if not, how difficult it would be to implement them: - I'd like to automatically create a version intended for printing (i.e. without site navigation and with minimal markup) of certain pages. Is there already a standard way of doing this? If not, would the solution be to write an extra content processor which does this? (Maybe someone else here has already written an extension for this?) - Is there a way of indexing articles by different properties? E.g. labeling restaurants per 'genre' and per price range? I'm thinking I could use the tags from the blogging functionality for this, but that would only give me one index (e.g. I could use tags to allocate genres, but then I wouldn't have another label for the price range). Would it be complicated to duplicate the tags functionality in order to have multiple indexes? (by the way: How do I actually use the blogging features? :) ) thanks for any advice! Thomas From t_leitner at gmx.at Mon Mar 30 05:04:24 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Mon, 30 Mar 2009 11:04:24 +0200 Subject: [webgen-users] Aggregate pages and feeds [Was: Re: Markdown support?] In-Reply-To: References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> <20090329163732.0e694a35@77.116.131.168.wireless.dyn.drei.com> <20090329193925.13121017@77.116.131.168.wireless.dyn.drei.com> Message-ID: <20090330110424.50961021@77.116.131.168.wireless.dyn.drei.com> > However, the parameters aren't being recognised. If I remove the > "/news" default, I get > > undefined method `children' for nil:NilClass > > and with it, I still get > > WARN -- Invalid parameter 'count' for tag 'InlineTag' in > WARN -- Invalid parameter 'pages' for tag 'InlineTag' > in The resolution of the configuration parameters is done via the class name of a tag but it seems that I have forgotten to mention this in the API documentation - will fix it. So basically, if you have a class called InlineTag, the default mechanism searches for options under inlinetag, ie. you have to set the options this way: config.inlinetag.pages("/news", :doc => 'page directory', :mandatory => 'default') config.inlinetag.count(0, :doc => 'page count') Then the configuration options are found. Note that you also have to change param('tag.inline.pages') param('tag.inline.count') to param('inlinetag.pages') param('inlinetag.count') Or you can name your tag class Tag::Inline - then you don't have to change the rest as stated above. > There isn't much to it. Basically: > > src/news.page: > > {inline: {pages: /news, count: 3}} > > src/news/Released_xxxx.page: > > ([download]({relocatable: /download.html})) > > or > > {link: ../download.html} > > (plus title in metadata section, and created/modified date in > src/news/created.metainfo, extracted from version control system). > > Neither of these link types get rebased for inclusion in the > news.html one directory up. That's my fault, did not code correctly. Replace the corresponding line with the following + c.node_info[:page].blocks['content'].render(context.clone(:chain => [c], :dest_node => context.dest_node || context.content_node)).content \ This sets the extra information :dest_node on the clone context. This information is needed for the rebasing when the rendered node and the output node are not the same. I have tested the above changes and they work with 0.5.7. -- Thomas From tuomov at iki.fi Mon Mar 30 05:52:57 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Mon, 30 Mar 2009 09:52:57 +0000 (UTC) Subject: [webgen-users] Aggregate pages and feeds [Was: Re: Markdown support?] References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> <20090329163732.0e694a35@77.116.131.168.wireless.dyn.drei.com> <20090329193925.13121017@77.116.131.168.wireless.dyn.drei.com> <20090330110424.50961021@77.116.131.168.wireless.dyn.drei.com> Message-ID: On 2009-03-30, Thomas Leitner wrote: > I have tested the above changes and they work with 0.5.7. I will try these later. One thing that popped to my mind, though: would it be possible to extend the feed plugin to define a block of the feed items (in the style of my init.rb) for inclusion in other pages? That would seem cleaner than defining both inline and feed separately... although of some inlines I don't want a feed of. It's something to consider anyway, if the blog features are to be extended. I should in any case get my site to a working condition if the mentioned fixes work. -- "[Fashion] is usually a form of ugliness so intolerable that we have to alter it every six months." -- Oscar Wilde "The computer industry is the only industry that is more fashion-driven than women's fashion." -- RMS From t_leitner at gmx.at Mon Mar 30 11:02:35 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Mon, 30 Mar 2009 17:02:35 +0200 Subject: [webgen-users] Aggregate pages and feeds [Was: Re: Markdown support?] In-Reply-To: References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> <20090329163732.0e694a35@77.116.131.168.wireless.dyn.drei.com> <20090329193925.13121017@77.116.131.168.wireless.dyn.drei.com> <20090330110424.50961021@77.116.131.168.wireless.dyn.drei.com> Message-ID: <20090330170235.39c79860@77.116.131.168.wireless.dyn.drei.com> Am Mon, 30 Mar 2009 09:52:57 +0000 (UTC) schrieb Tuomo Valkonen : > On 2009-03-30, Thomas Leitner wrote: > > I have tested the above changes and they work with 0.5.7. > > I will try these later. One thing that popped to my mind, though: > would it be possible to extend the feed plugin to define a block > of the feed items (in the style of my init.rb) for inclusion in > other pages? That would seem cleaner than defining both inline > and feed separately... although of some inlines I don't want a > feed of. > > It's something to consider anyway, if the blog features are to be > extended. I should in any case get my site to a working condition > if the mentioned fixes work. I'm thinking about providing an easy method for selecting an arbitrary set of nodes for further processing. It will allow selecting nodes by different criterias, sorting them and do everything else that is needed (hopefully). Then this method will be used for all such things like selecting nodes for feeds, for menus, ... -- Thomas From t_leitner at gmx.at Mon Mar 30 10:58:30 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Mon, 30 Mar 2009 16:58:30 +0200 Subject: [webgen-users] 2 questions: printable version / labels In-Reply-To: References: Message-ID: <20090330165830.2f0dcbdd@77.116.131.168.wireless.dyn.drei.com> > - I'd like to automatically create a version intended for printing > (i.e. without site navigation and with minimal markup) of certain > pages. Is there already a standard way of doing this? If not, would > the solution be to write an extra content processor which does this? > (Maybe someone else here has already written an extension for this?) If you mean creating PDF documents for your page files, I don't know of any extension that can do that right now. However, the standard way of doing this, I believe, is using CSS and providing separate stylesheets for print and screen environments. It is easy to disable/hide certain parts of web site with CSS and CSS also provides options for inserting page breaks and the like. > - Is there a way of indexing articles by different properties? E.g. > labeling restaurants per 'genre' and per price range? I'm thinking I > could use the tags from the blogging functionality for this, but that > would only give me one index (e.g. I could use tags to allocate > genres, but then I wouldn't have another label for the price range). > Would it be complicated to duplicate the tags functionality in order > to have multiple indexes? (by the way: How do I actually use the > blogging features? :) ) There is currently nothing implemented regarding tags or blog support, the only thing existing is automatic generation of feeds. Complete blog support is planned (since a long time actually :-( ) but not implemented currently. By the way: what exactly do you mean by indexing? If you want to list pages according to certain meta information, this should be doable by using some ERB fragments in your page/template files. Naturally, this would mean that you need a basic knowledge of the Ruby programming language. However, if you tell me enough of what you want to do, I should be able to jumpstart your coding. -- Thomas From tuomov at iki.fi Mon Mar 30 13:12:58 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Mon, 30 Mar 2009 17:12:58 +0000 (UTC) Subject: [webgen-users] Aggregate pages and feeds [Was: Re: Markdown support?] References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> <20090329163732.0e694a35@77.116.131.168.wireless.dyn.drei.com> <20090329193925.13121017@77.116.131.168.wireless.dyn.drei.com> <20090330110424.50961021@77.116.131.168.wireless.dyn.drei.com> Message-ID: On 2009-03-30, Tuomo Valkonen wrote: > On 2009-03-30, Thomas Leitner wrote: >> I have tested the above changes and they work with 0.5.7. > > I will try these later. Ok, with these fixes things seem to work. There's one minor bug/annoying feature that I noted: if I add a virtual (index) page, pages referring to it (through from the breadcrumb trail) won't be updated. (I'm not going to start moving pages around, and since ikiwiki had index for /foo/ as /foo.html, I'm adding a virtual /foo/index.html referring to /foo.html. This makes it easier with the selection of pages for feeds/inlines too.) -- "[Fashion] is usually a form of ugliness so intolerable that we have to alter it every six months." -- Oscar Wilde "The computer industry is the only industry that is more fashion-driven than women's fashion." -- RMS From thomas.danckaert at gmail.com Mon Mar 30 18:18:22 2009 From: thomas.danckaert at gmail.com (Thomas Danckaert) Date: Mon, 30 Mar 2009 15:18:22 -0700 (PDT) Subject: [webgen-users] 2 questions: printable version / labels In-Reply-To: <20090330165830.2f0dcbdd@77.116.131.168.wireless.dyn.drei.com> References: <20090330165830.2f0dcbdd@77.116.131.168.wireless.dyn.drei.com> Message-ID: <65a60f71-05a3-4bb6-a02d-f106bba9e2f6@y9g2000yqg.googlegroups.com> On Mar 30, 4:58?pm, Thomas Leitner wrote: > > - I'd like to automatically create a version intended for printing > > (i.e. without site navigation and with minimal markup) of certain > > pages. Is there already a standard way of doing this? If not, would > > the solution be to write an extra content processor which does this? > > (Maybe someone else here has already written an extension for this?) > > If you mean creating PDF documents for your page files, I don't know of > any extension that can do that right now. However, the standard way of > doing this, I believe, is using CSS and providing separate stylesheets > for print and screen environments. It is easy to disable/hide certain > parts of web site with CSS and CSS also provides options for inserting > page breaks and the like. > Doing it using CSS is what I meant. I'd like to make webgen generate the normal webpage and the html-file intended for printing (which would, indeed, use some different and sobre css) from a single .page file. I just don't know what would be the most elegant and efficient way to do it. > > - Is there a way of indexing articles by different properties? E.g. > > labeling restaurants per 'genre' and per price range? I'm thinking I > > could use the tags from the blogging functionality for this, but that > > would only give me one index (e.g. I could use tags to allocate > > genres, but then I wouldn't have another label for the price range). > > Would it be complicated to duplicate the tags functionality in order > > to have multiple indexes? (by the way: How do I actually use the > > blogging features? :) ) > > There is currently nothing implemented regarding tags or blog support, > the only thing existing is automatic generation of feeds. Complete blog > support is planned (since a long time actually :-( ) but not > implemented currently. > > By the way: what exactly do you mean by indexing? If you want to list > pages according to certain meta information, this should be doable by > using some ERB fragments in your page/template files. Naturally, this > would mean that you need a basic knowledge of the Ruby programming > language. However, if you tell me enough of what you want to do, I > should be able to jumpstart your coding. This is also what I meant. It just wasn't clear to me to what extent the blogging support was already implemented :) I'd like to add meta-information to certain .page files and then list these on overview pages. Sticking with the restaurant page, such .page file would contain a section like --- style: thai food pricerange: expensive --- and there would be an overview page listing all styles and all price ranges, and a page for each style, listing all restaurants in that style. I don't want to ask you to do the coding, but if you could give me some pointers as to how this would fit best into the webgen framework, I'd sure be grateful :) I've toyed with php scripted pages before, so I guess I should be able to pull this off when I learn some ruby... > > -- Thomas > _______________________________________________ > webgen-users mailing list > webgen-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/webgen-users From t_leitner at gmx.at Tue Mar 31 04:34:19 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Tue, 31 Mar 2009 10:34:19 +0200 Subject: [webgen-users] Aggregate pages and feeds [Was: Re: Markdown support?] In-Reply-To: References: <20090313074742.245a74c7@77.118.56.134.wireless.dyn.drei.com> <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> <20090329163732.0e694a35@77.116.131.168.wireless.dyn.drei.com> <20090329193925.13121017@77.116.131.168.wireless.dyn.drei.com> <20090330110424.50961021@77.116.131.168.wireless.dyn.drei.com> Message-ID: <20090331103419.2b92ff00@77.116.131.168.wireless.dyn.drei.com> > There's one minor bug/annoying feature that I noted: if I add > a virtual (index) page, pages referring to it (through from the > breadcrumb trail) won't be updated. (I'm not going to start > moving pages around, and since ikiwiki had index for /foo/ as > /foo.html, I'm adding a virtual /foo/index.html referring to > /foo.html. This makes it easier with the selection of pages > for feeds/inlines too.) Okay, I have tried to reproduce this with the following setup: /index.page /foo.page /foo /virtual Contents of index.page: A link to {link: foo/index.html} Contents of virtual: foo/index.html: title: My Kung Foo Then the whole site is rendered. When changing meta information associated with the virtual file (e.g. the title), the link in `index.page` is not updated. This is certainly not the intended behaviour - is this what you mean? I have fixed the above behaviour and unconvered some other lurking bugs on the way - the fixes are available with the next release! -- Thomas From tuomov at iki.fi Tue Mar 31 11:46:37 2009 From: tuomov at iki.fi (Tuomo Valkonen) Date: Tue, 31 Mar 2009 15:46:37 +0000 (UTC) Subject: [webgen-users] Aggregate pages and feeds [Was: Re: Markdown support?] References: <20090313111509.51700641@77.118.56.134.wireless.dyn.drei.com> <20090328071351.15a6a745@77.116.131.168.wireless.dyn.drei.com> <20090328195056.6d2e1183@77.116.131.168.wireless.dyn.drei.com> <20090329163732.0e694a35@77.116.131.168.wireless.dyn.drei.com> <20090329193925.13121017@77.116.131.168.wireless.dyn.drei.com> <20090330110424.50961021@77.116.131.168.wireless.dyn.drei.com> <20090331103419.2b92ff00@77.116.131.168.wireless.dyn.drei.com> Message-ID: On 2009-03-31, Thomas Leitner wrote: > Contents of virtual: > > foo/index.html: > title: My Kung Foo > > Then the whole site is rendered. When changing meta information > associated with the virtual file (e.g. the title), the link in > `index.page` is not updated. This is certainly not the intended > behaviour - is this what you mean? I have faq/index.virtual: \--- !omap - index.html: url: /faq.html routed_title: FAQ When I created this and other similar files, already rendered pages pointing to a non-existent index within the directory (faq/), were not automatically updated to reflect this "redirection" of faq/(index.html) to faq.html. It was simplest to delete webgen.cache to have them updated. -- Tuomo