Versions in this module Expand all Collapse all v1 v1.8.0 Dec 1, 2026 Changes in this version + const HeadBlock + const HeadChoice + const HeadCollapsed + const HeadCollapsedOutput + const HeadFailed + const HeadHidden + const HeadMovable + const HeadNoSave + const HeadProse + const HeadRan + const HeadRunning + const HeadSecret + const HeadStale + const HeadTerminal + const HeadTextbox + var ErrEnvScripted = errors.New(...) + var ErrLayoutStale = errors.New("the document changed since its cells were laid out") + var ErrPaneBusy = errors.New(...) type Cell + CodeLines int + Hash string + OutputLines int + Program *ProgramStatus + Spill *SpillCell + Terminal bool + Title string + type Head struct + Block int + CodeLines int + Depends []string + Flags int + From int + Hash string + ID string + Kind int + LastLine int + Level int + Line int + Name string + OutputLines int + SectionFrom int + SectionTo int + Title string + To int + type HeadList []Head + func (l HeadList) MarshalJSON() ([]byte, error) + type Heads struct + At int + Done bool + FixAt []int + Fixes HeadList + Gen int64 + Heads HeadList + Laid int + Size int + Step int + type HistoryEnv struct + Current bool + Live bool + Name string + Scripted bool + Stopped int type IncludeCell + Last int + Warning string + Window string type Notebook + func (n *Notebook) Attach(want int) Heads + func (n *Notebook) AttachShell() error + func (n *Notebook) Bodies(gen int64, cells []int) ([]Cell, error) + func (n *Notebook) Busy() bool + func (n *Notebook) HistoryEnvName() string + func (n *Notebook) HistoryEnvs() []HistoryEnv + func (n *Notebook) Live() bool + func (n *Notebook) MoreHeads(gen int64, at, since, want int) (Heads, error) + func (n *Notebook) RedrawBackground(i int) + func (n *Notebook) Relayout(from int64) Splice + func (n *Notebook) RunBlockSide(i int) error + func (n *Notebook) Running() bool + func (n *Notebook) SetBackgroundTerminalSize(cols, rows int) + func (n *Notebook) SetHistoryEnv(name string, restart bool) error + func (n *Notebook) SetInteractiveShell(on, login bool) + func (n *Notebook) SetRecording(on bool) + func (n *Notebook) ShellSize(cols, rows int) + func (n *Notebook) SpillFile(i int) (IncludeFile, error) + func (n *Notebook) TypeBackground(i int, keys string) + func (n *Notebook) TypeShell(keys string) error + func (n *Notebook) Waiting() bool + type ProgramStatus struct + Kind string + Progress int + State string + Text string type RunOptions + InteractiveShell bool + LoginShell bool + type ShellJob struct + Block int + Command string + N int + State string + type SpillCell struct + File string + First int + Last int + Lines int + Truncated bool + Warning string + Window string + type Splice struct + At int + Block int + FixAt []int + Fixes HeadList + Gen int64 + Heads HeadList + Line int + Moving bool + Pos int + Remove int + Reset bool + Size int + Step int v1.7.0 Nov 18, 2026 Changes in this version + const DocPrefix + const Unrecorded + var ErrBadEdit = errors.New("edit lines out of order or out of range") + var ErrBusy = errors.New("a block is running") + var ErrHistoryOff = errors.New("the History pane is off") + var ErrNoMove = doc.ErrNoMove + var ErrRestartNeeded = errors.New(...) + var ErrStale = errors.New("the file changed since, so that edit can't be undone here") + func Describe(event string, f map[string]any) (text string, lost bool) + func DocURL(path string) string + func OutsideImage(file, link string) (string, bool) + func Reason(why string) string + type AuditEvent struct + Event string + JSON string + Lost bool + Seq int + Text string + Time string + type Cell struct + At string + Attrs string + Block int + Body string + Choice *ChoiceCell + Collapsed bool + CollapsedOutput bool + Depends []string + Drop bool + DropAfter int + DropBefore int + Earlier []EarlierRun + Failed bool + FirstLine int + From int + HTML string + HTTP *HTTPCell + Heading int + Hidden string + History bool + ID string + Include *IncludeCell + Lang string + LastLine int + Line int + Links bool + Movable bool + Ms int64 + Name string + NoSave bool + Output string + OutputLine int + OutputTasks []int + Ran bool + Running bool + Secret bool + SecretCode bool + SectionFrom int + SectionTo int + Stale bool + Status int + Tasks []int + Textbox *TextboxCell + TimedOut bool + Timeout int64 + To int + Undeletable string + type ChoiceCell struct + Block int + ID string + Mode string + NoSave bool + Options []doc.Option + Placeholder string + Problem string + type Completion struct + Items []string + Word string + type Deleted struct + Name string + Warnings []string + type DependsProblem struct + Input bool + Line int + Name string + type EarlierRun struct + At string + Exit int + Failed bool + K int + Output string + Region bool + type EditReply struct + Applied bool + Events []LineEvent + Reset bool + Version Version + type Event struct + Block int + Bytes []byte + Data string + Kind string + type EventLog struct + func NewEventLog(notify func(AuditEvent)) *EventLog + func (l *EventLog) Audit() *audit.Log + func (l *EventLog) Event(event string, f audit.Fields) + func (l *EventLog) List() []AuditEvent + type Fix struct + Detail string + Label string + type Fold struct + Block int + Heading int + On bool + Output bool + type FrontMatter struct + Cols int + Description string + DescriptionKey string + Exists bool + Interpolate string + OnError string + Other string + Rows int + Share []string + ShareAll bool + Shell string + ShowStderr string + Source []string + Step bool + Tags []string + Title string + type HTTPCell struct + Body string + Checks []HTTPCheck + Code int + Headers string + Status string + type HTTPCheck struct + Got string + OK bool + Text string + type IncludeCell struct + Block int + File string + From int + Lang string + To int + type IncludeFile struct + Lines int + Text string + type LineEdit struct + First int + Last int + Text string + type LineEvent struct + First int + Last int + Text string + Tick int + type Lines struct + Events []LineEvent + Reset bool + Version Version + type Move struct + Base string + Block int + FromLine int + Line int + Note string + Text string + Warnings []string + type Names struct + Assets []string + AssetsDir string + Envs []string + Files []string + IDs []string + type Notebook struct + func Open(file string, opts Options) (*Notebook, error) + func (n *Notebook) BlockAt(line int) int + func (n *Notebook) BlocksAt() ([]SourceBlock, Version) + func (n *Notebook) Cells() []Cell + func (n *Notebook) Changed() bool + func (n *Notebook) ClearEarlierRuns(i int) error + func (n *Notebook) ClearOutput(i int) error + func (n *Notebook) ClearOutputs() error + func (n *Notebook) Close() + func (n *Notebook) Complete(input string) bool + func (n *Notebook) Completions(before string) (Completion, error) + func (n *Notebook) Curl(i int) (string, error) + func (n *Notebook) DeleteBlock(i int) (Deleted, error) + func (n *Notebook) DeleteEarlierRun(i, k int) error + func (n *Notebook) DependsAt() ([]DependsProblem, Version) + func (n *Notebook) DescribeFix(warning string) (Fix, error) + func (n *Notebook) Dirty() bool + func (n *Notebook) Edit(v Version, edits []LineEdit) (EditReply, error) + func (n *Notebook) Enter(input string) error + func (n *Notebook) EnterUnrecorded(input string) error + func (n *Notebook) EnvBanner() string + func (n *Notebook) File() string + func (n *Notebook) FixWarning(warning string) error + func (n *Notebook) FrontMatter() (FrontMatter, error) + func (n *Notebook) FrontMatterError() string + func (n *Notebook) FrontMatterFix() Fix + func (n *Notebook) HasOutput() bool + func (n *Notebook) History() bool + func (n *Notebook) IncludeFile(i int) (IncludeFile, error) + func (n *Notebook) Kill() bool + func (n *Notebook) KillProcess(pid int) bool + func (n *Notebook) LinesSince(v Version) Lines + func (n *Notebook) MakeReport(r Report) ([]byte, error) + func (n *Notebook) MoveBlock(i, dir int, byBlock bool) (Move, error) + func (n *Notebook) MoveTo(from, at int) (Move, error) + func (n *Notebook) Names() Names + func (n *Notebook) Outside() []string + func (n *Notebook) PlanMove(i, dir int, byBlock bool) (Move, error) + func (n *Notebook) Processes() []env.ShellProcs + func (n *Notebook) Prompt() (Prompt, error) + func (n *Notebook) PromptAt(cols, rows int) (Prompt, error) + func (n *Notebook) Ran() (ran, total int) + func (n *Notebook) Redo() (string, error) + func (n *Notebook) Reload() (waiting bool, err error) + func (n *Notebook) ReplaceCast(i int, as string, frame int) error + func (n *Notebook) ReportCommand(r Report, home string) string + func (n *Notebook) Restart() error + func (n *Notebook) RunBlock(i int) error + func (n *Notebook) RunFrom(i int) error + func (n *Notebook) RunOptions() RunOptions + func (n *Notebook) RunRange(from, to int) error + func (n *Notebook) Save() error + func (n *Notebook) SaveAs(file string) error + func (n *Notebook) SetCastFrame(i int, body string, frame int) error + func (n *Notebook) SetChoice(i int, checked []bool) error + func (n *Notebook) SetDepends(i int, deps []int) error + func (n *Notebook) SetFolds(folds []Fold) error + func (n *Notebook) SetFrontMatter(f FrontMatter) error + func (n *Notebook) SetHistory(on, restart bool) (restarted bool, err error) + func (n *Notebook) SetHistoryRC(path string) + func (n *Notebook) SetHistoryReuse(on bool) + func (n *Notebook) SetIncludeRange(i, from, to int) error + func (n *Notebook) SetRunOptions(ro RunOptions) (waiting bool, err error) + func (n *Notebook) SetTask(task int, done bool) error + func (n *Notebook) SetTerminalSize(cols, rows int) + func (n *Notebook) SetText(base, text string) (bool, error) + func (n *Notebook) SetTextbox(i int, text string) error + func (n *Notebook) Stop() + func (n *Notebook) StopBackground(i int) bool + func (n *Notebook) TerminalSize() (cols, rows int) + func (n *Notebook) Text() string + func (n *Notebook) TextAt() (string, Version) + func (n *Notebook) Type(keys string) + func (n *Notebook) Undo() (string, error) + func (n *Notebook) Version() Version + func (n *Notebook) WriteReport(r Report) error + type Options struct + Confirm func(block int, question string) run.Answer + Depend func(block, of int, question string) run.Answer + Events *EventLog + OnEvent func(Event) + Outside func(paths []string) bool + Resolved func(file, warning string) + Run RunOptions + Sources func(paths []string) run.Answer + type Problem struct + From int + Message string + Severity string + To int + func CheckInfo(info string) []Problem + type Prompt struct + Dir string + PS1 string + PS2 string + type Report struct + Dest string + Format report.Format + HideCode bool + HideOutput bool + History bool + Ran bool + Saved bool + type RunOptions struct + Args []string + HistoryRC string + Only string + Shell string + Source string + Step bool + StopOnError bool + type SourceBlock struct + ID string + Line int + Runs bool + func SourceBlocks(text string) []SourceBlock + type TextboxCell struct + Block int + Fit bool + ID string + Lines int + NoSave bool + Placeholder string + Problem string + Text string + type Version struct + Doc int64 + Tick int