page

package module
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: OSL-3.0 Imports: 11 Imported by: 0

README

Page

portal

Crushed between two portals experiment

Terminal pager

badge

Test

Make sure test produces output. Also try pressing down at the bottom. Also try a search.

go build
go test
go mod tidy
staticcheck

Size

Ov:

git clone git://github.com/noborus/ov
Set-Location ov/oviewer
git checkout 151619ff85610faae8901217f185c4deba284c61
go-size

*.go 2,147
go.sum 62

Moar:

git clone git://github.com/walles/moar
Set-Location moar/m
git checkout 374378b9797a1c2862aa75d68654342706a41226
go-size

*.go 1,961
go.sum 48

API

read := page.NewReaderFromStream("winter", b)
p := page.NewPager(read)
p.DeInit, p.ShowLineNumbers = false, false
return p.Page()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pager

type Pager struct {

	// NewPager shows lines by default, this field can hide them
	ShowLineNumbers bool
	// If true, pager will clear the screen on return. If false, pager will
	// clear the last line, and show the cursor.
	DeInit bool
	// contains filtered or unexported fields
}

Pager is the main on-screen pager

func NewPager

func NewPager(name string, reader io.Reader) *Pager

NewPager creates a new Pager

func (*Pager) Page added in v1.3.5

func (p *Pager) Page() error

Page displays text in a pager.

Jump to

Keyboard shortcuts

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