Documentation
¶
Index ¶
- func AtomicWriteFile(path string, data []byte) error
- func CurrentFile() (string, error)
- func GenerateTemplate(name string) []byte
- func GetCurrent() (string, error)
- func GitRoot() (string, error)
- func ListPlans() ([]string, error)
- func NameToFilename(name string) string
- func ParseTaskCounts(data []byte) (done, total int)
- func ParseTitle(data []byte) string
- func PlansDir() (string, error)
- func ResolveCurrentPlan(name string) (string, error)
- func ResolvePlanPath(name string) (string, error)
- func SetCurrent(name string) error
- func SlugToTitle(slug string) string
- type PlanStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtomicWriteFile ¶ added in v0.2.0
AtomicWriteFile writes data to path using a temp file + rename.
func CurrentFile ¶
CurrentFile returns the path to the .current file that tracks the active plan.
func GenerateTemplate ¶ added in v0.2.0
GenerateTemplate creates a new plan Markdown file with the given name.
func GetCurrent ¶
GetCurrent reads the current plan name from plans/.current. Returns empty string if no current plan is set.
func NameToFilename ¶
NameToFilename converts a plan name to a filename slug.
func ParseTaskCounts ¶ added in v0.4.0
ParseTaskCounts finds the ## Tasks section and counts top-level checkboxes. Only lines starting with "- [ ]" or "- [x]" (no leading whitespace) are counted. Indented checkboxes (sub-tasks) are ignored.
func ParseTitle ¶ added in v0.2.0
ParseTitle extracts the first # heading from the data.
func ResolveCurrentPlan ¶
ResolveCurrentPlan figures out which plan to use: 1. If a name is given, use that 2. If plans/.current exists, use that 3. If only one plan exists, use that Returns the plan name or error.
func ResolvePlanPath ¶
ResolvePlanPath returns the full path to a named plan file.
func SetCurrent ¶
SetCurrent writes the current plan name to plans/.current.
func SlugToTitle ¶ added in v0.2.0
SlugToTitle converts a filename slug to a title. "deploy-pipeline" → "Deploy Pipeline"
Types ¶
type PlanStatus ¶ added in v0.2.0
PlanStatus holds parsed status information for a plan file.
func ParsePlanStatus ¶ added in v0.2.0
func ParsePlanStatus(path string) (*PlanStatus, error)
ParsePlanStatus reads a plan file and returns its status.