Documentation
¶
Overview ¶
Package template provides template loading and variable substitution for Raven.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply substitutes template variables in the content. Variables use {{name}} syntax. Unknown variables are left as-is. Escaped variables \{{name}} are converted to literal {{name}}.
func Load ¶
Load loads a template from a file path and enforces template directory policy. Inline template content is not supported.
func ResolveFileRef ¶
ResolveFileRef normalizes a template file path and enforces directories.template policy. Bare filenames are resolved under templateDir.
Types ¶
type Variables ¶
type Variables struct {
// Title is the title passed to rvn new
Title string
// Slug is the slugified title
Slug string
// Type is the type name
Type string
// Date is today's date (YYYY-MM-DD)
Date string
// Datetime is the current datetime (YYYY-MM-DDTHH:MM)
Datetime string
// Year is the current year
Year string
// Month is the current month (2 digit)
Month string
// Day is the current day (2 digit)
Day string
// Weekday is the day name (Monday, Tuesday, etc.)
Weekday string
// Fields are field values from --field flags
Fields map[string]string
}
Variables holds the available template variables for substitution.
func NewDailyVariables ¶
NewDailyVariables creates Variables for a daily note with a specific date.