Help us shape the future of Go! Take the 2026 Go Developer Survey

docblocks

package
v0.28.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package docblocks finds the fenced console blocks in keryx's docs that are marked for checking against real command output (keryx #20).

A block opts in with a data-check attribute on its fence, which zensical renders as a harmless HTML attribute:

```console {data-check="theme-list-empty"}
$ keryx theme list
no themes yet — add one with `keryx theme add <keyword>`
```

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalise

func Normalise(s string) string

Normalise is the comparison the check makes: trailing space on each line and blank lines at either end are ignored, everything else is exact.

Types

type Block

type Block struct {
	ID   string
	File string
	Line int
	// Steps is empty for a block that quotes output alone; its text is then in
	// Output, to be compared with whatever ran before it.
	Steps  []Step
	Output string
}

Block is one marked console fence.

func Find

func Find(dir string) ([]Block, error)

Find returns every marked block under dir, refusing a duplicate id.

type Step

type Step struct {
	// Command is the command line after `$ `, continuation lines joined.
	Command string
	Output  string
}

Step is one `$` command in a block and the output the docs show for it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL