A proposed scheme for parsing preformatted alt text

Nathan Galt mailinglists at ngalt.com
Fri Sep 11 03:59:33 BST 2020


> On Sep 10, 2020, at 5:30 PM, Sean Conner <sean at conman.org> wrote:
> 
>  I added the following non-standard document:
> 
> 	gemini://gemini.conman.org/test/preformat.gemini
> 
> that contains "machine readable text" at the opening preformatted marker,
> and a "human readable text" on the ending preformatted marker, just to give
> an indication of what it might look like and what might be done with it. 
> Enough talk, *someone* has to do an implementation to scare the bejeezus out
> of everyone (not that it's particularly scary in what I did).
> 
>  -spc (HTML people.  Seriously, HTML.  You want your format, you have it
> 	already ... )

I like sets of concrete examples. Thanks for whipping this up.

What I dislike about this style of “‘machine-readable’ text up top” (for some definition of “machine-readable”) is that the alt-text function has been entirely obliterated, at least in these examples.

For the two code bits at the top of the page, the alt text should be the contents of the captions at the bottom of each.

For the three “images”, the alt-text should be something like:

- a dragon
- Merry Christmas
- a Christmas tree with a rabbit sitting near its base

It seems we have a “pick two” problem. We have (at least!) three different annotation types that we’d like to adorn preformatted blocks with:

- machine-readable hints for how to parse a block (say, for syntax highlighting)
- alternative representations for people who can’t see (/understand?) the contents of the block
- captions of the block for people who can see it fine

And…we have two potential slots to fill. Constraints:

- preexisting Markdown parsers expect their what-language-is-this hint right after the first ```
- alt text probably ought to come first, just in case the user is on an oversaturated 2 KB/s modem connection…or something. Plus, the Gemini spec already says that This Is the Way™.

Personally, I think block captions (title-text equivalents) are the least important and should be the first to be shoved out the airlock. While HTML is better for their addition, people limped along OK before <aside> and <figure>+<figcaption> were added to HTML5.


More information about the Gemini mailing list