Decode style JSON into a typed struct

This commit is contained in:
Christian Muehlhaeuser
2019-12-13 03:04:48 +01:00
parent 219f21c4e7
commit 35342a2061
17 changed files with 184 additions and 249 deletions
+3 -3
View File
@@ -11,14 +11,14 @@ type CheckedItemElement struct {
func (e *CheckedItemElement) Render(w io.Writer, ctx RenderContext) error {
var el *BaseElement
pre := "✗ "
pre := ctx.styles.Task.Unticked
if e.Checked {
pre = "✓ "
pre = ctx.styles.Task.Ticked
}
el = &BaseElement{
Prefix: pre,
Style: ctx.style[CheckedItem],
Style: ctx.styles.Task.StylePrimitive,
}
return el.Render(w, ctx)