package pagefind

import "go.abhg.dev/doc2go/internal/pagefind"

Package pagefind provides access to the pagefind CLI.

Index

Types

type CLI

type CLI struct {
	// Pagefind is the path to the pagefind executable.
	// If unset, we'll search $PATH.
	Pagefind string

	// Log is the logger to use for the output of the pagefind command.
	Log *log.Logger
}

CLI is a handle to the pagefind CLI, which is used to generate a search index for the documentation.

func (*CLI) Index

func (c *CLI) Index(ctx context.Context, req IndexRequest) error

Index generates a search index for a provided website.

type IndexRequest

type IndexRequest struct {
	// SiteDir is the path to the static website to index.
	SiteDir string // required

	// Path to the directory where pagefind assets are stored
	// relative to SiteDir.
	AssetSubdir string
}

IndexRequest is a request to generate a search index for a website.