Documentation
¶
Index ¶
- func AnsiParse(input string) string
- func ClearTemplateConfigCache(userId int)
- func DynamicList(itmNames []NameDescription, colWidth, sw, numWidth, longestName int) string
- func Exists(name string) bool
- func LoadAliases(f ...fileloader.ReadableGroupFS)
- func Process(fname string, data any, receivingUserId ...int) (string, error)
- func ProcessText(text string, data any, ansiFlags ...AnsiFlag) (string, error)
- func RegisterFS(f fs.ReadFileFS)
- func SetAnsiFlag(flag AnsiFlag)
- func TNL(userId int) string
- func TplAnsiParse(input string) string
- type AnsiFlag
- type NameDescription
- type TemplateTable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearTemplateConfigCache ¶
func ClearTemplateConfigCache(userId int)
func DynamicList ¶
func DynamicList(itmNames []NameDescription, colWidth, sw, numWidth, longestName int) string
DynamicList takes a slice of NameDescription items and formats them into a string NOTE: This is a first step to moving dynamic lists into a common function.
func LoadAliases ¶
func LoadAliases(f ...fileloader.ReadableGroupFS)
Loads the ansi aliases from the config file Only if the file has been modified since the last load
func RegisterFS ¶
func RegisterFS(f fs.ReadFileFS)
func TplAnsiParse ¶
Types ¶
type AnsiFlag ¶
type AnsiFlag uint8
const ( AnsiTagsDefault AnsiFlag = iota // Do not parse tags AnsiTagsParse // Parse ansi tags before returning contents of template AnsiTagsStrip // strip out all ansi tags and leave text plain AnsiTagsMono // Parse ansi tags, but strip out all color information AnsiTagsNone = AnsiTagsDefault // alias to default ForceScreenReaderUserId = -1 )
type NameDescription ¶
type NameDescription struct {
Id any // optional identifier.
Marked bool // mark in some way?
Name string
Description string
}
A common structure used in templating
type TemplateTable ¶
type TemplateTable struct {
Title string
Header []string
Rows [][]string
TrueHeaderCellSize []int
TrueCellSize [][]int
ColumnCount int
ColumnWidths []int
Formatting [][]string
// contains filtered or unexported fields
}
func GetTable ¶
func GetTable(title string, headers []string, rows [][]string, formatting ...[]string) TemplateTable
func (TemplateTable) GetHeaderCell ¶
func (t TemplateTable) GetHeaderCell(column int) string
Click to show internal directories.
Click to hide internal directories.