The general idea is to support aliases between symbols, which is helpful especially for ASCII art, as an alternative to using spreadsheets.
Aliases in mapping files
Here's something we could support in the .txt mapping format without ambiguity (as a symbol currently can't meaningfully start with =, unless that's the start of a terrible filename):
o <circle r="5"/>
O = o
0 = o
In JavaScript/CoffeeScript, we could plausibly return the string "= o" as shorthand to say "use this other symbol". Or maybe a helper function, like this.replaceSelf('o') or this.lookupSymbol('o').
Use in ASCII art
Why is this useful? It lets you define long symbols like locking 2-toggle, rotated 90, flipped and then use them in ASCII art by defining a local alias like A = locking 2-toggle, rotated 90, flipped, and then draw:
|
--A--
|
Command-line support: brackets
If drawing.txt has the aliases for the ASCII drawing drawing.asc, I could see using this on the command line like so:
svgtiler symbols.coffee drawing.txt drawing.asc
To do multiple files on the same command line, it'd be nice to have bracket support to easily forget mappings:
It'd still be hard to do things like *.txt *.asc though...
Combining mapping and drawing files?
In general I feel like we want these aliases to be local to an ASCII art file, so can we figure out a mechanism to include both ASCII art and symbol aliases/definitions in the same file? Something like:
More generally, perhaps we could have a general mechanism for a "driver" file that contains and/or includes multiple files for SVG Tiler. Perhaps a .multi extension? For example:
Alternatively, we could use ^A to prefix filenames; see #102.
Or even more of a driver file would be just to specify the command-line arguments in a file (instead of a Makefile): This already got implemented in #99.
-p
drawing1.txt # aliases for drawing1
drawing1.asc
drawing2.txt # aliases for drawing2
drawing2.asc
The general idea is to support aliases between symbols, which is helpful especially for ASCII art, as an alternative to using spreadsheets.
Aliases in mapping files
Here's something we could support in the
.txt
mapping format without ambiguity (as a symbol currently can't meaningfully start with=
, unless that's the start of a terrible filename):In JavaScript/CoffeeScript, we could plausibly return the string
"= o"
as shorthand to say "use this other symbol". Or maybe a helper function, likethis.replaceSelf('o')
orthis.lookupSymbol('o')
.Use in ASCII art
Why is this useful? It lets you define long symbols like
locking 2-toggle, rotated 90, flipped
and then use them in ASCII art by defining a local alias likeA = locking 2-toggle, rotated 90, flipped
, and then draw:Command-line support: brackets
If
drawing.txt
has the aliases for the ASCII drawingdrawing.asc
, I could see using this on the command line like so:To do multiple files on the same command line, it'd be nice to have bracket support to easily forget mappings:
It'd still be hard to do things like
*.txt *.asc
though...Combining mapping and drawing files?
In general I feel like we want these aliases to be local to an ASCII art file, so can we figure out a mechanism to include both ASCII art and symbol aliases/definitions in the same file? Something like:
Here I'm using the YAML
---
syntax for separating directives from document, but I don't think it's the right notation here, as it looks like ASCII art.More generally, perhaps we could have a general mechanism for a "driver" file that contains and/or includes multiple files for SVG Tiler. Perhaps a
.multi
extension? For example:Alternatively, we could use
^A
to prefix filenames; see #102.Or even more of a driver file would be just to specify the command-line arguments in a file (instead of a Makefile):This already got implemented in #99.