Re: [Rest2web-develop] Multiple templates, same content
Brought to you by:
mjfoord
From: Fuzzyman <fuz...@vo...> - 2006-02-23 09:24:03
|
Donald J. Welch wrote: > Hello, > I'm attempting to use rest2web to completely redesign our website > (hpinkjet.sf.net) to be more easily updated and managed. > > One requirement that I have is that I need to be able to create 2 > separate sets of HTML pages that have a completely different > look-and-feel (one for the website and one to be included in our tarball > that will eventually be converted to PDF). > > I currently see no way to pass-in or otherwise externally influence the > template that will be used during a run of r2w.py since it is specified > statically, with the content, in the restindex. The only way I can see > to do this is to copy the first template in place, run r2w with one > config file and then overwrite the template file and run r2w again with > a second config file (to be able to change the output directory). > > Is there a more elegant way to accomplish this? Can I make the template > programmable/dynamic in some way using the <# #> blocks? > > I have a similar situation to you, for rest2web, Firedrop and Movable Python I have one template for the online version (replete with adverts), and another template for the docs bundled with the distributions. I currently run rest2web and copy the files. Then I rename 'template.txt' to '_template.txt' and the second template I rename to 'template.txt', then run rest2web again. The alternative would be to change a single line in the main restindex. The easiest way to do this would be with a batch file or shell script that does the two pass process. Alternatively, what mechanism would you *like* me to build into rest2web ? I have in mind to allow the setting of uservalues in the *config file*. This will allow plugins to access global values for a site. Then your template could check for this value and either include an external file or do other magic depending on the value. You could then just create two config files for the two different builds (also specifying different target locations). For the moment a shell script that renames the template file is the easiest solution, but the other way may be possible at some point in the future. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Thanks for this great tool, > > Don > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > > |