ui

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 34 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProgram

func NewProgram(cfg Config) *tea.Program

NewProgram returns a new Tea program.

Types

type Config

type Config struct {
	ShowAllFiles    bool
	Gopath          string `env:"GOPATH"`
	HomeDir         string `env:"HOME"`
	GlamourMaxWidth uint
	GlamourStyle    string
	EnableMouse     bool

	// Which directory should we start from?
	WorkingDirectory string

	// Which document types shall we show?
	DocumentTypes DocTypeSet

	// For debugging the UI
	Logfile              string `env:"GLOW_LOGFILE"`
	HighPerformancePager bool   `env:"GLOW_HIGH_PERFORMANCE_PAGER" default:"true"`
	GlamourEnabled       bool   `env:"GLOW_ENABLE_GLAMOUR" default:"true"`
}

Config contains TUI-specific configuration.

type DocType added in v1.3.0

type DocType int

DocType represents a type of markdown document.

const (
	NoDocType DocType = iota
	LocalDoc
	StashedDoc
	ConvertedDoc
	NewsDoc
)

Available document types.

func (DocType) String added in v1.3.0

func (d DocType) String() string

type DocTypeSet added in v1.3.0

type DocTypeSet map[DocType]struct{}

DocTypeSet is a set (in the mathematic sense) of document types.

func NewDocTypeSet added in v1.3.0

func NewDocTypeSet(t ...DocType) DocTypeSet

NewDocTypeSet returns a set of document types.

func (*DocTypeSet) Add added in v1.3.0

func (d *DocTypeSet) Add(t ...DocType) int

Add adds a document type of the set.

func (DocTypeSet) AsSlice added in v1.3.0

func (d DocTypeSet) AsSlice() (agg []DocType)

AsSlice returns the set as a slice of document types.

func (DocTypeSet) Contains added in v1.3.0

func (d DocTypeSet) Contains(m ...DocType) bool

Contains returns whether or not the set contains the given DocTypes.

func (DocTypeSet) Difference added in v1.3.0

func (d DocTypeSet) Difference(t ...DocType) DocTypeSet

Difference return a DocumentType set that does not contain the given types.

func (DocTypeSet) Equals added in v1.3.0

func (d DocTypeSet) Equals(other DocTypeSet) bool

Equals returns whether or not the two sets are equal.

Jump to

Keyboard shortcuts

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