guide

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 8 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 guide holds the pages probe guide prints: the reference and concept pages of the documentation, which the binary carries, and the description of an external action, which is read from where the action is.

The pages are given as a file system laid out as docs/content is, so that this package does not depend on where the binary keeps them.

Index

Constants

View Source
const (
	GroupReference = "Reference"
	GroupActions   = "Actions"
	GroupConcepts  = "Concepts"
	GroupExternal  = "External actions, read from GitHub"
)

The groups the topics are listed under.

Variables

This section is empty.

Functions

func IsActionPath

func IsActionPath(arg string) bool

IsActionPath reports whether arg names an external action by where it is, rather than by a name, so that it is not looked for among the names of a workflow.

Types

type Book

type Book struct {
	// contains filtered or unexported fields
}

Book is the pages of the documentation probe guide prints.

func New

func New(fsys fs.FS) *Book

New returns the book of the pages in fsys, laid out as docs/content is: the reference pages under reference, those of the actions under reference/actions, and the concepts under guide/concepts. Only the pages of the built-in actions are expected to be there: an official action is described by its own repository.

func (*Book) Action

func (b *Book) Action(arg string, w Workflow, read DocReader) (string, error)

Action returns the page probe guide prints for arg, a topic or an external action, with w the names of the workflow given, if one is. It is looked for in this order:

  1. A name the workflow gives under actions, so that the page is that of the action the workflow runs. A path there is taken from the directory of the workflow, as a run takes it.
  2. A local path, starting with ./ or ../ or absolute, taken from the working directory, or github.com/<owner>/<repo>[/<dir>][@<commit>].
  3. A topic of the pages of the book.
  4. An official action, read from github.com/mozership/probe-<name>.

An external action is described by what read returns, with the lines that tell where it comes from before it.

func (*Book) Index

func (b *Book) Index() string

Index renders the list of topics probe guide prints without one.

func (*Book) Page

func (b *Book) Page(topic string) (string, error)

Page returns the Markdown page for a topic. An action's page can also be asked for as actions/<name>.

func (*Book) Topics

func (b *Book) Topics() []Topic

Topics lists every topic, references first, then one per action, then the concepts.

type DocReader

type DocReader func(uses, baseDir string) (*actionref.Doc, error)

DocReader reads the description of an external action, as actionref.ReadDoc does.

type OfficialAction

type OfficialAction struct {
	Name        string
	Description string
}

OfficialAction is an external action published alongside Probe.

func OfficialActions

func OfficialActions() []OfficialAction

OfficialActions lists the external actions published alongside Probe.

func (OfficialAction) Repository

func (a OfficialAction) Repository() string

Repository is where the action is published.

type Topic

type Topic struct {
	Name  string // what to pass to probe guide
	Group string // the heading it is listed under
	Title string // the page's first heading
	File  string // the page, in the file system of the Book
}

Topic is one page probe guide can print.

type Workflow

type Workflow struct {
	Uses map[string]string
	Dir  string
}

Workflow is what a workflow names under actions: the uses of each name, and the directory a local path among them is taken from, that of the workflow.

Jump to

Keyboard shortcuts

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