2.7 KiB
My Gemini capsule
Using Software
- Server: agate
- HTTP proxy: kineto
- Client: amfora
- HTTP: vulpes.one
gemtext .gmi
syntax
Links
=> https://example.com A cool website
=> gopher://example.com An even cooler gopherhole
=> gemini://example.com A supremely cool Gemini capsule
=> sftp://example.com
Headings
# Heading
## Sub-heading
### Sub-sub-heading
Lists
* Mercury
* Gemini
* Apollo
Blockquotes
> Gemtext supports blockquotes. The quoted content is written as a single long line, which begins with a single > character
Preformatted text
Gemtext is carefully designed to be very, very easy to parse and render. Gemini clients process Gemtext one line at a time, rendering each line independently of any lines before it or after it, just by peeking at the first few characters of a line to check for something like =>, # , * , etc.
A line which starts with three backticks tells the client to toggle between its ordinary parsing mode,
and "preformatted mode". In preformatted mode, clients don't check whether or not a line is a link
or a heading or anything else. They are simply printed as-is. Also, while clients may use variable
width fonts for ordinary all other text, in preformatted mode clients must use a fixed width font.
Thus, a pair of three backticks lines acts much like <pre>
and </pre>
tags in HTML.
Preformatted text can be used to include ASCII art, source code, or similar content in a Gemtext document without clients mistakenly interpreting lines as headings, list items, etc. It can also be used to write documents like this one, which explain Gemtext syntax with examples - you're able to see the syntax examples above without your client interpreting them like it normally would because they are rendered in preformatted mode.
Anything which comes after the three backticks 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.