mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-08-28 04:46:29 -04:00
27 lines
414 B
Go
27 lines
414 B
Go
package gold
|
|
|
|
import (
|
|
"io"
|
|
"strconv"
|
|
)
|
|
|
|
type ItemElement struct {
|
|
Enumeration uint
|
|
}
|
|
|
|
func (e *ItemElement) Render(w io.Writer, ctx RenderContext) error {
|
|
var el *BaseElement
|
|
if e.Enumeration > 0 {
|
|
el = &BaseElement{
|
|
Style: ctx.styles.Enumeration,
|
|
Prefix: strconv.FormatInt(int64(e.Enumeration), 10),
|
|
}
|
|
} else {
|
|
el = &BaseElement{
|
|
Style: ctx.styles.Item,
|
|
}
|
|
}
|
|
|
|
return el.Render(w, ctx)
|
|
}
|