table

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

func RunInteractiveTable(tableModel table.Model) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL