reference

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package reference writes the CLI reference pages of the docs site from the cobra command tree. Each command has one page: a group page that lists its subcommands, or a leaf page with its usage, examples and flags.

Index

Constants

View Source
const (
	// Result tells what the command reports: when it returns changed: true
	// or false, and when it fails.
	Result = "osapi.docs.result"
	// Permission is the permission that the command needs, for example
	// node:write.
	Permission = "osapi.docs.permission"
	// Notes is more detail for the docs site. Use it rarely.
	Notes = "osapi.docs.notes"
)

The keys of the annotations of a command that its page shows. --help does not show them, so a page has detail that a terminal does not need.

Variables

View Source
var Keep = []string{"output.md"}

Keep names the pages in the directory that a person writes. Write does not delete them.

Functions

func Page

func Page(
	c *cobra.Command,
	path []string,
	subs []*cobra.Command,
) string

Page returns the markdown of the page of c. subs are its documented subcommands: a command that has some gets a group page.

func Title

func Title(
	name string,
) string

Title is the title of the page of a command: its name, with each word capitalized and each acronym in capitals.

func Write

func Write(
	root *cobra.Command,
	dir string,
) (int, error)

Write writes the page of each command under root into dir, and removes each page in dir that no command has, except the pages in Keep. It is the count of the pages it wrote.

Types

This section is empty.

Jump to

Keyboard shortcuts

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