Documentation
¶
Index ¶
- Constants
- func NewTable(questions []domain.QuestionStat, languages []string, config *TableConfig) (table.Model, error)
- func Render(questions []domain.QuestionStat, languages []string) error
- func RenderWithConfig(questions []domain.QuestionStat, languages []string, config *TableConfig) error
- func RunInteractiveTable(tableModel table.Model) error
- type StyleConfig
- type TableConfig
Constants ¶
View Source
const ( DefaultMaxHeight = 10 DefaultIDWidth = 4 DefaultNameWidth = 30 DefaultDiffWidth = 14 DefaultLangPadding = 2 MinTableHeight = 3 )
Constants for default values
Variables ¶
This section is empty.
Functions ¶
func NewTable ¶
func NewTable(questions []domain.QuestionStat, languages []string, config *TableConfig) (table.Model, error)
NewTable creates a new table model without running the interactive program
func Render ¶
func Render(questions []domain.QuestionStat, languages []string) error
Render creates and displays an interactive table with the given questions and languages Uses default configuration
func RenderWithConfig ¶
func RenderWithConfig(questions []domain.QuestionStat, languages []string, config *TableConfig) error
RenderWithConfig creates and displays an interactive table with custom configuration
func RunInteractiveTable ¶
RunInteractiveTable runs the TUI program with the given table model
Types ¶
type StyleConfig ¶
type StyleConfig struct {
Base lipgloss.Style
Center lipgloss.Style
Bold lipgloss.Style
Difficulty map[string]lipgloss.Style
}
StyleConfig centralizes all table styling
func DefaultStyles ¶
func DefaultStyles() *StyleConfig
DefaultStyles returns the default style configuration
type TableConfig ¶
type TableConfig struct {
MaxHeight int
IDWidth int
NameWidth int
DiffWidth int
LangPadding int
Styles *StyleConfig
}
TableConfig holds table configuration options
func DefaultConfig ¶
func DefaultConfig() *TableConfig
DefaultConfig returns a configuration with sensible defaults
Click to show internal directories.
Click to hide internal directories.