Documentation
¶
Index ¶
- func DB(path string) (*gorm.DB, error)
- type InputList
- type Listable
- type ListableForm
- func (form *ListableForm) AddInputField(field *tview.InputField)
- func (form *ListableForm) Empty() bool
- func (form *ListableForm) Height() int
- func (form *ListableForm) Primitive() tview.Primitive
- func (form *ListableForm) SetFocusFn(fn func()) Listable
- func (form *ListableForm) SetHeight(height int) Listable
- type ListableInputField
- func (field *ListableInputField) Empty() bool
- func (field *ListableInputField) Height() int
- func (field *ListableInputField) Primitive() tview.Primitive
- func (field *ListableInputField) SetFocusFn(fn func()) Listable
- func (field *ListableInputField) SetHeight(height int) Listable
- func (field *ListableInputField) SetText(text string) *ListableInputField
- type NutrientInputsTUI
- type NutrientSource
- type Recipe
- type TUI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InputList ¶
type InputList[T Listable] struct { App *tview.Application Children []T FocusIndex int Grid *tview.Grid MaxHeight int MinRowHeight int NewFn func() T }
func NewInputList ¶
func NewInputList[T Listable](app *tview.Application, newFn func() T, maxHeight, minRowHeight int) *InputList[T]
func (*InputList[T]) GridInputCaptureFn ¶
func (list *InputList[T]) GridInputCaptureFn(event *tcell.EventKey) *tcell.EventKey
func (*InputList[T]) RecalculateGrid ¶
func (list *InputList[T]) RecalculateGrid()
func (*InputList[T]) RerenderGrid ¶
func (list *InputList[T]) RerenderGrid()
type ListableForm ¶
type ListableForm struct { *tview.Form InputFields []*tview.InputField // contains filtered or unexported fields }
func NewListableForm ¶
func NewListableForm() *ListableForm
func NewListableSingleInputForm ¶
func NewListableSingleInputForm() *ListableForm
func (*ListableForm) AddInputField ¶
func (form *ListableForm) AddInputField(field *tview.InputField)
func (*ListableForm) Empty ¶
func (form *ListableForm) Empty() bool
func (*ListableForm) Height ¶
func (form *ListableForm) Height() int
func (*ListableForm) Primitive ¶
func (form *ListableForm) Primitive() tview.Primitive
func (*ListableForm) SetFocusFn ¶
func (form *ListableForm) SetFocusFn(fn func()) Listable
func (*ListableForm) SetHeight ¶
func (form *ListableForm) SetHeight(height int) Listable
type ListableInputField ¶
type ListableInputField struct { *tview.InputField // contains filtered or unexported fields }
func NewListableInputField ¶
func NewListableInputField() *ListableInputField
func (*ListableInputField) Empty ¶
func (field *ListableInputField) Empty() bool
func (*ListableInputField) Height ¶
func (field *ListableInputField) Height() int
func (*ListableInputField) Primitive ¶
func (field *ListableInputField) Primitive() tview.Primitive
func (*ListableInputField) SetFocusFn ¶
func (field *ListableInputField) SetFocusFn(fn func()) Listable
func (*ListableInputField) SetHeight ¶
func (field *ListableInputField) SetHeight(height int) Listable
func (*ListableInputField) SetText ¶
func (field *ListableInputField) SetText(text string) *ListableInputField
type NutrientInputsTUI ¶
type NutrientInputsTUI struct { ListableForm IngredientInput *tview.InputField QuantityInput *tview.InputField UnitInput *tview.InputField }
type NutrientSource ¶
type Recipe ¶
type Recipe struct { ID uint `yaml:"cache_id"` Title string Author string License string Image string ImageCredit string `yaml:"image_credit"` ImageLicense string `yaml:"image_license"` Servings uint64 Tags []string Ingredients []string Directions []string NutrientSources []NutrientSource `yaml:"nutrient_sources"` // contains filtered or unexported fields }
func RecipeFromFile ¶
func (*Recipe) ClearNutritionData ¶
func (r *Recipe) ClearNutritionData()
func (*Recipe) NutritionData ¶
func (r *Recipe) NutritionData(db *gorm.DB) *nutrition.NutritionData
type TUI ¶
type TUI struct { Recipe *Recipe FilePath string App *tview.Application Screen tcell.Screen MainFlex *tview.Flex LeftFlex *tview.Flex RightFlex *tview.Flex BasicsFlex *tview.Flex TitleInput *tview.InputField AuthorInput *tview.InputField LicenseInput *tview.InputField ServingsInput *tview.InputField ImageFlex *tview.Flex ImagePathInput *tview.InputField ImageCreditInput *tview.InputField ImageLicenseInput *tview.InputField TagsList *InputList[*ListableForm] IngredientsList *InputList[*ListableForm] DirectionsFlex *tview.Flex DirectionsArea *tview.TextArea NutrientsFormList *InputList[*NutrientInputsTUI] Main *tview.Frame Pages *tview.Pages // contains filtered or unexported fields }
func (*TUI) LoadRecipe ¶
func (*TUI) NewNutrientInputsTUI ¶
func (tui *TUI) NewNutrientInputsTUI() *NutrientInputsTUI
func (*TUI) NewTagForm ¶
func (tui *TUI) NewTagForm() *ListableForm
func (*TUI) UpdateRecipe ¶
Click to show internal directories.
Click to hide internal directories.