Documentation
¶
Overview ¶
Package excel renders and reads xlsx workbooks for clicky. It is the only clicky package importing excelize, so binaries that never touch spreadsheets don't compile it; opt in with Use().
Index ¶
- func Use()
- func WriteFile(data any, path string) error
- type Formatter
- func (f *Formatter) Format(data interface{}) (string, error)
- func (f *Formatter) FormatPrettyData(data *api.PrettyData) (string, error)
- func (f *Formatter) FormatPrettyDataToFile(data *api.PrettyData, filename string, file *excelize.File) error
- func (f *Formatter) FormatToFile(data interface{}, filename string) error
- type Sheet
- type Workbook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Formatter ¶
type Formatter struct {
SheetName string
}
Formatter handles Excel file generation
func (*Formatter) Format ¶
Format renders data as the bytes of an xlsx workbook.
The string is binary, not text — callers write it verbatim (FormatToFile does, and a --format excel sink is a file). It is a string because that is the FormatterFunc contract every other format shares.
func (*Formatter) FormatPrettyData ¶
func (f *Formatter) FormatPrettyData(data *api.PrettyData) (string, error)
FormatPrettyData formats PrettyData to Excel bytes (for in-memory operations)
func (*Formatter) FormatPrettyDataToFile ¶
func (f *Formatter) FormatPrettyDataToFile(data *api.PrettyData, filename string, file *excelize.File) error
FormatPrettyDataToFile formats PrettyData into file and saves it to filename.
func (*Formatter) FormatToFile ¶
FormatToFile creates an Excel file and saves it to the specified path