💾 Archived View for namno.duckdns.org › blog › 2024-06-09.gmi captured on 2024-09-29 at 00:18:01. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-06-16)

🚧 View Differences

-=-=-=-=-=-=-

Gemini Table Markup

I believe that gemini needs ability to represent tables. There are several way to represent them, from manually alighning characters in pre-formated block (yuck!) to using data url with csv data. But these methods have a flaw in that they don't support cell groups and footers and only minimal support for headers.

Seeing value in these feauters, I decided to create a table markup inspiered by org-mode.

Basic tables

+-+-+-+
|1|a|а|
+-+-+-+
|2|b|б|
+-+-+-+
|3|c|в|
+-+-+-+

Table is defined by alternating rows of vertical separators and rows.

Separators should begin with a plus sign and contain as much additional plus signs as there are columns. One can use hyphen-minus tp align them with contents of table.

Row lines should being and end with pipe character and also should separate contents of cells with it. If row lines are not separated then cells in following row are considered as containing following lines of cells from previous lines.

Table must be terminated with vertical separator.

Headers and Footers

^------>-----+--------+---------<
|Item  |Price|Quantity|Total    |
+------>-----+--------+---------<
|Cement|0.5  |100000  |50000    |
+------>-----+--------+---------<
|Sand  |0.2  |999999  |199999.8 |
+------>-----+--------+---------<
|Secret|999  |1       |999      |
|Sauce |     |        |         |
+------>-----+--------+---------<


Headers are signified by replacing first plus in preceding separator with caret. Footers are signified with by replacing first plus in separator with underscore.

Vertical headers are signified by replacing N+1th plus in preciding separator with less-than symbol. Vertical footers are signified by replacing N+1th plus in preciding separator with more-than symbol.

^------------+
|Header row 1|
^------------+
|Header row 2|
+------------+
|Cell        |
_------------+
|Footer row 1|
_------------+
|Footer row 2|
+------------+

If footer or header rows or columns immideatly follow each other then they are considered to be a part of same header of footer.

^+
|Important header|
^1+
|Subheader 1|
++
|Cell|
++
|Cell|
++
|Cell|
^1+
|Subheader 2|
++
|Cell|
++
|Cell|
++
|Cell|
_+
|Footer|
++

Headers and footers can be given importace by adding integer immidealy following caret or underscore on separator. If Header/Footer follows/preceeds Header/Footer with bigger importance number then it can replace it.

Cell grouping

+---------+----/----+
|Character|Code     |
+         +-----+---+
|         |Old  |New|
+---------+-----+---+

Horisontal grouping is signified by replacing it's plus in previous separator with slash. Verical separator is signified by a plus sign in separator followed not by hyphen-dash, plus, less-than or more-than sign.

Quoting

+----------------------------+---------+
|Look at  all these characters|"+""| ^_"|
+----------------------------+---------+

To add symbols to cells that couldn't be added because it can considering a part of markup line that contains it should begin and end with double quotes ASCII charater. To represent double quote inside such line it should be placed there twice.

P.S.

Added 2024-07-19

I have thought a bit about this add decided to write a bit more.

This too complex

I disagree. It is somewhat complex, but I don't think that it is really that complex. Simpler clients don't have to treat headers and footers any differently than regular cells, they don't even have to treat table as something special, especially since gemtext already has a precedent for optional markup in quotes and bullet lists.

This is unnecessary

While it may be not needed for many users, tables are good at laying out regular data, which I think is a useful thing, especially when you need to compare several things by their metric, or chart a dependency.

You are bringing in layout

While HTML pages can be segmented out using table elements and were done so before better ways of doing that were created, I don't thing this can happed in gemtext, especially since there is no way to style a table.