Extending Markaby for SVG - done!

Ernest Prabhakar ernest.prabhakar at gmail.com
Thu Jul 12 18:23:53 EDT 2007


Hi Tim,

On Jul 11, 2007, at 3:34 PM, Tim Fletcher wrote:
>    My opinion would be to keep it seperate so that in can be  
> usedelsewhere, but provide a hook into Markaby. So something along the
> lines of this (completely untested):

Thanks!  That's exactly what I needed.  The whole implementation is  
now at:

http://pastie.caboo.se/78442

This uses an Markaby::SVG11 tagset, which is at:

http://pastie.caboo.se/78441

The only ugly bit is that Markaby defines "text" as the output  
command, which conflicts with the SVG tag named "text." I remember  
_why saying he was going to rename that method to "out" or something.  
Is that still planned?

To use it, simply make sure that builder_svg is loaded, and do  
something like:

> html do
> 	head {title "Testing HTML+SVG"}
> 	body do
> 		p "Below is a wonderful example of"
> 		a "SVG", :href => "http://www.w3.org/2000/svg"
> 		svg do
> 			title "Slide Title"
> 			rect({:x=>2,:y=>2,:width=>508,:height=>318,:fill=>"aqua"})
> 		end
> 	end
> end

I have a test suite, if anyone is interested. I haven't done anything  
fancy yet, but it seems to all work.

Is this something I should submit as a patch to Markaby itself?

Best,
-- Ernie P.
	




More information about the Camping-list mailing list