task

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package task provides task item parsing, matching, and domain logic.

Package task provides task item parsing and matching.

This package handles the domain logic for task items, independent of their Markdown representation.

Index

Constants

View Source
const (
	MatchFull    = iota // Full match
	MatchIndent         // Leading whitespace
	MatchState          // "x" or " " or ""
	MatchContent        // Task text
)

Match indices for accessing capture groups.

Usage:

match := task.ItemPattern.FindStringSubmatch(line)
if match != nil {
    indent := match[task.MatchIndent]
    state := match[task.MatchState]
    content := match[task.MatchContent]
}

Variables

This section is empty.

Functions

func Completed

func Completed(match []string) bool

Completed reports whether a match represents a completed task.

Parameters:

  • match: Result from ItemPattern.FindStringSubmatch

Returns:

  • bool: True if the checkbox is checked ([x])

func Content

func Content(match []string) string

Content returns the task text from a match.

Parameters:

  • match: Result from ItemPattern.FindStringSubmatch

Returns:

  • string: Task content (empty if the match is invalid)

func Indent

func Indent(match []string) string

Indent returns the leading whitespace from a match.

Parameters:

  • match: Result from ItemPattern.FindStringSubmatch

Returns:

  • string: Indent string (may be empty for top-level tasks)

func Pending added in v0.3.0

func Pending(match []string) bool

Pending reports whether a match represents a pending task.

Parameters:

  • match: Result from ItemPattern.FindStringSubmatch

Returns:

  • bool: True if the checkbox is unchecked ([ ])

func SubTask added in v0.3.0

func SubTask(match []string) bool

SubTask reports whether a match represents a subtask (indented).

Parameters:

  • match: Result from ItemPattern.FindStringSubmatch

Returns:

  • bool: True if indent is 2+ spaces

Types

This section is empty.

Jump to

Keyboard shortcuts

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