A proposed scheme for parsing preformatted alt text

Sean Conner sean at conman.org
Mon Sep 7 01:47:47 BST 2020


It was thus said that the Great Luke Emmet once stated:
> Hi All
> 
> We had an interesting discussion on the #Gemini IRC channel earlier 
> today about a generalised scheme for parsing the alt text on 
> preformatted regions, e.g.
> 
> ```this is the alt text, not normally displayed to the end user
> the preformatted content
> ```
> 
> It was a collective discussion, but I've written up some of the key 
> points in a post here:
> 
> gemini://gemini.marmaladefoo.com/blog/7-Sep-2020_Parsing_preformatted_alt_text.gmi
> 
> Essentially the key design considerations are as follows:
> 
> 1. By default the whole alt text can be used as a label (current behaviour)
> 2. Use CSS style syntax for the remainder, a familiar and low ritual syntax

  I read the article linked, and I think a better format would be:

``` mumble mumble label text mumble; attribute1=value1; attribute2=value2

  Skip the CSS rules since they aren't used in Gemini, but the attributes
for MIME *are* used, and those use the format I've shown above.  If you can
parse MIME types, you can reuse *that* code to parse attributes.

```here is a table in CSV; content-type=text/csv; lang=en_US;

  The format for tables is *horrible* (at least in my opinion).  The format
I use to generate tables (ultimately in HTML) is the following:

*header1	header2	header3	header4
**footer1	footer2	footer3	footer4
row-11	row-12	row-13	row-14
row-21	row-22	row-23	row-24

  Basically, it's a TAB-delimeted text, so there's no worry about escaping
commas or dealing with quoted strings or any such nonsense.  I know, tabs
are horrible, don't ever use them, etc. etc. but it's *way* easier to deal
with tabs than just about any other character (short of the field separator
control characters).

  So your table example:

```Here is a table; content-type=text/tsv; lang=en
*+	1	2	3
1	2	3	4
2	3	4	5
3	4	5	6
```

  (Yeah, way eaiser to type than '|' between each field)

> 3. Don't prescribe the attributes, allow practice to suggest them
> 4. Be backwards compatible and friendly to screen readers etc.
> 
> two initial attributes seem to have obvious initial utility and could be 
> used to effectively label content in a practical way:
> 
> content-type
> lang

  Just my two zorkmids worth.  I don't really have a horse in this race, as
I don't really care for the current gemini text format anyway, and this is
adding complexity to a simple format, but that is solerpunk's call, not
mine.

  -spc



More information about the Gemini mailing list