okami.mom/glamour

git clone https://git.nkp.pet/okami.mom/glamour

Andrey Neringfix(lint): add missing documentation comments6cde463

main
477 B27 linesraw
1package ansi
2
3import (
4	"io"
5)
6
7// A TaskElement is used to render tasks inside a todo-list.
8type TaskElement struct {
9	Checked bool
10}
11
12// Render renders a TaskElement.
13func (e *TaskElement) Render(w io.Writer, ctx RenderContext) error {
14	var el *BaseElement
15
16	pre := ctx.options.Styles.Task.Unticked
17	if e.Checked {
18		pre = ctx.options.Styles.Task.Ticked
19	}
20
21	el = &BaseElement{
22		Prefix: pre,
23		Style:  ctx.options.Styles.Task.StylePrimitive,
24	}
25
26	return el.Render(w, ctx)
27}