-
-
Notifications
You must be signed in to change notification settings - Fork 72
Description
From the Gemini spec:
"Anything which comes after the ``` characters of a line which toggles preformatted line on (i.e. the first, third, fifth, etc. toggling lines in a document) may be treated as "alt text" for the preformatted content. In general you should not count on this content being visible to the user but, for example, search engines may index it and screen readers may read it to users to help the user decide whether the preformatted content should be read aloud (which e.g. ASCII art generally should not be, but which source code perhaps should be). There are currently no established conventions on how alt text should be formatted."
Many Markdown implementations, for instance, use a similar mechanism to identify the language for syntax highlighting:
```html
<p>This is HTML</p>
```
It seems like it is inevitable to have some kind of syntax highlighting convention in Gemini, especially given its usage within tech-centric circles. Given that the spec leaves alt text wide open for interpretation by the client, I thought that it might be worth investigating this use case in amfora.
Hugo uses a fantastic Go library called Chroma for its syntax highlighting. Chroma explicitly supports highlighting with 8-bit and 256-bit terminal colors, so it should be a good match.