💾 Archived View for rawtext.club › ~sloum › geminilist › 007104.gmi captured on 2024-03-21 at 16:03:40. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
mntn at mntn.xyz mntn at mntn.xyz
Sun Sep 12 19:14:07 BST 2021
- - - - - - - - - - - - - - - - - - -
I'm interested in opinions on syntax highlighting for preformatted text. Gemini has a lot of potential for distraction-free developer reference (I just discovered that godocs.io works in Gemini!) and syntax highlighting would help.
In Markdown, you can add hints to preformatted text blocks like so:
This tells the client that the preformatted block is HTML, so the client can present the code in whatever way makes the most sense. Usually this is syntax highlighting, but I could imagine some clients adding collapsable code blocks based on tags, braces, and/or indentation depending on the language. The Gemtext spec would seem to have no problem with this, as the first line is considered "alt text" and it is up to the client to determine both what should be done with it and how it should affect the presentation. But I wanted to put this out there to get a broader perspective. I've started on a patch for adding this to amfora, since the chroma library (also used by Hugo) can do syntax highlighting with ANSI escape codes, for use in terminals. It works, but it's got a couple of rendering bugs at the moment. Discussion and screenshot here: https://github.com/makeworld-the-better-one/amfora/issues/252