[Uw-ruby] Encapsulating HTML <style> using CGI??
Brent A. LaMotte
brent at lbbl.org
Thu Nov 22 11:18:38 PST 2007
The output he has is CSS (it's not valid, it is heinous, but it would
work) - it's the same code a Word generated CSS and HTML file would
output (GOD ARE THEY EVER UGLY, said the front end developer who has
seen more than his share of that garbage - the mso- attributes in the
CSS is the dead giveaway).
It'll work in non-IE browsers, but I would bet cross browser is not
part of his spec.
On Nov 22, 2007, at 1:59 AM, Ryan Davis wrote:
>
> On Nov 20, 2007, at 23:13 , Steve Dame wrote:
>
>> I have a question about using Ruby CGI. I want to be able to
>> generate
>> some very rich web tables that the HTML is generated from a tool
>> chain
>> of Excel--Word and then exported to an HTML file for the look and
>> feel
>> of my web page.
>>
>> The cgi.rb example got me pointed in the right direction, but how
>> does
>> one go about pulling raw text "style" strings into a cgi object so
>> that
>> it can properly build an HTML sections output?
>>
>> The objective is to get a section of the CGI Ruby script to generate
>> something like:
>
> You use lots of words in combinations and forms I don't currently
> understand. Some of that is surely me (and the time), but... wha?
>
> You want a CGI to create... what? A word document?
>
>> <style>
>> <!--
>> /* Font Definitions */
>> @font-face
>> {font-family:"Times New Roman";
>> panose-1:0 2 2 6 3 5 4 5 2 3;
>> mso-font-charset:0;
>> mso-generic-font-family:auto;
>> mso-font-pitch:variable;
>> mso-font-signature:50331648 0 0 0 1 0;}
>
> that's not HTML or CSS. It may work on IE, but the rest of the world
> won't see a thing afaik.
>
> Anyhow... I'm still not sure what you're trying to do, but the general
> idea is you've got data coming in via some stream (sounds like from a
> static file or stdin) that you're pulling in, then you morph that
> however appropriate, and push that out towards the web client... I
> usually use builder or markaby because they let me write my output in
> a structured ruby code block:
>
>> mab = Markaby::Builder.new
>> mab.html do
>> head do
>> title "title"
>> style do
>> self << "body { font-family: Optima, Times; background-color:
>> #99F }"
>> self << "h1 { color: #339 ; text-align: center }"
>> self << "h2 { color: #006 }"
>> self << "a { color: black }"
>> end
>> end
>> body do
>> h1 "title"
>>
>> table do
>> # ... etc ...
>> end
>> end
>> end
>
>
>
>
>
> _______________________________________________
> Uw-ruby mailing list
> Uw-ruby at zenspider.com
> http://www.zenspider.com/mailman/listinfo/uw-ruby
More information about the Uw-ruby
mailing list