helpdoc

package
v1.74.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package helpdoc formats the text that lisp:help and the help package print.

It is the single definition of that format. Core lisp:help (package lisp) and the help package's registry functions (lisp/lisplib/libhelp) both write through it, and neither can import the other's rendering: libhelp imports lisp, so lisp cannot import libhelp. Everything here therefore works on text the caller has already rendered, and nothing here imports lisp.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanDocRaw

func CleanDocRaw(doc string) string

CleanDocRaw dedents a docstring without word-wrapping. JSON consumers get clean text they can format themselves.

func CleanDocstring

func CleanDocstring(doc string) string

CleanDocstring dedents doc, wraps it at 72 columns and indents it two spaces, the layout help prints.

func DedentDoc

func DedentDoc(s string) string

DedentDoc removes common leading whitespace from all non-empty lines. It handles Go raw string literals where the first line may have less indentation than continuation lines (which inherit the source code's tab indentation). Tabs are normalized to spaces before processing.

func WriteFun

func WriteFun(w io.Writer, funType, signature, docstring, symbolDoc string) error

WriteFun writes the entry for a function: its kind and rendered signature on one line, then its docstring, or symbolDoc when the function carries no docstring of its own.

func WriteVal

func WriteVal(w io.Writer, typeName, name, rendered, doc string) error

WriteVal writes the entry for a variable: its type name, its display name and its rendered value on one line, then its cleaned doc, if any.

Types

This section is empty.

Jump to

Keyboard shortcuts

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