Documentation
¶
Index ¶
- Constants
- func BoolPtr(b bool) *bool
- func Clamp(mn, wanted, mx int) int
- func GetStylePrefix(s lipgloss.Style) string
- func IntPtr(u int) *int
- func Max(a, b int) int
- func Min(a, b int) int
- func ParseDuration(s string) (time.Duration, error)
- func RemoveLastReset(s string) string
- func RemoveReset(s string) string
- func ShortNumber(n int) string
- func StringPtr(s string) *string
- func TimeElapsed(then time.Time) string
- func UintPtr(u uint) *uint
- type TemplateRegistry
- func (or *TemplateRegistry) LinkHandler(fh sprout.Handler) error
- func (or *TemplateRegistry) NowModify(input string) (string, error)
- func (or *TemplateRegistry) RegisterAliases(aliasMap sprout.FunctionAliasMap) error
- func (or *TemplateRegistry) RegisterFunctions(funcsMap sprout.FunctionMap) error
- func (or *TemplateRegistry) UID() string
Constants ¶
View Source
const ( ApproxDaysInYear = 365 ApproxDaysInMonth = 28 DaysInWeek = 7 )
Variables ¶
This section is empty.
Functions ¶
func GetStylePrefix ¶
GetStylePrefix extracts ANSI codes from a lipgloss style without the trailing reset. This allows styled text to be concatenated without breaking parent background colors.
func ParseDuration ¶
ParseDuration parses a duration string. examples: "10d", "-1.5w" or "3Y4M5d". Add time units are "d"="D", "w"="W", "mo=M", "y"="Y".
func ShortNumber ¶
func TimeElapsed ¶
Types ¶
type TemplateRegistry ¶
type TemplateRegistry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *TemplateRegistry
func (*TemplateRegistry) LinkHandler ¶
func (or *TemplateRegistry) LinkHandler(fh sprout.Handler) error
func (*TemplateRegistry) NowModify ¶
func (or *TemplateRegistry) NowModify(input string) (string, error)
func (*TemplateRegistry) RegisterAliases ¶
func (or *TemplateRegistry) RegisterAliases(aliasMap sprout.FunctionAliasMap) error
func (*TemplateRegistry) RegisterFunctions ¶
func (or *TemplateRegistry) RegisterFunctions(funcsMap sprout.FunctionMap) error
func (*TemplateRegistry) UID ¶
func (or *TemplateRegistry) UID() string
Click to show internal directories.
Click to hide internal directories.