Documentation ¶
Index ¶
- func ParseTemplateFileName(fileName string, opts config.FileOpts) (t time.Time, ok bool)
- type MonthArchiveTemplate
- type Template
- func (t *Template) CopySectionContents(src sectionGettable, sectionName string) error
- func (t *Template) DeleteSectionContents(sectionName string) error
- func (t *Template) GetDate() time.Time
- func (t *Template) GetFileCursorLine() int
- func (t *Template) GetFilePath() string
- func (t *Template) Load(r io.Reader) error
- func (t *Template) Write(w io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MonthArchiveTemplate ¶
type MonthArchiveTemplate struct {
*Template
}
MonthArchiveTemplate contains the structure of a month archive
func NewMonthArchiveTemplate ¶
func NewMonthArchiveTemplate(opts config.Opts, date time.Time) *MonthArchiveTemplate
NewMonthArchiveTemplate constructs a new MonthArchiveTemplate
func (*MonthArchiveTemplate) ArchiveSectionContents ¶
func (t *MonthArchiveTemplate) ArchiveSectionContents(src *Template, sectionName string) error
ArchiveSectionContents concatenates the contents of the specified section from a source template and appends to the contents of the receiver's section with a header derived from the source template's date
func (*MonthArchiveTemplate) GetFilePath ¶
func (t *MonthArchiveTemplate) GetFilePath() string
GetFilePath generates a full path for a file based on the template date
func (*MonthArchiveTemplate) Merge ¶
func (t *MonthArchiveTemplate) Merge(src *MonthArchiveTemplate) error
Merge merges a source MonthArchiveTemplate into the receiver This is a convenience function that iterates and copies all sections in the receiver
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template contains the structure of a note
func NewTemplate ¶
NewTemplate constructs a new Template
func (*Template) CopySectionContents ¶
CopySectionContents copies the contents of the specified section from a source template by appending to the contents of the receiver's section
func (*Template) DeleteSectionContents ¶
DeleteSectionContents deletes the contents of a specified section
func (*Template) GetFileCursorLine ¶
GetFileCursorLine returns the line at which to place the cursor when opening the template
func (*Template) GetFilePath ¶
GetFilePath generates a full path for a file based on the template date
Directories ¶
Path | Synopsis |
---|---|
Package templatetest provides utilities for template testing
|
Package templatetest provides utilities for template testing |