Skip to content
Myr

Pager example

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent 5ae6029 · Browse files · 2 files+93 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+93 added−0 removed

  • other:+93 added−0 removed

2 files+93 added−0 removed

added:examples/pager/artichoke.md+68 added
added:examples/pager/main.go+25 added
1package main23import (4 "fmt"5 "io/ioutil"6 "os"78 "github.com/charmbracelet/tea"9 "github.com/charmbracelet/teaparty/pager"10)1112func main() {13 content, err := ioutil.ReadFile("artichoke.md")14 if err != nil {15 fmt.Println("could not load file:", err)16 os.Exit(1)17 }1819 tea.AltScreen()20 defer tea.ExitAltScreen()21 if err := pager.NewProgram(string(content)).Start(); err != nil {22 fmt.Println("could not run program:", err)23 os.Exit(1)24 }25}