board

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package board handles board discovery, scaffolding, and config.

The board is a "north/" directory inside the user's project repo, anchored by "north/config.yml". It is found by walking up from the current directory, the same way git finds ".git". Tasks live in one of three state folders: drafts/, tasks/, archive/.

Index

Constants

View Source
const (
	BoardDirname = "north"
	ConfigName   = "config.yml"
)

Variables

This section is empty.

Functions

func InitBoard

func InitBoard(root string) (string, error)

InitBoard scaffolds a board under root (default cwd): config + state folders. Idempotent — existing files/folders are left untouched. Returns the board dir.

func LocateBoard

func LocateBoard(start string) (string, error)

LocateBoard walks up from start (default cwd) to find the "north/" board dir (the one containing config.yml). Returns NotFound with a hint if none exists.

func NextID

func NextID(board string) (string, error)

NextID returns the next free task id — a bare number, max across all folders + 1 (as a string; ids are never reused).

func Root

func Root(board string) string

Root returns the project repo root that contains the board (north/ parent).

func Slug

func Slug(title string) string

Slug builds a filename-safe slug from a title (Backlog.md-style, dash-separated).

func StateDir

func StateDir(board string, state models.TaskState) string

StateDir returns the absolute folder path for a state within the board.

func TaskFilename

func TaskFilename(taskID, title string) string

TaskFilename is the on-disk filename for a task: "12-add-login.md".

func TaskFiles

func TaskFiles(board string, states ...models.TaskState) ([]string, error)

TaskFiles returns the task Markdown files in the given state folders (all states if none are given), sorted within each folder.

func WriteConfig

func WriteConfig(board string, cfg Config) (string, error)

WriteConfig writes config.yml. Returns the path.

Types

type Config

type Config struct {
	AutoCommit bool `yaml:"auto_commit"`
}

Config holds per-board settings from "north/config.yml".

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the MVP defaults (auto_commit false).

func LoadConfig

func LoadConfig(board string) (Config, error)

LoadConfig reads "north/config.yml" into a Config. A missing file and extra keys are tolerated; malformed YAML is a hard error (a silently ignored typo would silently change behaviour, e.g. turning auto_commit off).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL