Lokyr
Documentation

Writing the documentation

On this page

This guide is for anyone who writes or changes a page of Lokyr's documentation. It covers where a page goes, how a page is laid out, and how to write it so that readers find what they need quickly. The pages are the Markdown files in docs/, which GitHub shows and lokyr.dev builds into its site.

Where a page goes

Each page covers one topic, named the way a reader would name it: "Shell integration", "Keyboard", "Links". Don't name a page after a crate or a plugin, unless the plugin is the whole feature, such as the quick terminal or copy mode.

Every page belongs to one of the summary's groups:

GroupWhat it holds
StartThe documentation's home, installing Lokyr, a first tour
UseA page for each topic: what a feature does, how to use it, what goes wrong
ReferenceLists to look things up: the config's keys, the commands, the escape codes
InternalsHow Lokyr is built, for contributors

A Help group, for troubleshooting and common questions, joins them between Reference and Internals with its first page.

How to write

The topic page

A topic page shows first, then explains. Its sections come in this order. Leave out the ones that don't apply, but don't reorder them, so that readers learn where things are.

# Shell integration

<sub>macOS · zsh, bash, fish · on by default ·
[`[terminal] shell-integration`](CONFIGURATION.md#shell-integration)</sub>

One paragraph: what the feature is and what it gives you, in plain words.
No history, no internals.

## Try it

The shortest thing that shows the feature working, which works when pasted
as is, and what you should see.

```sh
ls /nonexistent
```

A red bar appears beside the prompt of the command that failed. Press ⌘↑ to
jump back to it.

## What it gives you

- **Jump between prompts**: ⌘↑ and ⌘↓.
- One line a feature, each linked to its page.

## Turn it on

Task sections, one a task, each titled in the imperative: "Turn it off",
"Copy a command's output".

## Settings

The keys that control the feature, each linked to its entry in the
configuration guide.

## Commands and keys

The commands and their default keys.

## How it works

The mechanism: the sequences, the variables and the files, linked to their
reference entries.

## Limits

What the feature doesn't do, by design or not yet.

## Troubleshooting

### Commands get no marks

**Why**: … **Fix**: … **Check**: …

## For shell authors

Only where programs or shells take part, linked to the escape codes'
reference.

## See also

The plugin page

A bundled plugin has a page in docs/plugins/: what it shows, its commands, its configuration, how to turn it off, and its permissions. When the plugin is a whole feature, such as the command palette or the quick terminal, its page also has a "Try it" and a "Troubleshooting" section.

The escape code entry

An escape code's entry, on the page of its family of protocols, gives its syntax, its parameters, what Lokyr does with it, and a way to try it.

### OSC 9;4, progress

<sub>Platforms: macOS · on by default ·
[Specification](https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences)</sub>

```text
ESC ] 9 ; 4 ; state ; value ST
```

| Parameter | Values | Meaning |
|---|---|---|
| `state` | `0` clear, `1` normal, `2` error, `3` indeterminate, `4` paused | Its state |
| `value` | `0` to `100` | The percentage, ignored for `0` and `3` |

**What Lokyr does**: it fills the tab's outline as the progress grows.

**Try it**

```sh
printf '\033]9;4;1;50\033\\'; sleep 2; printf '\033]9;4;0\033\\'
```

The tab's outline fills halfway, then clears.

**See**: [the `progress` plugin](plugins/progress.md)

Each entry has the syntax in the notation of the code block above, where the spaces only make it easier to read, its parameters, what Lokyr does and how it differs from the specification, the exact reply to a query, the key that turns it on or off, a "Try it" with what you should see, and a link to its topic page. Don't explain a standard sequence again: link xterm's control sequences, and write down only what Lokyr does differently.

The troubleshooting entry

The heading is the symptom, as the reader sees it, quoting an error message exactly when there is one. Then three short parts:

Code blocks

Keys and menus

Markers

Callouts

GitHub's alerts show as callouts, on GitHub and on lokyr.dev:

> [!TIP]
> Press ⇧⌘E to label every link on the screen.

Use [!NOTE] for something worth knowing, [!TIP] for a better way to do something, [!IMPORTANT] for something you need to know to succeed, [!WARNING] for a risk, and [!CAUTION] for something that loses data or can't be undone. Use them sparingly: a page with a callout in every section has none that stands out.

Screenshots

Generated pages

Some pages, or parts of them, are made from their sources, so that they can't drift from the code. Change the source, never the page; a page made whole from a source links that source in its footer, in place of the page's editor:

Check your page