ruricolist / spinneret

Common Lisp HTML5 generator
MIT License
369 stars 26 forks source link

Add an :SVG tag #34

Closed svetlyak40wt closed 4 years ago

svetlyak40wt commented 5 years ago

This can be useful to support SVG tag to draw D3 graphs.

Right now I'm using this as a workaround:

(pushnew :svg spinneret::*html5-elements*)
(:tag :name "svg" :class "graph")
ruricolist commented 5 years ago

To be clear, are you just asking for Spinneret to support an :svg tag, or are you asking for Spinneret to support producing inline SVG documents? Because the latter would require a fair amount of work and I'm not sure it's a good idea (although I could probably be persuaded otherwise).

ruricolist commented 5 years ago

I did learn something researching this issue: I always thought that to embed SVG and MathML in an HTML document, the embedded markup had to be valid XML, but it doesn't -- browsers just use the HTML parser to construct the XML DOM.

boogsbunny commented 1 year ago

So is adding <svg><path></path></svg> something that's on the timeline?

ruricolist commented 1 year ago

I'm not inherently opposed to it but it would be a fair amount of work to add all the SVG and MathML elements and their permitted attributes and I have no short-term plans in that direction.

svetlyak40wt commented 1 year ago

Is there a way to make this extension as a separate ASDF system?

ruricolist commented 1 year ago

It should be possible, although some parts of Spinneret would have to be rewritten to scale to adding so many extra tags and properties. I'm working on that in a separate branch: https://github.com/ruricolist/spinneret/tree/use-hash-table.