From: patrick-may@... (Patrick May) Date: 2002-03-21T08:43:55+09:00 Subject: Re: web templating for static sites? Hi! > How do you Ruby/HTML guys deal with the different versions of > HTML and browsers? I would be interested in something that would > take, e.g., a page of HTML4.01 with Style sheets and do a > reasonable job of porting it backward to earlier standards and > older browsers. Of the Ruby HTML stuff in RAA, which would be > the best place to start? If you get a good page abstraction for your site, you can then have methods like Page.to_pretty_html and Page.to_basic_html. This assumes that you can refactor your html into bits of content that can be rendered in a 'pretty' and 'compatible' ways -- some content just might not work. On the other hand, most websites have a template that may use fancy things, but the actual content is basic

, , , etc. If this is a one off, you could might be able to mark the boundries of the scary content by hand and then run a script to split it out for older browsers. Automatically reformatting existing html sounds like a very scary job. In fact, just the idea of *parsing* html scares me. Overly forgiving languages makes writing the parser unforgivable. ~ Patrick