Documentation ¶
Overview ¶
Source: https://github.com/maaslalani/slides/blob/main/internal/model/model.go
Pager is lifted from https://raw.githubusercontent.com/charmbracelet/glow/d0737b41af48960a341e24327d9d5acb5b7d92aa/ui/pager.go Thank you for such an awesome design!
Source: https://raw.githubusercontent.com/charmbracelet/glow/master/ui/stashhelp.go
Source: https://raw.githubusercontent.com/charmbracelet/glow/master/ui/stashitem.go
Index ¶
- Variables
- func AsMarkdown(path string, e v1.Entry) markdown
- func EntryTaskStatus(e *v1.Entry, style TaskCompletionStyle) string
- type DocType
- type DocTypeSet
- type Mode
- type Model
- func (m *Model) CurrentEntry() (*v1.Entry, error)
- func (m *Model) CurrentEntryPath() string
- func (m *Model) DefaultTagsForTime(t time.Time) []string
- func (m *Model) EditMarkdown(md *markdown) tea.Cmd
- func (m Model) Init() tea.Cmd
- func (m *Model) LogUserError(err error)
- func (m *Model) LogUserNotice(msg string)
- func (m *Model) TitleFromTime(t time.Time) string
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- type TaskCompletionStyle
- type TaskListStatus
Constants ¶
This section is empty.
Variables ¶
var ( // EntryTemplate is the default value for a new entry's content EntryTemplate = `- [ ] ...` // DefaultConfig is the default configuration that is used, along with ~/.jot.yaml DefaultConfig = v1.Config{ Directory: "~/.jot.d", WeekendTags: []string{"weekend"}, WorkdayTags: []string{"work", "$employer"}, HolidayTags: []string{"holiday"}, StartWorkHours: 9 * time.Hour, EndWorkHours: 18*time.Hour + 30*time.Minute, } // CreateDirectoryIfMissing creates config.Directory if not already existing CreateDirectoryIfMissing = true )
Functions ¶
func AsMarkdown ¶
func EntryTaskStatus ¶
func EntryTaskStatus(e *v1.Entry, style TaskCompletionStyle) string
Types ¶
type DocType ¶
type DocType int
DocType represents a type of markdown document.
Available document types.
type DocTypeSet ¶
type DocTypeSet map[DocType]struct{}
DocTypeSet is a set (in the mathematic sense) of document types.
func NewDocTypeSet ¶
func NewDocTypeSet(t ...DocType) DocTypeSet
NewDocTypeSet returns a set of document types.
func (*DocTypeSet) Add ¶
func (d *DocTypeSet) Add(t ...DocType) int
Add adds a document type of the set.
func (DocTypeSet) AsSlice ¶
func (d DocTypeSet) AsSlice() (agg []DocType)
AsSlice returns the set as a slice of document types.
func (DocTypeSet) Contains ¶
func (d DocTypeSet) Contains(m ...DocType) bool
Contains returns whether or not the set contains the given DocTypes.
func (DocTypeSet) Difference ¶
func (d DocTypeSet) Difference(t ...DocType) DocTypeSet
Difference return a DocumentType set that does not contain the given types.
func (DocTypeSet) Equals ¶
func (d DocTypeSet) Equals(other DocTypeSet) bool
Equals returns whether or not the two sets are equal.
type Model ¶
type Model struct { db.DB UseAltScreen bool Author string Timeline []time.Time Date time.Time Config v1.Config Mode Mode // contains filtered or unexported fields }
func NewFromConfigFile ¶
func (*Model) CurrentEntryPath ¶
func (*Model) EditMarkdown ¶
func (*Model) LogUserError ¶
LogUserNotice registers an informational message with the app for display via UI, logs, whatever
func (*Model) LogUserNotice ¶
type TaskCompletionStyle ¶
type TaskCompletionStyle string
var ( TaskStylePercent TaskCompletionStyle = "percent" TaskStyleDiscrete TaskCompletionStyle = "discrete" )
type TaskListStatus ¶
func TaskList ¶
func TaskList(content string) TaskListStatus
func (*TaskListStatus) Percent ¶
func (tls *TaskListStatus) Percent() float64
func (*TaskListStatus) PercentString ¶
func (tls *TaskListStatus) PercentString() string
func (*TaskListStatus) String ¶
func (tls *TaskListStatus) String() string