cmdhelp

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cmdhelp is a nushell command's help, F1 on a command in a notebook's cell: a scrollable box over the notebook with what the command does, a link to its page in nushell's docs, its usage, flags, parameters, input and output types and examples, as nu's help has them. It knows the UI only through Host.

Index

Constants

View Source
const ID = "cmdhelp"

ID identifies the view's box in mouse events.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host interface {
	Theme() *theme.Theme
	Size() (width, height int)
	// Close closes the open overlay.
	Close()
	// Code draws a line of nushell highlighted.
	Code(src string) string
}

Host is what the help needs of the UI.

type View

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

View is the open help.

func New

func New(h Host, help nushell.Help) *View

New returns the help of a command, scrolled to the top.

func (*View) Indicator

func (s *View) Indicator() string

func (*View) Key

func (s *View) Key(k tea.KeyPressMsg) tea.Cmd

func (*View) Layout

func (s *View) Layout() []overlay.Box

func (*View) Lines

func (s *View) Lines() []string

Lines are the help's lines at the box's width.

func (*View) Mouse

func (s *View) Mouse(e overlay.MouseEvent) tea.Cmd

func (*View) Status

func (s *View) Status() (string, string)

func (*View) Top

func (s *View) Top() int

Top is the first line shown.

Jump to

Keyboard shortcuts

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