rfc00002 linking in svg - jpgerdeman/minifig-svg-decals GitHub Wiki

#RFC 00002 - Linking in SVG ##Overview Make svg files update themselves by referencing an external svg image.

##Motivation By adding a link to an external svg image instead of embedding it, changes to the external svg are directly propagated to the svg linking to it. This in turn would mean less thought and action is required in maintaining the images.

Sadly only very few svg tools support the xi:inlcude tag. To simulate this behaviour a xsl transformation is needed. ##Proposal Instead of embedding external svg images directly reference them. Oversimplified a svg file then might look like

<svg>
	<xi:include href="/library/coats/coolwest.svg" />
	<xi:include href="/library/belts/slickbelt.svg" />
	<xi:include href="/library/shirts/awesomeshirt.svg" />
</svg>

A automatic process then starts an xsl script, which will copy the external files, replacing the include statements and storing the resulting image in a folder processed.

##Limitations SVG Images relying on this won't work as expected. Like stated earlier there is almost no support for the include statement in svg tools. Which means these svg images have to be hand edited. Which in turn means that only processed decals stored in processed are viewable at all.

Even those tools supporting it need the decal and all referenced images. ##Comments: jpgerdeman:

  • Do we really need to maintain decals?
  • This seems like a horrible idea. Even if tools supported referencing images it will only be a hassle for users. With the script they at least only have to worry about that one file. Designer will then have to edit XML, instead of concentrating on their visual goaul. It feels like a lot of hassle for little to no gain.
⚠️ **GitHub.com Fallback** ⚠️