Andrea Censi
2007-Mar-04 21:03 UTC
[webgen-users] Maruku + webgen - access to meta-information from content converter
Hi! I am the author of Maruku (http://maruku.rubyforge.org/), a Markdown-superset interpreter. At the moment I am 1) learning webgen 2) integrating Maruku+webgen 3) converting my website to webgen, so I have many questions (one question, one message). First one: I wrote the straightforward maruku.rb converter (see attachment). In a content converter, how can I access the meta-information of the page? Maruku has many configuration options, and I want to take advantage of webgen''s system, so that I can define defaults in config.yaml, etc. -- Andrea Censi "Life is too important to be taken seriously" (Oscar Wilde) Web: http://www.dis.uniroma1.it/~censi
Thomas Leitner
2007-Mar-05 10:29 UTC
[webgen-users] Maruku + webgen - access to meta-information from content converter
Hi,> At the moment I am > > 1) learning webgen > 2) integrating Maruku+webgen > 3) converting my website to webgen, > > so I have many questions (one question, one message).I will try to answer all your questions :)> First one: I wrote the straightforward maruku.rb converter (see > attachment). > In a content converter, how can I access the meta-information of > the page? > > Maruku has many configuration options, and I want to take advantage of > webgen''s system, so that I can define defaults in config.yaml, etc.A content converter in webgen is just a piece of code which takes a string and converts it to HTML. Therefore it can not only be used by the class handling files in WebPage Format but also everywhere else. However, this also means that it does not know of the concept of a page file. So it cannot access the meta-information of the page. However, changing the content converters to take an optional argument with an options hash should not be too hard. Then the value of the meta information key contentOptions (any better naming ideas?) could be passed to the content converter. Bye, Thomas