[REBOL] Re: make-doc-pro: how to handle tables?
From: greggirwin:starband at: 21-Sep-2001 11:08
Robert, Joel, et al
<< ~|first cell|second cell| ... |last cell|
~!cell first!cell second! ... !cell last!
~:primo cell:secundo cell: ... :ultama cell:
~$unum$
duo$
...
whatever$
<snip>
...The combination of the two rules above meant that a line that
began with a tilde, along with all subsequent non-empty and
non-tilde-beginning lines, together made up a single row.
This allowed the author the option of entering the cells in a
row vertically instead of horizontally, a convenience in some
cases. >>
I've done simliar things myself (not quite as cool...<g>) but,
to me, the make-doc format should be as simple as possible to write,
even at the expense of flexibility.
What if you started off with a familiar idiom, as used for notes
(bear in mind that I've only glanced at the make-doc format so
I'll undoubtedly post some bad suggestions here). E.g.
\table
<<table data goes here>>
/table
Now, what else do we need for a table, besides data? A heading:
\table "Table 1"
<<table data goes here>>
/table
What if you have a table that makes more sense to enter as columns,
rather than rows? How about a /pivot refinement. Are there any other
refinement type things used in make-doc? Not sure how usefult this
would be, but it's along the lines of "how would we extend the syntax?"
Other example extensions would be things like column widths and
cell alignments. Maybe a table gets a header block with extra data.
\table "Table 1" /pivot
<<table data goes here>>
/table
Data:
I'm very fond of whitespace, and I like it when things line up.
When using a delimiter, such as a pipe, it sometimes isn't clear
if whitespace is significant, or if the delimiter is the only
thing that matters. I.e. can you pad your cell data with spaces
so they line up nicely or will those extra spaces go into the
table?
Can we do it with a minimal syntax of tab separated values? If
tabs aren't used, can a minimum number of spaces be substituted
in their place? For example, cell data is only allowed to have
a single space between words, any more than that and the next
bit of data is considered to be in the next cell.
1 2 3
4 5 6
7 8 9
Item 1 Item 2 Item 3
Item 4 Item 5 Item 6
Item 7 Item 8 Item 9
How would you insert a newline in a cell?
Just some thoughts, FWIW. Thanks for your work on make-doc Robert!
Ultimately, wouldn't it be great to write a human friendly RebTeX
dialect? PDFMaker might be a good start on something like that.
--Gregg