Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct { Time time.Time File string // Linked list of tags. FirstTag *tagNode // contains filtered or unexported fields }
Entry is a file in the journal and its associated tags.
func (Entry) Title ¶
Title returns a title for the entry. It uses the first heading if one exists. If no heading is found, it uses the portion of the entry's filename after the date as the title. In the latter case, dashes (`-`) and underscores (`_`) are converted to spaces, and the first letter of each word is capitalized.
type FileParser ¶
FileParser parses entry file markdown contents into ctags tags.
type Journal ¶
Journal is a collection of entries and labels.
func (Journal) WriteLabels ¶
func (j Journal) WriteLabels(w io.Writer, setters ...WriterOption) error
WriteLabels generates a list of entries categorized by label and writes the result to a writer.
func (Journal) WriteTimeline ¶
func (j Journal) WriteTimeline(w io.Writer, setters ...WriterOption) error
WriteTimeline generates a timeline view of entries and writes the result to a writer.
type LabelOccurrences ¶
type LabelOccurrences []LabelTag
LabelOccurrences attaches the methods of sort.Interface to []LabelTag.
func (LabelOccurrences) Len ¶
func (lo LabelOccurrences) Len() int
func (LabelOccurrences) Less ¶
func (lo LabelOccurrences) Less(i, j int) bool
Sort by label name in increasing order, then tagfile and line number in decreasing order.
func (LabelOccurrences) Swap ¶
func (lo LabelOccurrences) Swap(i, j int)
type LabelTag ¶
type LabelTag struct {
// contains filtered or unexported fields
}
LabelTag is an occurrence of a Label within a journal entry.
type TagLines ¶
TagLines attaches the methods of sort.Interface to []ctags.TagLine.
type WriterOption ¶
type WriterOption func(*WriterOptions)
WriterOption appplies an option to a WriterOptions struct.
func HeadingLevel ¶
func HeadingLevel(level int) WriterOption
HeadingLevel sets the Level WriterOption value.
type WriterOptions ¶
type WriterOptions struct {
Level int
}
WriterOptions stores options for write functions.