Move ANSIRenderer into a separate package

This commit is contained in:
Christian Muehlhaeuser
2019-12-14 00:11:29 +01:00
parent 3018ad9a32
commit 4b65ed22c2
21 changed files with 245 additions and 227 deletions
+25
View File
@@ -0,0 +1,25 @@
package ansi
import (
"io"
)
type TaskElement struct {
Checked bool
}
func (e *TaskElement) Render(w io.Writer, ctx RenderContext) error {
var el *BaseElement
pre := ctx.options.Styles.Task.Unticked
if e.Checked {
pre = ctx.options.Styles.Task.Ticked
}
el = &BaseElement{
Prefix: pre,
Style: ctx.options.Styles.Task.StylePrimitive,
}
return el.Render(w, ctx)
}