Damien Robert
2009-Sep-17 13:46 UTC
[webgen-users] Metainformation depending on the langage
Hello everyone. 1) A question: I am wondering, is there a way to specify a meta information according to the langage? To give an example, i have a site www that is both in french and in english. Inside this site, the directory www/french contains pages only in french. So i would like two meta-infos: --- french /french/ in_menu: true --- english /french/ in_menu: false index_path: ~ #To get rid of the warning there is no index.en.html But i didn''t find how to specify such metainfo since directory are not localized. I tried to create a file metainfo.en, metainfo.fr, but they are not read (i think). My current solution is to create a virtual /french/index.en.html that links to /french/index.fr.html 2) A feature request: To continue with the same example, suppose i have only a file index.fr.html in /french/. I don''t wont the menu to be /french/index.fr.html (this is a bit redondant), so i set in_menu: false for /french/index.fr.html However, since this is the only file in /french/ i have to set a metainfo file: /french/ in_menu: true It would be more convienent to have an option to specify this directly in index.fr.html, like routed_title: --- in_menu: false routed_title: fran?ais routed_in_menu: true Could it be possible to implement this (i may try to produce a patch if you haven''t the time) 3) Another feature request In the langbar (with the current_lang option set to true), could it be possible to put a class="webgen-current-lang" for the current lang? (to highlight it with css after) 4) I think i saw one of your mail where you said you were working on a new content processor. Are you still working on it? I would be interested in trying an alpha-version. Maruku is quite bugged (indentations for list and for word list behave differently), and Redcloth doesn''t support mathml. Thanks a lot! -- Damien Robert http://www.normalesup.org/~robert/ (a website generated by the wonderfull webgen program ;))
Thomas Leitner
2009-Sep-19 10:54 UTC
[webgen-users] Metainformation depending on the langage
> 1) A question: > > I am wondering, is there a way to specify a meta information > according to the langage?Since only files can be localized, you can set meta information on the localized files, for example, on index.en.html and index.fr.html. Since these are two different files, you can set different meta information for them.> To give an example, i have a site www that is both in french and in > english. Inside this site, the directory www/french contains pages > only in french. So i would like two meta-infos: > > --- french > /french/ > in_menu: true > > --- english > /french/ > in_menu: false > index_path: ~ #To get rid of the warning there is no index.en.html > > But i didn''t find how to specify such metainfo since directory are not > localized. I tried to create a file metainfo.en, metainfo.fr, but > they are not read (i think). > > My current solution is to create a virtual /french/index.en.html that > links to /french/index.fr.htmlYou wouldn''t use this setup when using webgen. Normally, you just have the index.en.page and index.fr.page files in the src/ directory side-by-side. You don''t need to create an extra directory called french/ or english/. In your example, why do you need a virtual /french/index.en.html file in the french/ directory? At the beginning you said that the french/ directory contains only french pages... Could you explain your example a bit more? Concerning webgen menus created by the menu tag: such menus are always localized, ie. english pages only appear in the english menu tree and french on in the french menu tree.> 2) A feature request: > > To continue with the same example, suppose i have only a file > index.fr.html in /french/. I don''t wont the menu to > be /french/index.fr.html (this is a bit redondant), so i set > in_menu: false > for /french/index.fr.html > > However, since this is the only file in /french/ i have to set a > metainfo file: > /french/ > in_menu: true > > It would be more convienent to have an option to specify this > directly in index.fr.html, like routed_title: > > --- > in_menu: false > routed_title: fran?ais > routed_in_menu: true > > Could it be possible to implement this (i may try to produce a patch > if you haven''t the time)Should certainly be possible, however, we should possibly think about this in a more general way: a directory is unlocalized but may have localized meta information (title, in_menu, ...). Problem is: the current way routed_title is handled can not easily be generalized to in_menu or other (perhaps unknown) meta information keys. I have added an item to my TODO list.> 3) Another feature request > > In the langbar (with the current_lang option set to true), could it be > possible to put a class="webgen-current-lang" for the current lang? > (to highlight it with css after)I have added this to my TODO list, no problem to implement.> 4) > > I think i saw one of your mail where you said you were working on a > new content processor. Are you still working on it? I would be > interested in trying an alpha-version. > > Maruku is quite bugged (indentations for list and for word list behave > differently), and Redcloth doesn''t support mathml.Yeah, I did some work on kramdown last month. It works, sort of. However, I came to a halt when trying to implement syntax evaluation in HTML block/span elements... What I did last month was to go over the kramdown spec document and fix places where its behaviour was not known and to see how syntax evaluation in HTML block/span elements can be done nicely. Basically, kramdown is a Markdown interpreter. However, since I do not agree with all syntax decisions, I have written the kramdown spec document in which all syntax elements of kramdown are document exactly, not only how they are used but also how the output will look like - the latter is not the case with standard Markdown. Also, standard Markdown lacks many things implemented in Maruku, PHP Markdown Extra, MultiMarkdown, pandoc..., many of these extension will also be in kramdown. So, to sump up, kramdown will be similar to Maruku but aims to provide a strict syntax based on Markdown with pre-known outputs for all elements. And it aims to be faster ;-) (currently about twice as fast as Maruku but still *way* slower than rdiscount - beware that these are preliminary results). I will probably put up the kramdown spec document on the website and sync my personal git repo to rubyforge in the near future when I''m satisfied with the state. Will let you know when an alpha version is available. -- Thomas