Extending Markaby for SVG

Ernest Prabhakar ernest.prabhakar at gmail.com
Wed Jul 11 17:26:12 EDT 2007


Hi all,

I love the elegance of Markaby for HTML generation. I'd like to do  
something similar for SVG, e.g.:

svg11 do
   title "Slide Title"
   rect({:x=>2,:y=>2,:width=>508,:height=>318,:fill=>"aqua"})
   g({:style=>"fill:blue;  
stroke:black", :transform=>"translate(17,-38)"}) do
	circle({:cx=>70, :cy=>100, :r=>50})
	 
rect 
(:x 
=>"150", :y=>"50", :rx=>"20", :ry=>"20", :width=>"135", :height=>"100")
	line(:x1=>325, :y1=>150, :x2=>375, :y2=>50)
	polyline(:points=>"50, 250 75, 350 100, 250 125, 350 150, 250 175,  
350")
	polygon(:points=>"250, 250, 297, 284, 279, 340, 220, 340, 202, 284")
	ellipse({:cx=>400, :cy=>300, :rx=>72, :ry=>50})
   end
end

I've hacked a custom subclass of Builder (SVGBuilder) that can handle  
this, but that's probably the wrong approach -- since most users will  
want to embed SVG inside HTML.

Any Markaby experts here who can help me figure out the best way to  
integrate SVG support into Markaby?

Thanks,
-- Dr. Ernie
http://ihack.us/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/camping-list/attachments/20070711/cb08ecb5/attachment.html 


More information about the Camping-list mailing list