Skip to content

Conversation

philschatz
Copy link
Member

@philschatz philschatz commented Apr 20, 2018

like SVG icon files. They are injected so that they can be colored via CSS.

Example CSS

body { content: fetch-url('./icon.svg'); }

Output when run on an empty HTML file:

<html>
  <body><!-- DEBUG: Transcluded file './icon.svg' -->
    <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
      <rect x="25" y="25" width="200" height="200" fill="lime" stroke-width="4" stroke="pink" />
    </svg>
  </body>
</html>

Refs openstax/cnx-easybake#41

Some things to note:

  • having a comment or something might be helpful in debugging where this file came from
  • there is cruft <?xml .... that needs to be stripped out
  • We might need to validate that we transcluded XML
  • sourcemaps should probably mark the entire SVG file when it it transcluded

like SVG icon files. They are injected so that they can be colored via CSS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant