format

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package format provides formatting helpers for TUI components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PersonInitials

func PersonInitials(name string) string

PersonInitials returns initials from a name.

func RecordingTypeIcon

func RecordingTypeIcon(recordingType string) string

RecordingTypeIcon returns an icon for the recording type.

func RecordingTypeName

func RecordingTypeName(recordingType string) string

RecordingTypeName returns a human-readable name for recording types.

func RelativeTime

func RelativeTime(t time.Time) string

RelativeTime formats a time as a relative duration (e.g., "2h ago", "3d ago").

func StripHTML

func StripHTML(s string) string

StripHTML removes HTML tags from a string and normalizes whitespace.

Types

type Person

type Person struct {
	ID         int64
	Name       string
	Email      string
	AvatarURL  string
	Admin      bool
	Owner      bool
	TimeZone   string
	PersonType string // client, employee, etc.
}

Person formats a person for picker display.

func (Person) ToPickerDescription

func (p Person) ToPickerDescription() string

ToPickerDescription returns a formatted description for picker display.

func (Person) ToPickerTitle

func (p Person) ToPickerTitle() string

ToPickerTitle returns a formatted title for picker display.

type Project

type Project struct {
	ID          int64
	Name        string
	Purpose     string
	Description string
	Status      string
	Bookmarked  bool
}

Project formats a project for picker display.

func (Project) ToPickerDescription

func (p Project) ToPickerDescription() string

ToPickerDescription returns a formatted description for picker display.

func (Project) ToPickerTitle

func (p Project) ToPickerTitle() string

ToPickerTitle returns a formatted title for picker display.

type Recording

type Recording struct {
	ID        int64
	Type      string
	Title     string
	Content   string
	Creator   string
	CreatedAt time.Time
}

Recording formats a recording for picker display.

func (Recording) ToPickerDescription

func (r Recording) ToPickerDescription() string

ToPickerDescription returns a formatted description for picker display.

func (Recording) ToPickerTitle

func (r Recording) ToPickerTitle() string

ToPickerTitle returns a formatted title for picker display.

Jump to

Keyboard shortcuts

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