Documentation
¶
Overview ¶
Package edit is the single disk-writing surface in weft. It hands a page's .md file off to the user's editor and detects whether the file changed on return. No other package in the project writes to disk.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureFile ¶
EnsureFile creates an empty file at path with mode 0o644 if it does not exist. Returns (true, nil) on create, (false, nil) if the file already existed, or (false, err) for any other stat/write failure (including the case where path resolves to a directory). This is the create-today-journal hook.
func SnapshotMtime ¶
SnapshotMtime returns the file's modification time, or time.Time{} (the zero value) if the file does not exist. The zero return is load-bearing: t0.IsZero() means the file was absent at snapshot time, which tells the caller (the App's editCurrent) that it should create the file before handing it to the editor. A non-zero t0 means the file was on disk before the user pressed e.
Types ¶
type Env ¶
Env carries the configuration the editor-resolver reads. Decoupled from os.Getenv so tests can inject a fixed env without touching process state.