From zoxc32 at gmail.com Mon Nov 2 06:00:40 2009 From: zoxc32 at gmail.com (Zoxc) Date: Mon, 2 Nov 2009 03:00:40 -0800 (PST) Subject: [webgen-users] Copy every file not handled by webgen Message-ID: Hello, I would like webgen to copy all files that's not handled to the output directory. Is there an easy way to do this? - Zoxc From sam.mulube at gmail.com Mon Nov 2 07:24:26 2009 From: sam.mulube at gmail.com (Sam M.) Date: Mon, 2 Nov 2009 04:24:26 -0800 (PST) Subject: [webgen-users] webgen and less Message-ID: Hello, I'm new to webgen, and I like what I see so far, but I have been trying to understand the webgen dir structure and extension scheme so that I could make use of less (http://lesscss.org/) to generate css files (in the way that sass is currently supported). However I seem to be going in circles, so perhaps someone can give me some pointers. I would like to be able to write less formatted css files in the src folder called for example: src/default.less.css, then after running webgen on that I would like that to be processed through the less parser, with the output being placed in the out folder and renamed as: out/default.css. So I assume that I need to write an extension to support this, but I'm not clear on how to configure webgen so that it maps the css files to be processed via my custom extension. Any pointers would be appreciated. thanks Sam From t_leitner at gmx.at Mon Nov 2 08:33:53 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Mon, 2 Nov 2009 14:33:53 +0100 Subject: [webgen-users] Copy every file not handled by webgen In-Reply-To: References: Message-ID: <20091102143353.712e6de1@noeato.mat.univie.ac.at> > I would like webgen to copy all files that's not handled to the output > directory. Is there an easy way to do this? This is not possible. You will have to tell the CopyHandler the files or the needed file patterns that should be copied. For example, you could add the following to your config.yaml to copy additionally copy all .pdf files: patterns: Copy: add: [**/*.pdf] -- Thomas From t_leitner at gmx.at Mon Nov 2 08:42:34 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Mon, 2 Nov 2009 14:42:34 +0100 Subject: [webgen-users] webgen and less In-Reply-To: References: Message-ID: <20091102144234.299cc21f@noeato.mat.univie.ac.at> > I would like to be able to write less formatted css files in the src > folder called for example: src/default.less.css, then after running > webgen on that I would like that to be processed through the less > parser, with the output being placed in the out folder and renamed as: > out/default.css. The naming of the file is correct. However, the problem is the missing less content processor. Put the following into the ext/init.rb file and using less should work: class LessProcessor def call(context) require 'less' context.content = Less.parse(context.content) context end end Webgen::WebsiteAccess.website.config['contentprocessor.map']['less'] = 'LessProcessor' After that, any file that has .less.css is run through the less parser and put into an .css output file. *hth*, Thomas From sam.mulube at gmail.com Mon Nov 2 08:56:29 2009 From: sam.mulube at gmail.com (sam mulube) Date: Mon, 2 Nov 2009 13:56:29 +0000 Subject: [webgen-users] webgen and less In-Reply-To: <20091102144234.299cc21f@noeato.mat.univie.ac.at> References: <20091102144234.299cc21f@noeato.mat.univie.ac.at> Message-ID: Ah that was so easy. I was nearly there, I had a LessProcessor class pretty much exactly as you've given, but hadn't quite understood that just the simple association of the content processor class with the 'less' name in init.rb was enough to hook it up (also I had the LessProcessor in a separate file under ext/ and was trying to require it from init.rb, but perhaps that's unnecessary for a simple case like this). thanks for the quick response. Sam 2009/11/2 Thomas Leitner : >> I would like to be able to write less formatted css files in the src >> folder called for example: src/default.less.css, then after running >> webgen on that I would like that to be processed through the less >> parser, with the output being placed in the out folder and renamed as: >> out/default.css. > > The naming of the file is correct. However, the problem is the missing > less content processor. Put the following into the ext/init.rb file > and using less should work: > > ?class LessProcessor > > ? ?def call(context) > ? ? ?require 'less' > ? ? ?context.content = Less.parse(context.content) > ? ? ?context > ? ?end > > ?end > > ?Webgen::WebsiteAccess.website.config['contentprocessor.map']['less'] = 'LessProcessor' > > After that, any file that has .less.css is run through the less parser > and put into an .css output file. > > *hth*, > ?Thomas > From pema at dri.cefetmg.br Wed Nov 4 23:04:48 2009 From: pema at dri.cefetmg.br (Paulo Almeida) Date: Wed, 4 Nov 2009 20:04:48 -0800 (PST) Subject: [webgen-users] bibtex and extensions Message-ID: Hi Thomas and folks, I want to render a list of technical references in my site, from various sources into a single .page file. These references are now organized as various .bib files (bibtex is a very popular format to store references and to use them in LaTeX text processor, as most of you may know). I think I will need to build a new webgen extension to deal with bibtex format and to render it appropriately in html, but I have no clues on how should I start from. Is there anything like an extension tutorial, which teaches how to create the simplest possible extension, how to use it inside a .page file and so on? I have been looking for this tutorial in the last days with no success, excuse me if it already exists. Thx as always. Paulo From damien.pollet at gmail.com Thu Nov 5 05:00:05 2009 From: damien.pollet at gmail.com (Damien Pollet) Date: Thu, 5 Nov 2009 11:00:05 +0100 Subject: [webgen-users] bibtex and extensions In-Reply-To: References: Message-ID: <34b4844b0911050200j5beb1e02v667ecc7d6f0c26db@mail.gmail.com> On Thu, Nov 5, 2009 at 05:04, Paulo Almeida wrote: > I think I will need to build a new webgen extension to deal with > bibtex format and to render it appropriately in html, but I have no > clues on how should I start from. Well, first of all, good luck on this part :) I was fed up with the bibtex tools too and I can say the bibtex syntax is not nice it you want to parse it in a somewhat general way. I have a parser/generator that works, but it's in Smalltalk so integrating it with webgen would not be immediate. Anyway, see http://www.squeaksource.com/Citezen.html if you're interested. Cheers -- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet From angelo.gargantini at unibg.it Thu Nov 5 01:16:55 2009 From: angelo.gargantini at unibg.it (Angelo Gargantini) Date: Thu, 05 Nov 2009 07:16:55 +0100 Subject: [webgen-users] bibtex and extensions In-Reply-To: References: Message-ID: <4AF26DD7.4080405@unibg.it> Hi Paulo take a look at: https://gforge.inria.fr/plugins/scmsvn/viewcvs.php/www/?rev=199&root=oar#dirlist However, I'm not sure that it is updated and works with the latest versions of webgen. To convert from bib to html you would need another tool for example: http://www.lri.fr/~filliatr/bibtex2html/ (I wrote a similar tool BItoSite http://cs.unibg.it/gargantini/software/bitosite/ - that I run with webgen but not automatically). I would be great to have a plugin for webgen that automatically do this. Bye Angelo Gargantini On 11/05/2009 05:04 AM, Paulo Almeida wrote: > Hi Thomas and folks, > > I want to render a list of technical references in my site, from > various sources into a single .page file. These references are now > organized as various .bib files (bibtex is a very popular format to > store references and to use them in LaTeX text processor, as most of > you may know). > > I think I will need to build a new webgen extension to deal with > bibtex format and to render it appropriately in html, but I have no > clues on how should I start from. > > Is there anything like an extension tutorial, which teaches how to > create the simplest possible extension, how to use it inside a .page > file and so on? I have been looking for this tutorial in the last days > with no success, excuse me if it already exists. > > Thx as always. Paulo > _______________________________________________ > webgen-users mailing list > webgen-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/webgen-users > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: angelo_gargantini.vcf Type: text/x-vcard Size: 217 bytes Desc: not available URL: From t_leitner at gmx.at Thu Nov 5 02:14:52 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Thu, 5 Nov 2009 08:14:52 +0100 Subject: [webgen-users] bibtex and extensions In-Reply-To: References: Message-ID: <20091105081452.434b961d@noeato> > I want to render a list of technical references in my site, from > various sources into a single .page file. These references are now > organized as various .bib files (bibtex is a very popular format to > store references and to use them in LaTeX text processor, as most of > you may know). > > I think I will need to build a new webgen extension to deal with > bibtex format and to render it appropriately in html, but I have no > clues on how should I start from. > > Is there anything like an extension tutorial, which teaches how to > create the simplest possible extension, how to use it inside a .page > file and so on? I have been looking for this tutorial in the last days > with no success, excuse me if it already exists. Have a look at the API documentation http://webgen.rubyforge.org/documentation/rdoc/index.html There you will find information about the various extensions as well as example implementations. For example, if you want to implement a new webgen tag, have a look at the documentation for the Webgen::Tag::Base module. -- Thomas From t_leitner at gmx.at Sun Nov 8 14:54:43 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Sun, 8 Nov 2009 20:54:43 +0100 Subject: [webgen-users] kramdown - fast alternative to Maruku Message-ID: <20091108205443.10c7a122@noeato.mat.univie.ac.at> Hi everybody! Most of you know that Maruku is the default markup language used in webgen since I prefer Markdown over Textile. However, Maruku has some flaws, especially when in comes to Ruby 1.9. Therefore I started developing a new pure Ruby Markdown parser around this time last year, called kramdown. I got rather far at the start but then didn't have the time to complete the project. Since there is still interest in a viable Maruku alternative I invested some more time lately and can provide a prototype now. There is currently no website but I have pushed the latest version to the GitHub repo at http://github.com/gettalong/kramdown One aspect of kramdown is that there is a detailed syntax specification. A problem I have with standard Markdown parsers is that you sometimes don't know what you will get (especially when it comes to lists). Therefore I have written a detailed specification of the syntax supported by kramdown and what the expected output will be. Naturally, the syntax is based on Markdown but has been extended to support popular extensions. Currently, kramdown passes all tests in the test suite and is already very useful. It will become the default Markdown parser in one of the next releases of webgen after I have added some minor features to kramdown. Also note that it supports nearly all features present in Maruku but is around 5 times faster ;-) If you are interested, please try kramdown and tell me if you like it, whether there should be changes in the syntax spec, which features should additionally be supported (e.g. tables, definition lists, ...) Thanks and best regards, Thomas From proven.bao at gmail.com Mon Nov 16 06:43:41 2009 From: proven.bao at gmail.com (Proven) Date: Mon, 16 Nov 2009 03:43:41 -0800 (PST) Subject: [webgen-users] Chinese Webpages Message-ID: Hi All, I'm a new user, and found that if I revise the output index.html file (use notepad to change the file code from ANSI to UTF-8), it can display Chinese character normally. But if I revise the /src file, ie, default template and index page file to UTF-8 format, it can not parse the index page file. How should I do to automatically generate Chinese web page? Appreciate. From damien.pollet at gmail.com Mon Nov 16 09:07:02 2009 From: damien.pollet at gmail.com (Damien Pollet) Date: Mon, 16 Nov 2009 15:07:02 +0100 Subject: [webgen-users] Chinese Webpages In-Reply-To: References: Message-ID: <34b4844b0911160607m189cf1f6je73526654b0a3fca@mail.gmail.com> I pasted chinese characters in my src/index.page and everything went smoothly. What code are you changing in the html file ? If you mean the meta content-type html tag, or the xml declaration, then this would be in your src/default.template file. Edit this one and all pages will be generated accordingly. Else I guess that would mean one of the filters does not like your encoding, but we'd need more details to be sure. Cheers On Mon, Nov 16, 2009 at 12:43, Proven wrote: > Hi All, > > I'm a new user, and found that if I revise the output index.html file > (use notepad to change the file code from ANSI to UTF-8), it can > display Chinese character normally. > > But if I revise the /src file, ie, default template and index page > file to UTF-8 format, it can not parse the index page file. > > How should I do to automatically generate Chinese web page? > > Appreciate. > _______________________________________________ > webgen-users mailing list > webgen-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/webgen-users > -- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet From t_leitner at gmx.at Tue Nov 17 01:16:51 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Tue, 17 Nov 2009 07:16:51 +0100 Subject: [webgen-users] Chinese Webpages In-Reply-To: References: Message-ID: <20091117071651.7758a92e@noeato.local> > But if I revise the /src file, ie, default template and index page > file to UTF-8 format, it can not parse the index page file. There could be a problem with the BOM (Byte-Order-Marker) that Notepad normally inserts into a file when saving it as UTF-8. Try using another editor that does not store the BOM. And/or run webgen with the `-v` and `-l 0` options to get more debug output which you should post here! As Damien already pointed out, there should be no problem using Chinese characters in the .template or .page files since webgen does not care about the source encoding and Maruku, the default markup processor, should handle non-ASCII characters as well. Best regards, Thomas From t_leitner at gmx.at Sat Nov 21 03:04:32 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Sat, 21 Nov 2009 09:04:32 +0100 Subject: [webgen-users] [ANN] kramdown 0.1.0 - first relase of fast, pure Ruby Markdown parser Message-ID: <20091121090432.73b901f6@noeato.local> ## kramdown 0.1.0 released This is the first release of kramdown, yet-another-Markdown parser/converter for Ruby, with the following features: * Written in pure Ruby, no need to compile an extension (like BlueCloth or rdiscount) * Fast (current impl ~5x faster than Maruku, ~10x faster than BlueFeather, although ~30x slower than native code like rdiscount) * Strict syntax definition (special cases for which the original Markdown page does not account for are explicitly listed and it is shown how kramdown parses them - see the [Syntax] page) * Supports common Markdown extension (similar to Maruku) [Syntax]: http://kramdown.rubyforge.org/syntax.html ## About kramdown kramdown is a *free* GPL-licensed [Ruby](http://www.ruby-lang.org) library for parsing Markdown-like syntax. It is completely written in Ruby, supports standard Markdown (with some minor modifications) and various extensions that have been made popular by the PHP Markdown Extra package and Maruku. Homepage for installation instructions and documentation: http://kramdown.rubyforge.org From t_leitner at gmx.at Sat Nov 21 03:05:28 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Sat, 21 Nov 2009 17:05:28 +0900 Subject: [webgen-users] [ANN] kramdown 0.1.0 - first relase of fast, pure Ruby Markdown parser Message-ID: <20091121090432.73b901f6@noeato.local> ## kramdown 0.1.0 released This is the first release of kramdown, yet-another-Markdown parser/converter for Ruby, with the following features: * Written in pure Ruby, no need to compile an extension (like BlueCloth or rdiscount) * Fast (current impl ~5x faster than Maruku, ~10x faster than BlueFeather, although ~30x slower than native code like rdiscount) * Strict syntax definition (special cases for which the original Markdown page does not account for are explicitly listed and it is shown how kramdown parses them - see the [Syntax] page) * Supports common Markdown extension (similar to Maruku) [Syntax]: http://kramdown.rubyforge.org/syntax.html ## About kramdown kramdown is a *free* GPL-licensed [Ruby](http://www.ruby-lang.org) library for parsing Markdown-like syntax. It is completely written in Ruby, supports standard Markdown (with some minor modifications) and various extensions that have been made popular by the PHP Markdown Extra package and Maruku. Homepage for installation instructions and documentation: http://kramdown.rubyforge.org From thomas at deselaers.de Fri Nov 27 18:21:49 2009 From: thomas at deselaers.de (Thomas Deselaers) Date: Sat, 28 Nov 2009 00:21:49 +0100 Subject: [webgen-users] webgen and bibtex Message-ID: Dear all, I have seen some discussions regarding webgen and bibtex on the mailinglist and in the forum. Did anybody start with this? I would be greatly interested in using and probably could help in developing it. Cheers, thomas -- http://thomas.deselaers.de From damien.pollet at gmail.com Sat Nov 28 09:35:46 2009 From: damien.pollet at gmail.com (Damien Pollet) Date: Sat, 28 Nov 2009 15:35:46 +0100 Subject: [webgen-users] webgen, include files and "static-changing" pages In-Reply-To: <20091027124423.65144223@noeato> References: <44361556-6878-4ab6-ba65-33905a659308@d34g2000vbm.googlegroups.com> <20091024194659.083c4349@noeato> <20091027124423.65144223@noeato> Message-ID: <34b4844b0911280635y7a634555g51b67096c70f6a90@mail.gmail.com> Hi all, I've been adapting the code here for myself. I have foo.blog pages for entries, and an index page that lists them. In config.yaml I added this: patterns: Page: add: ["**/*.blog"] so that entries are treated like normal pages. But in the output I get foo.blog files that contain the generated html, whereas the bar.page files produce bar.html. Contents is good, but name is wrong? Also, a remark; in the index page I have this: <% pages = context.content_node.tree.node_access[:alcn].select{ |alcn,no| alcn =~ /\d{4}\/.*\.blog/ && no.is_file? } pages = pages.collect{ |na,no| no}.sort{ |a,b| b['date'] <=> a['date'] } pages.each do |node| %> ... display stuff from the entry? <% end %> Here I'm not sure I understand the logic? we're selecting nodes from the rendered output, but get data from the input? Instead, how could I iterate over src nodes? How can I get the src node from an output node (or reverse)? Could I access the original markdown code for a node? Here I think I do not have a clear idea how input nodes get transformed, if they generate nodes for each stage in the rendering pipeline, etc? I've been looking through the documentation but it didn't really help me understand the model behind the generation process? Cheers On Tue, Oct 27, 2009 at 12:44, Thomas Leitner wrote: >> ? Ok, again it works, with some minor problems and corrections: >> ? 1. Instead of >> ? ? ?>>> ? ? ? ? ? ? ? ?

<%= node.title %>

>> >> ? ? ? I am using >> ? ? ?>>> ? ? ? ? ? ? ? ? ?

<%= node['routed_title'] %>

> > That's okay but `routed_title` is normally only defined for directory > index files. So you might want to use something like > > ? ?

<%= node['routed_title'] || node['title'] %>

> > And `node.title` naturally doesn't work ;-) My fault, sorry! > >> ? 2. One problem I could not solve yet is the next line: >> ? ? ? >>> ?Published on <%= node['created_at'].strftime("%A, %d %B >> %Y") %> - >> >> ? ? ? I keep getting error messages saying that some "nil" class >> doesn't know the >> ? ?strftime method. But I can live without this. > > Try using the meta information `modified_at` instead of `created_at`. > The former is available on all nodes while the latter has to be set > individually since it cannot be derived. > >> ? 3. Another one is as follows: my FNP includes, on top of actual >> headlines from my news, a "fake" >> ? ? ?headline containing title of the index.html page on my "news" >> folder. I tried using "in_menu: false" >> ? ? ?and "no_output: true", but without success as of now. In summary, >> if I have N news in the folder, >> ? ? ?I get N+1 headlines in my FNP, and the first one is a fake news >> corresponding to the index page. > > Ah, okay. If all page files in your "news" folder are news files except > the index.page, you can use the following (replace the fomer version): > > <% > context.content_node.tree.node_access[:alcn].select do |alcn,no| > ?alcn =~ /\/news\/.*\.html/ && no.is_file? && no.acn != '/news/index.html' > <--- HERE COMES THE REST FROM THE OTHER POST > > If you need any further help, just write again :-) > > Best regards, > ?Thomas > _______________________________________________ > webgen-users mailing list > webgen-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/webgen-users > -- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet From t_leitner at gmx.at Sat Nov 28 11:17:36 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Sat, 28 Nov 2009 17:17:36 +0100 Subject: [webgen-users] webgen, include files and "static-changing" pages In-Reply-To: <34b4844b0911280635y7a634555g51b67096c70f6a90@mail.gmail.com> References: <44361556-6878-4ab6-ba65-33905a659308@d34g2000vbm.googlegroups.com> <20091024194659.083c4349@noeato> <20091027124423.65144223@noeato> <34b4844b0911280635y7a634555g51b67096c70f6a90@mail.gmail.com> Message-ID: <20091128171736.5b801bb7@noeato> > I've been adapting the code here for myself. I have foo.blog pages for > entries, and an index page that lists them. In config.yaml I added > this: > > patterns: > Page: > add: ["**/*.blog"] > > so that entries are treated like normal pages. But in the output I get > foo.blog files that contain the generated html, whereas the bar.page > files produce bar.html. Contents is good, but name is wrong? This is intentional if you look in the source for the page handler. The extension is only changed to .html if it was .page. However, since you can override how output names are created this is easily fixed; just add the following to a metainfo file: --- name:paths **/*.blog: output_path_style: [:parent, :basename, ['.', :lang], .html] > Also, a remark; in the index page I have this: > > <% > pages = context.content_node.tree.node_access[:alcn].select{ > |alcn,no| alcn =~ /\d{4}\/.*\.blog/ && no.is_file? } > pages = pages.collect{ |na,no| no}.sort{ |a,b| b['date'] <=> > a['date'] } pages.each do |node| > %> > ... display stuff from the entry? > <% end %> > > Here I'm not sure I understand the logic? we're selecting nodes from > the rendered output, but get data from the input? Instead, how could I > iterate over src nodes? How can I get the src node from an output node > (or reverse)? Could I access the original markdown code for a node? > Here I think I do not have a clear idea how input nodes get > transformed, if they generate nodes for each stage in the rendering > pipeline, etc? I've been looking through the documentation but it > didn't really help me understand the model behind the generation > process? The code does the following: * `context.content_node.tree` returns the internal node tree representation, * `.node_access[:alcn]` returns the hash with the mappings from alcn to Node objects * `.select {...}` selects all file nodes which have a certain alcn (in this case files with four digits, then anything and then .blog) So the `pages` variable contains an array with [alcn, node] pairs of all blog pages. After that * `collect{...}` removes the `alcn` part from the list, * `sort{...}` sorts the nodes by their meta information `date` * `each do ... end` uses the nodes to actually display stuff from the entry What you might not know is that the internal node tree does not contain the source paths! Each source path can create 0..n nodes and these nodes are added to the node tree. Therefore each node is created by exactly one source path (the source path can be retrieved using `node.node_info[:src]`; note that this is a string; to actually get the source Path object for it you have to use `website.blackboard.invoke(:source_paths)[node.node_info[:src]]`). So you have a mapping from one source path (a Webgen::Path object) to zero, one or more Wegen::Node objects which may or may not (depending on the source handler) be written to the output directory. For example, a .page source file currently maps to exactly one node which will be written to the output directory. A .metainfo source file also maps to one node but will not be written to the output. And a .virtual file maps to one or more nodes. If you want to iterate over all source paths, you can use the Hash object returned by `website.blackboard.invoke(:source_paths)`. However, I can't currently of a situation where you want to do this... If you want to get the unprocessed source of a page node, you can use `node.node_info[:page]` attribute which returns a Webgen::Page object. Hopes this helps a bit in understanding the internal workings of webgen! -- Thomas From t_leitner at gmx.at Sat Nov 28 11:24:19 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Sat, 28 Nov 2009 17:24:19 +0100 Subject: [webgen-users] 3rd party webgen blog example Message-ID: <20091128172419.70564e5d@noeato> Hi everyone, since I still didn't have the time to create a blog handler, you may want to have a look at [Matteo Collina's website][1]. I stumbled across his website and saw that he was using webgen with some extension to create a blog, see his [blog entry][2], and what's more, the source for his webgen website is available in his [github repository][3]. This seems to be a very good starting point for creating blogs with webgen! Cheers, Thomas [1]: http://matteocollina.com/index.html [2]: http://matteocollina.com/blog/2009/09/22/a_static_blog.html [3]: http://github.com/mcollina/website From damien.pollet at gmail.com Sun Nov 29 06:54:11 2009 From: damien.pollet at gmail.com (Damien Pollet) Date: Sun, 29 Nov 2009 12:54:11 +0100 Subject: [webgen-users] webgen, include files and "static-changing" pages In-Reply-To: <20091128171736.5b801bb7@noeato> References: <44361556-6878-4ab6-ba65-33905a659308@d34g2000vbm.googlegroups.com> <20091024194659.083c4349@noeato> <20091027124423.65144223@noeato> <34b4844b0911280635y7a634555g51b67096c70f6a90@mail.gmail.com> <20091128171736.5b801bb7@noeato> Message-ID: <34b4844b0911290354g79f39820s85a597fc4c229bb@mail.gmail.com> On Sat, Nov 28, 2009 at 17:17, Thomas Leitner wrote: > This is intentional if you look in the source for the page handler. The > extension is only changed to .html if it was .page. OK. I expected a general way to map the source extensions to output ones, but it's true that the feed handler generates both atom and rss? > * `.node_access[:alcn]` returns the hash with the mappings from alcn to > ?Node objects Just a design detail here (I'm an OO weenie I guess :D), but why don't nodes know their alcn? Wouldn't ?tree.select { |node| node.alcn =~ ?} read nicer? It would also make the following collect unnecessary. With mappings, it does feels strange at first to duplicate the hash key into the value, but I often found it leads to simpler use afterwards. Especially true if there are multiple kinds of keys that make sense depending on the context (I suppose you can do node_access[:lcn] or similar). > exactly one source path (the source path can be retrieved using > `node.node_info[:src]`; note that this is a string; to actually get the > source Path object for it you have to use > `website.blackboard.invoke(:source_paths)[node.node_info[:src]]`). Again, why store the string when the node could directly know its Path (and here I suppose the path can be flattened back to a string) > Hopes this helps a bit in understanding the internal workings of webgen! Yup, very much, thanks! -- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet From damien.pollet at gmail.com Sun Nov 29 07:05:44 2009 From: damien.pollet at gmail.com (Damien Pollet) Date: Sun, 29 Nov 2009 13:05:44 +0100 Subject: [webgen-users] Adding links to the head? Message-ID: <34b4844b0911290405ka8b8034u73e02cfdd3d97c36@mail.gmail.com> Hi, I see the head content processor can attach JS and CSS elements in the head of a given page, but what about the Hi, I created a new webpage with webgen, and I really like it. Great work. I just restructured my src directory in order to make it a bit cleaner and therefore wanted to have files deleted if their source is not existing anymore. Therefore, I added output.do_deletion: true to config.yaml With this enabled, I get this error: Starting webgen... Updating tree... An error has occurred: Error while working: No such file or directory - MYDIRECTORY/out/publications/all_publications.html#journal_articles Although, I did not even change this file When removing the output.do_deletion configuration, everything works smoothly. any hints, what I am doing wrong? cheers, thomas -- http://thomas.deselaers.de From t_leitner at gmx.at Sun Nov 29 15:27:55 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Sun, 29 Nov 2009 21:27:55 +0100 Subject: [webgen-users] webgen, include files and "static-changing" pages In-Reply-To: <34b4844b0911290354g79f39820s85a597fc4c229bb@mail.gmail.com> References: <44361556-6878-4ab6-ba65-33905a659308@d34g2000vbm.googlegroups.com> <20091024194659.083c4349@noeato> <20091027124423.65144223@noeato> <34b4844b0911280635y7a634555g51b67096c70f6a90@mail.gmail.com> <20091128171736.5b801bb7@noeato> <34b4844b0911290354g79f39820s85a597fc4c229bb@mail.gmail.com> Message-ID: <20091129212755.44fc6dcd@noeato> > > * `.node_access[:alcn]` returns the hash with the mappings from > > alcn to Node objects > > Just a design detail here (I'm an OO weenie I guess :D), but why don't > nodes know their alcn? > Wouldn't ?tree.select { |node| node.alcn =~ ?} read nicer? It would > also make the following collect unnecessary. > > With mappings, it does feels strange at first to duplicate the hash > key into the value, but I often found it leads to simpler use > afterwards. Especially true if there are multiple kinds of keys that > make sense depending on the context (I suppose you can do > node_access[:lcn] or similar). Actually, there is a method called `node.alcn` which returns the alcn of a node. However, the tree has a hash for directly accessing the Node object by knowing its alcn. This is useful in a number of cases, for example, when checking if a node alcn is unique or when you only have an alcn and want to get the node. Otherwise I would have to search through the whole tree to get the correct node for an alcn. > > exactly one source path (the source path can be retrieved using > > `node.node_info[:src]`; note that this is a string; to actually get > > the source Path object for it you have to use > > `website.blackboard.invoke(:source_paths)[node.node_info[:src]]`). > > Again, why store the string when the node could directly know its Path > (and here I suppose the path can be flattened back to a string) This has another reason: a source Path object needs access to the source of a path (normally a file but could potentially be something else, for example, a database) and therefore it has an IO object attached. This brings a problem when serializing the whole node tree into the cache file since IO objects can't serialized! Therefore only the string version of the source path is stored in a Node. -- Thomas From t_leitner at gmx.at Mon Nov 30 01:20:37 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Mon, 30 Nov 2009 07:20:37 +0100 Subject: [webgen-users] problem with output.do_deletion: true In-Reply-To: References: Message-ID: <20091130072037.49f88cf9@noeato> > Therefore, I added > output.do_deletion: true > to config.yaml > > With this enabled, I get this error: > > Starting webgen... > Updating tree... > An error has occurred: > Error while working: > No such file or directory - > MYDIRECTORY/out/publications/all_publications.html#journal_articles > > Although, I did not even change this file > > When removing the output.do_deletion configuration, everything works > smoothly. > > any hints, what I am doing wrong? From the error message and the given path, I think you are doing nothing wrong - it's webgen fault. The path can't actually exist on the filesystem since it is a fragment path, ie. part of a file path. I have added a TODO item and will fix this in the next release. What you should know about `output.do_deletion` is that it can only delete files if knows about, ie. which are in the cached tree (normally stored in the file webgen.cache). If you have already run webgen without the option set to `true`, then the old files won't be deleted anymore since webgen doesn't know about them anymore. The simplest thing you can do then is to delete the output directory and the webge.cache file and run webgen again. -- Thomas From t_leitner at gmx.at Mon Nov 30 01:16:29 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Mon, 30 Nov 2009 07:16:29 +0100 Subject: [webgen-users] Adding links to the head? In-Reply-To: <34b4844b0911290405ka8b8034u73e02cfdd3d97c36@mail.gmail.com> References: <34b4844b0911290405ka8b8034u73e02cfdd3d97c36@mail.gmail.com> Message-ID: <20091130071629.17ab32f8@noeato> > I see the head content processor can attach JS and CSS elements in the > head of a given page, but what about the RSS and Atom feed auto-discovery? (or for next/up/prev pages, though I > don't know if that is actually used by browsers) This is currently not implemented but should be easy to add. What should be supported by webgen? And how? Any ideas? -- Thomas From thomas at deselaers.de Mon Nov 30 03:09:47 2009 From: thomas at deselaers.de (Thomas Deselaers) Date: Mon, 30 Nov 2009 09:09:47 +0100 Subject: [webgen-users] problem with output.do_deletion: true In-Reply-To: <20091130072037.49f88cf9@noeato> References: <20091130072037.49f88cf9@noeato> Message-ID: On Mon, Nov 30, 2009 at 07:20, Thomas Leitner wrote: >> Therefore, I added >> output.do_deletion: true >> to config.yaml >> >> With this enabled, I get this error: >> >> Starting webgen... >> Updating tree... >> An error has occurred: >> ? Error while working: >> ? ? No such file or directory - >> MYDIRECTORY/out/publications/all_publications.html#journal_articles >> >> Although, I did not even change this file >> >> When removing the output.do_deletion configuration, everything works >> smoothly. >> >> any hints, what I am doing wrong? > > >From the error message and the given path, I think you are doing > nothing wrong - it's webgen fault. The path can't actually exist on the > filesystem since it is a fragment path, ie. part of a file path. > > I have added a TODO item and will fix this in the next release. Great. Thanks. > What you should know about `output.do_deletion` is that it can only > delete files if knows about, ie. which are in the cached tree (normally > stored in the file webgen.cache). If you have already run webgen > without the option set to `true`, then the old files won't be deleted > anymore since webgen doesn't know about them anymore. The simplest > thing you can do then is to delete the output directory and the > webge.cache file and run webgen again. I did nearly that. I only deleted the out directory, not the cache. I will retry. Thanks, thomas -- http://thomas.deselaers.de From thomas at deselaers.de Mon Nov 30 03:39:19 2009 From: thomas at deselaers.de (Thomas Deselaers) Date: Mon, 30 Nov 2009 09:39:19 +0100 Subject: [webgen-users] webgen and bibtex In-Reply-To: References: Message-ID: Dear all, To keep you up to date: Since I only need this feature to migrate from drupal to webgen, i.e. I only want to generate a complete list of publications once and can then maintain it manually, I did the following: 1. create a list of publications with latex, biblatex (not bibtex). 2. format it as dvi 3. use dvi2tty to make a textfile from it. 4. manually edit this file (i.e. adding links to the PDFs of the papers and slighly edit it. Overall took about 1 hour and led to the result I wanted. In particular it is now easily tweaked to my liking. Cheers, thomas On Sat, Nov 28, 2009 at 00:21, Thomas Deselaers wrote: > Dear all, > > I have seen some discussions regarding webgen and bibtex on the > mailinglist and in the forum. > > Did anybody start with this? I would be greatly interested in using > and probably could help in developing it. > > Cheers, > thomas > > -- > http://thomas.deselaers.de > -- http://thomas.deselaers.de From damien.pollet at gmail.com Mon Nov 30 03:56:32 2009 From: damien.pollet at gmail.com (Damien Pollet) Date: Mon, 30 Nov 2009 09:56:32 +0100 Subject: [webgen-users] Adding links to the head? In-Reply-To: <20091130071629.17ab32f8@noeato> References: <34b4844b0911290405ka8b8034u73e02cfdd3d97c36@mail.gmail.com> <20091130071629.17ab32f8@noeato> Message-ID: <34b4844b0911300056x53e303ddme0934686a417f809@mail.gmail.com> On Mon, Nov 30, 2009 at 07:16, Thomas Leitner wrote: >> I see the head content processor can attach JS and CSS elements in the >> head of a given page, but what about the > RSS and Atom feed auto-discovery? (or for next/up/prev pages, though I >> don't know if that is actually used by browsers) > > This is currently not implemented but should be easy to add. What > should be supported by webgen? And how? Any ideas? Well at least the Probably a generic metadata syntax for this element is enough, but since there is already metainfo keys for JS and CSS, maybe specific ones for the most common use cases as well (rss/atom feeds, maybe alternate languages (that could be set automatically when there are several localized versions of the same page), or navigation links (next/prev by sort_info, up to parent directories?) -- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet From thomas at deselaers.de Mon Nov 30 04:29:11 2009 From: thomas at deselaers.de (Thomas Deselaers) Date: Mon, 30 Nov 2009 10:29:11 +0100 Subject: [webgen-users] bug in setting selected menu item Message-ID: Dear all, I just noticed that in the default style (andreas07?) the selected-class ( webgen-menu-item-selected) is only set correctly for pages that are not in subdirectories. i.e. I have src/index.page where title is set to: home a/index.page A b/index.page B and the menu looks like home A B then the menuitem is marked correctly (webgen-menu-item-selected) only for the home page and for none of the others. Is this intentional, can I change this? Thanks, thomas -- http://thomas.deselaers.de From thomas at deselaers.de Mon Nov 30 07:53:28 2009 From: thomas at deselaers.de (Thomas Deselaers) Date: Mon, 30 Nov 2009 13:53:28 +0100 Subject: [webgen-users] webgen, downloads and google analytics Message-ID: Dear all, Maybe someone (Thomas?) has an idea how to achieve this. I log traffic to my website using google analytics. Now I would like to also count the downloads of files. Google describes that this can be done by adding a javascript-snippet to each download link: http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55529 Can someone tell me, how I could automatically have something similar attached to every non-html-link in my page? Cheers, Thanks, thomas -- http://thomas.deselaers.de From t_leitner at gmx.at Mon Nov 30 09:50:26 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Mon, 30 Nov 2009 15:50:26 +0100 Subject: [webgen-users] bug in setting selected menu item In-Reply-To: References: Message-ID: <20091130155026.08a6c217@noeato.local> > I just noticed that in the default style (andreas07?) the > selected-class ( webgen-menu-item-selected) is only set correctly for > pages that are not in subdirectories. This seems to be a bug in the CSS stylesheet. Since the menu uses just level 1 items, the menu entry for the index page itself is not displayed, just the menu item for the directory. Therefore the class webgen-menu-item-selected is not set. However, the stylesheet should also highlight the menu item if it has the style webgen-menu-submenu-inhierarchy. Will be fixed for the next release! -- Thomas From t_leitner at gmx.at Mon Nov 30 10:01:34 2009 From: t_leitner at gmx.at (Thomas Leitner) Date: Mon, 30 Nov 2009 16:01:34 +0100 Subject: [webgen-users] webgen, downloads and google analytics In-Reply-To: References: Message-ID: <20091130160134.790fc73a@noeato.local> > I log traffic to my website using google analytics. Now I would like > to also count the downloads of files. > > Google describes that this can be done by adding a javascript-snippet > to each download link: > > http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55529 > > Can someone tell me, how I could automatically have something similar > attached to every non-html-link in my page? Hmm... if this is something static for each file, you could just use the `link_attrs` meta information. For example, say you have a file src/download/my.pdf. Then add a metainfo file src/download/metainfo with the following content: --- name:alcn my.pdf: link_attrs: onClick: "javascript: pageTracker._trackPageview('/downloads/map');" Then every link generated by webgen (for example, via the menu, breadcrumb trail and link tags) will have an `onClick` attribute with the specified value. From what I read from the provided page, the `/downloads/map` part has to be different for each file. Since webgen doesn't allow dynamic code in the `link_attrs` meta information, you would need to set this meta information for all files manually. Or you overwrite the Node#link_to method in an extension to dynamically generate the `onClick` attribute. -- Thomas From thomas at deselaers.de Mon Nov 30 12:34:52 2009 From: thomas at deselaers.de (Thomas Deselaers) Date: Mon, 30 Nov 2009 18:34:52 +0100 Subject: [webgen-users] webgen, downloads and google analytics In-Reply-To: <20091130160134.790fc73a@noeato.local> References: <20091130160134.790fc73a@noeato.local> Message-ID: On Mon, Nov 30, 2009 at 16:01, Thomas Leitner wrote: >> I log traffic to my website using google analytics. Now I would like >> to also count the downloads of files. >> >> Google describes that this can be done by adding a javascript-snippet >> to each download link: >> >> http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55529 >> >> Can someone tell me, how I could automatically have something similar >> attached to every non-html-link in my page? > > Hmm... if this is something static for each file, you could just use > the `link_attrs` meta information. That sounds great. > For example, say you have a file src/download/my.pdf. Then add a > metainfo file src/download/metainfo with the following content: > > --- name:alcn > my.pdf: > ?link_attrs: > ? ?onClick: "javascript: pageTracker._trackPageview('/downloads/map');" I added this for one of the PDFs, but the generated html files are not changed at all. Do I have to mark the links in a special way. here is a snippet from my list [from publications/index.page]: * Thomas Deselaers, Daniel Keysers, and Hermann Ney. [Features for Image Retrieval: An Experimental Comparison]. In: Information Retrieval 11.2 (2008), pp. 77-107. [Features for Image Retrieval: An Experimental Comparison]: papers/deselaers_infret08.pdf then I have this in my metainfo file: /publications/papers/deselaers_infret08.pdf: link_attrs: {onClick: "javascript: pageTracker._trackPageview('/downloads/belle_icpr08');"} and of course the publications/papers/deselaers_infret08.pdf file exists. Oh, and to let you know, I already switched to this new page for my personal webpage. webgen is really very convenient and much easier and faster to learn than any of the other tools I used before. Tahnks a lot. thomas > Then every link generated by webgen (for example, via the menu, > breadcrumb trail and link tags) will have an `onClick` attribute with > the specified value. > > >From what I read from the provided page, the `/downloads/map` part has > to be different for each file. Since webgen doesn't allow dynamic code > in the `link_attrs` meta information, you would need to set this meta > information for all files manually. Or you overwrite the Node#link_to > method in an extension to dynamically generate the `onClick` attribute. > > -- Thomas > _______________________________________________ > webgen-users mailing list > webgen-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/webgen-users > -- http://thomas.deselaers.de From thomas at deselaers.de Mon Nov 30 16:11:12 2009 From: thomas at deselaers.de (Thomas Deselaers) Date: Mon, 30 Nov 2009 22:11:12 +0100 Subject: [webgen-users] bug in setting selected menu item In-Reply-To: <20091130155026.08a6c217@noeato.local> References: <20091130155026.08a6c217@noeato.local> Message-ID: On Mon, Nov 30, 2009 at 15:50, Thomas Leitner wrote: >> I just noticed that in the default style (andreas07?) the >> selected-class ( webgen-menu-item-selected) is only set correctly for >> pages that are not in subdirectories. > > This seems to be a bug in the CSS stylesheet. Since the menu uses just > level 1 items, the menu entry for the index page itself is not > displayed, just the menu item for the directory. Therefore the class > webgen-menu-item-selected is not set. However, the stylesheet should > also highlight the menu item if it has the style > webgen-menu-submenu-inhierarchy. Will be fixed for the next release! > great. thanks a lot. looking forward to the new release. cheers, thomas -- http://thomas.deselaers.de From thomas at deselaers.de Mon Nov 30 16:43:01 2009 From: thomas at deselaers.de (Thomas Deselaers) Date: Mon, 30 Nov 2009 22:43:01 +0100 Subject: [webgen-users] webgen, downloads and google analytics In-Reply-To: References: <20091130160134.790fc73a@noeato.local> Message-ID: On Mon, Nov 30, 2009 at 18:34, Thomas Deselaers wrote: > On Mon, Nov 30, 2009 at 16:01, Thomas Leitner wrote: >>> I log traffic to my website using google analytics. Now I would like >>> to also count the downloads of files. >>> >>> Google describes that this can be done by adding a javascript-snippet >>> to each download link: >>> >>> http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55529 >>> >>> Can someone tell me, how I could automatically have something similar >>> attached to every non-html-link in my page? >> >> Hmm... if this is something static for each file, you could just use >> the `link_attrs` meta information. > > That sounds great. > >> For example, say you have a file src/download/my.pdf. Then add a >> metainfo file src/download/metainfo with the following content: >> >> --- name:alcn >> my.pdf: >> ?link_attrs: >> ? ?onClick: "javascript: pageTracker._trackPageview('/downloads/map');" > > > I added this for one of the PDFs, but the generated html files are not > changed at all. > > > Do I have to mark the links in a special way. > > here is a snippet from my list > > [from publications/index.page]: > * ?Thomas Deselaers, Daniel Keysers, and Hermann Ney. > ? [Features for Image Retrieval: An Experimental Comparison]. > ? In: Information Retrieval ?11.2 (2008), pp. 77-107. > ? [Features for Image Retrieval: An Experimental Comparison]: > papers/deselaers_infret08.pdf > > then I have this in my metainfo file: > > /publications/papers/deselaers_infret08.pdf: > ? link_attrs: > ? ? ?{onClick: "javascript: > pageTracker._trackPageview('/downloads/belle_icpr08');"} > > and of course the > publications/papers/deselaers_infret08.pdf > file exists. > > > Oh, and to let you know, I already switched to this new page for my > personal webpage. > webgen is really very convenient and much easier and faster to learn > than any of the other tools I used before. Hi Thomas and others, I played a bit more with it. Unfortunately I didn't manage to make it work. I have tried various variations in which metainfo file [directly in src, in a subdirectory, and in the subdirectory in which the files that I link to reside], but none of them works. however, I found a way to generate an appropriate metainfo file fully automatically: (echo "--- name:alcn"; for i in *.pdf ; do echo -e "$i:\n link_attrs:\n onClick: \"javascript:pageTracker._trackPageview('publications/papers/$i')\"\n\n" ; done) > metainfo Then I also tried to make the link relocatable. That works fine, but it did not help to get the link attributes set. So, your help is greatly appreciated. Thanks, thomas -- http://thomas.deselaers.de From deselaers at vision.ee.ethz.ch Fri Nov 27 18:06:16 2009 From: deselaers at vision.ee.ethz.ch (Thomas Deselaers) Date: Sat, 28 Nov 2009 00:06:16 +0100 Subject: [webgen-users] webgen and bibtex Message-ID: Dear all, I have seen some discussions regarding webgen and bibtex on the mailinglist and in the forum. Did anybody start with this? I would be greatly interested in using and probably could help in developing it. Cheers, thomas -- http://thomas.deselaers.de