libhelp

package
v1.46.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPackageName = "help"

DefaultPackageName is the package name used by LoadPackage.

Variables

This section is empty.

Functions

func LoadPackage

func LoadPackage(env *lisp.LEnv) *lisp.LVal

LoadPackage adds the help package to env

func LookupSymbolDoc added in v1.23.1

func LookupSymbolDoc(env *lisp.LEnv, sym string) string

LookupSymbolDoc resolves a symbol's documentation from its package. Handles qualified names (pkg:sym) and unqualified names (current package). Returns "" if the environment is not fully initialized.

func RenderPackageList added in v1.16.12

func RenderPackageList(w io.Writer, env *lisp.LEnv) error

RenderPackageList writes a summary of all loaded packages to w. Each package is listed with its name, export count, and first line of its doc string (if any). Packages are sorted alphabetically.

func RenderPkgExported

func RenderPkgExported(w io.Writer, env *lisp.LEnv, query string) error

RenderPkgExported writes to w formatted documentation for exported symbols in the query package within env. The exact formatting of the rendered documentation is subject to change across elps versions.

func RenderVar

func RenderVar(w io.Writer, env *lisp.LEnv, sym string) error

RenderVar writes to w formatted documentation for the object referenced by sym in the context of env. The exact formatting of the rendered documentation is subject to change across elps versions.

Types

type FormalsDoc added in v1.32.0

type FormalsDoc struct {
	Required []string `json:"required"`
	Optional []string `json:"optional,omitempty"`
	Rest     string   `json:"rest,omitempty"`
	Keys     []string `json:"keys,omitempty"`
}

FormalsDoc describes a function's parameter list.

type MissingDoc added in v1.17.0

type MissingDoc struct {
	// Kind is the type of the symbol: "builtin", "special-op", "macro",
	// "package", or a function type string (e.g. "function").
	Kind string

	// Name is the qualified name of the symbol (e.g. "math:sin").
	Name string
}

MissingDoc describes a symbol with no documentation.

func CheckMissing added in v1.17.0

func CheckMissing(env *lisp.LEnv) []MissingDoc

CheckMissing reports symbols missing documentation in the given environment. It checks core builtins/ops/macros (from DefaultBuiltins etc.), package-level docs, and exported symbol docs for all packages in env.Runtime.Registry.

type PackageDoc added in v1.32.0

type PackageDoc struct {
	Name    string      `json:"name"`
	Doc     string      `json:"doc,omitempty"`
	Symbols []SymbolDoc `json:"symbols"`
}

PackageDoc describes a package for JSON output.

func QueryPackage added in v1.32.0

func QueryPackage(env *lisp.LEnv, name string) (*PackageDoc, error)

QueryPackage returns structured documentation for a single package.

func QueryPackages added in v1.32.0

func QueryPackages(env *lisp.LEnv) []PackageDoc

QueryPackages returns structured documentation for all packages in the environment, suitable for JSON serialization.

type SymbolDoc added in v1.32.0

type SymbolDoc struct {
	Name    string      `json:"name"`
	Kind    string      `json:"kind"` // "function", "macro", "operator", "variable"
	Doc     string      `json:"doc,omitempty"`
	Formals *FormalsDoc `json:"formals,omitempty"` // nil for non-functions
}

SymbolDoc describes a documented symbol for JSON output.

func QuerySymbol added in v1.32.0

func QuerySymbol(env *lisp.LEnv, sym string) (*SymbolDoc, error)

QuerySymbol returns structured documentation for a single symbol, resolved in the context of env. Supports qualified names (pkg:sym).

Jump to

Keyboard shortcuts

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