SelfscribeDownloadOpen the app

Gemtext

A Gemini capsule page, one kind of thing per line: headings, links, lists, quotes and text kept as typed.

A rulebook. Save it in the app's library, then start any document with use gemtext.

Edit it in the playgroundRead the file

What it shows

Describe a markup where each line is one kind of thing.

What you learn

Line rules picked by a line's first characters, a link rule with two slots and one with one, a mark drawn before each link, list items gathered into a list, a block kept as typed.

Try this

  • Delete the words after a => address, and the link shows the address instead.
examples/rulebooks/gemtext.self · 78 lines
~~~ selfscribe
# Gemtext: the line-oriented markup of the Gemini protocol. Use it with:  use gemtext
# Lesson: Describe a markup where each line is one kind of thing.
# You learn: line rules picked by a line's first characters, a link rule with two slots and one with one, a mark drawn before each link, list items gathered into a list, a block kept as typed.
# Try this: delete the words after a => address, and the link shows the address instead.
# summary: A Gemini capsule page, one kind of thing per line: headings, links, lists, quotes and text kept as typed.
# category: syntax
set title Gemtext

# ---- "# ", "## " and "### " at the start of a line: three sizes of heading -------------
line   # _           -> h1
line   ## _          -> h2
line   ### _         -> h3

# ---- "=> address words": a link on a line of its own ------------------------------------
# With words after the address they are the link's text; with none, the address is.
class gem-link  { display: block; width: fit-content; margin: 0.3em 0; text-decoration: none }
class gem-link::before  { content: "⇒"; display: inline-block; width: 1.6em; opacity: 0.55 }
line   => _ _        -> a.gem-link      href=_1  _2  as gem-link
line   => _          -> a.gem-link      href=_1  _1  as gem-link-bare

# ---- "* " a list item, "> " a quote: neighbouring lines join one list or one quote ------
line   * _           -> li              group ul
line   > _           -> p               group blockquote

# ---- Between two ``` lines: text shown exactly as typed, spaces and all -----------------
# The words after the opening ``` describe it for screen readers; the rule leaves them out.
block  ``` _ ... ``` -> pre             verbatim  { --doc-code-fg: currentColor; font-family: var(--doc-font-mono); line-height: 1.35 }  as gem-pre
~~~
``` A radio, drawn in text
 .----------------------------------.
 |  .----------.     ( )     ( )    |
 |  |::::::::::|                    |
 |  |::::::::::|   88  96  104  108 |
 |  '----------'   |-------^------| |
 '----------------------------------'
```

# The repair bench

Fixing old radios, lamps and typewriters, one screw at a time. Notes from a shed in Leeds.

=> log/ The repair log, a new entry most weeks
=> parts.gmi Parts I am looking for
=> about.gmi About the bench
=> feed.xml

## On the bench now
* A valve radio from 1958, with a hum that comes and goes
* A desk lamp from the seventies that will not hold its angle
* A portable typewriter whose e key sticks

### 14 November 2026: the hum
The hum was at 100 Hz and got louder as the radio warmed up. That points at the smoothing capacitor, and this one had dried out.

```
  before   hum at 100 Hz, louder when warm
  cause    smoothing capacitor, 32 µF, dried out
  after    new 33 µF capacitor, hum gone
```

> Unplug it and wait a day before you open the back. Old capacitors hold their charge.

=> log/2026-11-14-hum.gmi The whole entry, with photos

## How it's made
* Each line is one thing, and its first characters say what. A hash makes a heading, an arrow makes a link, a star makes a list item and a greater-than sign makes a quote.
* With words after its address, a link shows the words. With none, it shows the address.
* Between two lines of three backticks, text is kept exactly as typed. The radio at the top is one of those.
* Any other line is plain text.

## Try it yourself
* Delete "About the bench" after its address. The link shows the address instead.
* Add a line that starts with "* " under On the bench now. It joins the list.
* Change "### 14 November 2026" to "## 14 November 2026". The heading grows.
* Add a line that starts with "> " under the quote. Both lines join one quote.

Next: the todo.txt rulebook also gives every line one look, and lets the way it starts change it.