NativeSVG.jl
NativeSVG.jl copied to clipboard
Make NativeDVG more general. There's no reason it can't be used for arbitrary XML dialexts
I wanted to extend the support for some SVG elements (for example, rect
should accept content) but also wanted to use NativeSVG to produce arbitrrary HTML.
These changes implement the functions element
and empty_element
. The two loops that define the various SVG functions now use these.
element
takes a function, a tagname (as as Symbol or STring) and an IO and outputs the text representation of an XML element to IO. The function outputs the content of the element.
empty_element
takes a tagname and an IO and outputs the text representation of an empty XMLelement to IO.
In both cases, keyword arguments can be used to specify XML attributes for the element.