Documentation
¶
Overview ¶
Package project carries the project vocabulary every kb surface shares.
Every task carries exactly one project, spelled as the scoped label "project::<name>". Projects slice one board rather than splitting it into several: the label is ordinary task data, so nothing about the schema or Markdown codec changes.
The rules live here rather than in one surface because more than one surface writes tasks: the CLI resolves an active project and stamps it, and the TUI switches, filters and edits by it. A second implementation of "exactly one project:: label" is a second chance to get it wrong.
Index ¶
Constants ¶
const ( // Scope is the label scope projects live under. Scope = "project" // LabelPrefix is what a project label starts with. LabelPrefix = Scope + "::" // Inbox is where tasks that never named a project end up. Inbox = "inbox" )
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶
Ensure returns tags carrying exactly one project:: label: whatever project labels were in tags are dropped and name's label is appended. It is the invariant every write surface funnels through, so a task can never reach the store with zero or two projects.
func Lead ¶
Lead reorders a tag list so the project label comes first, leaving every other tag in its original order. The project is the card's loudest label, and the label row is rendered in survival order, so leading with it is what keeps it on the card when the row runs out of width.
func Of ¶
Of returns the single project a tag list carries, or "" when it carries none or more than one — both of which a write path then replaces.
func SplitTags ¶
SplitTags separates the project names a tag list carries from the tags that are not project labels, both in their original order.
func ValidateName ¶
ValidateName checks a project name by the rule already applied to label values: non-empty, no whitespace, no leading '#'. It additionally rejects "::" so a name can never smuggle a second scope into the label.
Types ¶
This section is empty.