diff --git a/examples/go.mod b/examples/go.mod index 824d98afa8..0b5d95f2f1 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -42,7 +42,7 @@ require ( github.com/yuin/goldmark-emoji v1.0.3 // indirect golang.org/x/net v0.27.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/examples/go.sum b/examples/go.sum index de23189c39..4e77da7ea8 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -80,8 +80,8 @@ golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= diff --git a/examples/pager/artichoke.md b/examples/pager/artichoke.md index 00824b98ea..59045fc19f 100644 --- a/examples/pager/artichoke.md +++ b/examples/pager/artichoke.md @@ -1,15 +1,10 @@ -Glow -==== +# Glow A casual introduction. 你好世界! ## Let’s talk about artichokes -The _artichoke_ is mentioned as a garden plant in the 8th century BC by Homer -**and** Hesiod. The naturally occurring variant of the artichoke, the cardoon, -which is native to the Mediterranean area, also has records of use as a food -among the ancient Greeks and Romans. Pliny the Elder mentioned growing of -_carduus_ in Carthage and Cordoba. +The _artichoke_ is mentioned as a garden plant in the 8th century BC by Homer **and** Hesiod. The naturally occurring variant of the artichoke, the cardoon, which is native to the Mediterranean area, also has records of use as a food among the ancient Greeks and Romans. Pliny the Elder mentioned growing of _carduus_ in Carthage and Cordoba. > He holds him with a skinny hand, > ‘There was a ship,’ quoth he. @@ -25,28 +20,27 @@ _carduus_ in Carthage and Cordoba. 1. Carrots 1. Celery 1. Tacos - * Soft - * Hard + - Soft + - Hard 1. Cucumber ## Things to eat today -* [x] Carrots -* [x] Ramen -* [ ] Currywurst +- [x] Carrots +- [x] Ramen +- [ ] Currywurst ### Power levels of the aforementioned foods | Name | Power | Comment | -| --- | --- | --- | +| ---------- | ----- | ---------------- | | Carrots | 9001 | It’s over 9000?! | | Ramen | 9002 | Also over 9000?! | | Currywurst | 10000 | What?! | ## Currying Artichokes -Here’s a bit of code in [Haskell](https://haskell.org), because we are fancy. -Remember that to compile Haskell you’ll need `ghc`. +Here’s a bit of code in [Haskell](https://haskell.org), because we are fancy. Remember that to compile Haskell you’ll need `ghc`. ```haskell module Main where @@ -63,6 +57,6 @@ main = map hello [ "artichoke", "alcachofa" ] & intercalculate "\n" & putStrLn ``` -*** +--- _Alcachofa_, if you were wondering, is artichoke in Spanish. diff --git a/examples/pager/main.go b/examples/pager/main.go index 6969f01965..d298d018a6 100644 --- a/examples/pager/main.go +++ b/examples/pager/main.go @@ -62,8 +62,11 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // here. m.viewport = viewport.New(msg.Width, msg.Height-verticalMarginHeight) m.viewport.YPosition = headerHeight - m.viewport.SetContent(m.content) m.ready = true + + // Wrap content, if necessary. + c := lipgloss.NewStyle().Width(m.viewport.Width).Render(m.content) + m.viewport.SetContent(c) } else { m.viewport.Width = msg.Width m.viewport.Height = msg.Height - verticalMarginHeight