edemaine / svgtiler

Tool for drawing diagrams on a grid, combining grids of SVGs into a big SVG figure
MIT License
61 stars 6 forks source link

Multiple sheets in asc, csv, ssv, tsv formats #102

Open edemaine opened 2 years ago

edemaine commented 2 years ago

Currently, only spreadsheet formats like .xls/.xlsx support multiple sheets in a single file. It'd be nice to support this in other formats like ASCII art (.asc) and delimiter separated (.csv, .ssv, .tsv). Example applications:

The challenge of course is defining a sheet delimiter format. One idea that comes to mind is to use an ASCII control code, followed by a sheet name. Some options that seem to fit:

A simple proposal would be that ^A indicates a sheet name that occupies the rest of the line, and is terminated by ^B or a newline.

Alternatively, we might want to use headers to do more than just specify subsheets, for example to inline multiple text files into one (#68). This might just be a different extension, like .multi; but then we ideally need a way to put subsheets that doesn't involve a second level of ^A. One possibility is to use # for sheets:

^Aaliases.txt
A = locking 2-toggle, rotated 90, flipped
^Adrawing.asc#sheet1
  |
--A--
  |
^Adrawing.asc#sheet2
  |
--A
  |

In Vim, you can enter ^A via ^V^A. In VSCode, the insert-unicode extension seems like a decent way.