Files
bubbletea/examples/pager/main.go
Christian Rocha ade8203c21 Remove entire subscription model
It was a valiant effort, and the implementation was solid and
dependable, but at the end of the day we can achieve the same
functionality in a much simpler fashion with commands, especially
because Go is not held to the same restrictions as Elm.
2020-05-12 18:00:50 -04:00

30 lines
488 B
Go

package main
import (
"fmt"
"io/ioutil"
"os"
"github.com/charmbracelet/boba"
"github.com/charmbracelet/boba/pager"
)
func main() {
content, err := ioutil.ReadFile("artichoke.md")
if err != nil {
fmt.Println("could not load file:", err)
os.Exit(1)
}
boba.AltScreen()
defer boba.ExitAltScreen()
if err := boba.NewProgram(
pager.Init(string(content)),
pager.Update,
pager.View,
).Start(); err != nil {
fmt.Println("could not run program:", err)
os.Exit(1)
}
}