Re: Create HTML files using RUBY
by Greg Barozzi other posts by this author
Nov 4 2009 8:34PM messages near this date
Create HTML files using RUBY
|
Re: Create HTML files using RUBY
Krithika San wrote:
> Hi,
>
> How do you create HTML files using RUBY. I have a requirement where I
> need to set color and font of the text, and also provide formatting
> options for tables having different colors for rows and border(on/off).
>
> Can anybody tell how to do this
>
> Thanks,
> K
If I was going to write this myself I'd try something like:
def h1
print "<H1> "
yield
print "</H1> "
end
h1 do
print "I'm a heading!"
end
=> <H1>I'm a heading!</h1>
By yielding to the block you allow yourself to nest other tags
inside of tags which is something you often have to do when writing
html.
Good luck.
--
Posted via http://www.ruby-forum.com/.
Thread:
Krithika San
Greg Barozzi
David
Ehsanul Hoque
Ken Bloom
Gregory Brown
Ehsanul Hoque
Marnen Laibow-Koser
William Manire
Marnen Laibow-Koser
Krithika San
Marnen Laibow-Koser
Krithika San
Justin Collins
Krithika San
Marnen Laibow-Koser
Krithika San
Brian Candler
Marnen Laibow-Koser
Marc Heiler
William Manire
Gregory Brown
Gregory Brown
|