💾 Archived View for namno.duckdns.org › blog › 2024-06-09.gmi captured on 2024-07-08 at 23:28:12. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-06-16)

➡️ Next capture (2024-09-29)

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

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.