mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 00:47:15 -04:00
Simplify examples
This commit is contained in:
@@ -23,7 +23,7 @@ Bye!
|
|||||||
`
|
`
|
||||||
|
|
||||||
out, _ := glamour.Render(in, "dark")
|
out, _ := glamour.Render(in, "dark")
|
||||||
fmt.Printf(out)
|
fmt.Print(out)
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
@@ -36,21 +36,12 @@ import (
|
|||||||
"github.com/charmbracelet/glamour/ansi"
|
"github.com/charmbracelet/glamour/ansi"
|
||||||
)
|
)
|
||||||
|
|
||||||
in := `# Custom Renderer
|
|
||||||
|
|
||||||
Word-wrapping will occur when lines exceed the limit of 40 characters. Just so
|
|
||||||
you know: Glamour's default word-wrapping limit is set to 100 characters per
|
|
||||||
line.
|
|
||||||
|
|
||||||
Bye!
|
|
||||||
`
|
|
||||||
|
|
||||||
r, _ := glamour.NewTermRenderer("dark", ansi.Options{
|
r, _ := glamour.NewTermRenderer("dark", ansi.Options{
|
||||||
WordWrap: int(40),
|
WordWrap: int(40),
|
||||||
})
|
})
|
||||||
|
|
||||||
out, _ := r.Render(in)
|
out, _ := r.Render(in)
|
||||||
fmt.Printf("%s", out)
|
fmt.Print(out)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -22,5 +22,5 @@ Bye!
|
|||||||
})
|
})
|
||||||
|
|
||||||
out, _ := r.Render(in)
|
out, _ := r.Render(in)
|
||||||
fmt.Printf("%s", out)
|
fmt.Print(out)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,5 +16,5 @@ Bye!
|
|||||||
`
|
`
|
||||||
|
|
||||||
out, _ := glamour.Render(in, "dark")
|
out, _ := glamour.Render(in, "dark")
|
||||||
fmt.Printf(out)
|
fmt.Print(out)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user