You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying out svgtiler in the context of a RevealJS presentation, and it's really nice to have the ASCII art in the source file and have it render automatically, similar to KaTeX/MathJax. Here's a proposed general system:
<div class="svgtiler-mapping-..." id="map1"> or perhaps <script type="...svgtiler-mapping..." id="map2"> for specifying .txt, .js, .coffee mappings
<div class="svgtiler-drawing" data-mapping="#map1,#map2"> for ASCII art (maybe other variants for CSV, TSV, etc.) that specifies which mappings to use (via CSS query).
API call like renderToDOM(document) that finds all of these, hides the mappings, and converts the drawings to inlined SVG. Parsing seems to work well when style="white-space: pre" is set, though may need to do some whitespace trimming (removal of indentation).
Maybe we also want the svgtiler CLI to support .html input? Output could also be .html in that case...
The text was updated successfully, but these errors were encountered:
A version of this is now in v2.1.0. I opted for a simpler API without a mapping registry, as we need to call svgtiler somewhere in code anyway, so specifying the mapping there too seems natural. So now just the drawings can be embedded in the HTML, while mappings need to be built in code.
I've been trying out svgtiler in the context of a RevealJS presentation, and it's really nice to have the ASCII art in the source file and have it render automatically, similar to KaTeX/MathJax. Here's a proposed general system:
<div class="svgtiler-mapping-..." id="map1">
or perhaps<script type="...svgtiler-mapping..." id="map2">
for specifying.txt
,.js
,.coffee
mappings<div class="svgtiler-drawing" data-mapping="#map1,#map2">
for ASCII art (maybe other variants for CSV, TSV, etc.) that specifies which mappings to use (via CSS query).renderToDOM(document)
that finds all of these, hides the mappings, and converts the drawings to inlined SVG. Parsing seems to work well whenstyle="white-space: pre"
is set, though may need to do some whitespace trimming (removal of indentation).svgtiler
CLI to support.html
input? Output could also be.html
in that case...The text was updated successfully, but these errors were encountered: