ajstarks / svgo

Go Language Library for SVG generation
Other
2.14k stars 169 forks source link

Add a function for creating a nested svg #28

Closed mintbridge closed 7 years ago

mintbridge commented 8 years ago

This allows a nested svg element to be added, without the xml declaration

sathishvj commented 7 years ago

This needs to be merged in I think because we could use the nested svg functionality.

Until it is merged, is there any other way to insert an svg segment that we have, say, read from a file?

neonsoftware commented 7 years ago

Hi @sathishvj ! please correct me if I am wrong, isn't it exactly what svgrid.go is doing (in the sigrid folder), it reads a file, reads all the XML elements (so no XML headers) (by cleverly using a decode function with just one field innerxml), and pastes it in the current SVG as a new group ? It is basically a full all-the-xml-that-you-find import. It also applies a translation to place the imported XML.

Let me know if you find it so or need something similar or different, I am using it for that at the moment, so I am also interested in that part of code and might take a look.

Cheers