Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Code & Terminals

Code is the one place where the codex abandons its serifs. Blocks keep mdBook’s monospace machinery and syntax highlighting; the surrounding prose stays bookish, which makes the contrast deliberate and pleasant. No class is needed anywhere in this chapter — fenced blocks are plain Markdown.

A Go Block

// canary probes the environment before any feature work begins.
func canary() error {
    for _, tool := range []string{"mdbook", "chromium", "go"} {
        if _, err := exec.LookPath(tool); err != nil {
            return fmt.Errorf("missing tool %q: %w", tool, err)
        }
    }
    return nil
}
```go
func canary() error {
    return nil
}
```

A Bash Block

set -euo pipefail

make canary     # prove the environment
make preflight  # prove the code
make build      # only now, build the site
```bash
make canary     # prove the environment
```

Inline Machinery

Inline code like make preflight sits inside serif prose without breaking the line rhythm. Keyboard keys such as q and Ctrl+C get raised keycaps.

Inline code like `make preflight`, and keys such as
<kbd>q</kbd> and <kbd>Ctrl</kbd>+<kbd>C</kbd>.

Nesting a Fence Inside a Fence

To show a fenced block as source — as this chapter does throughout — wrap it in a longer fence:

````markdown
```bash
make preflight
```
````

Warning — Never paste terminal screenshots into the codex. Paste the text; the theme will dress it.