Documentation
¶
Index ¶
- Constants
- Variables
- func AddBlockRefToFocusPage(transaction *logseq.Transaction, focusPageTitle, uuid string) error
- func BlockRefExistsUnder(parent *content.Block, uuid logseqapi.TaskUUID) bool
- func FindFirstSectionDivider(page logseq.Page) *content.Block
- func FormatCount(count int, singular, plural string) string
- func MoveBlockRefToTriagedSection(transaction *logseq.Transaction, backlogPage string, uuid logseqapi.TaskUUID, ...) error
- func NormalizeHeaderText(page logseq.Page) bool
- func RemoveBlockRefFromRegularArea(page logseq.Page, uuid logseqapi.TaskUUID)
- type Backlog
- type Config
- type ConfigReader
- type Header
- type Result
- type SingleBacklogConfig
Constants ¶
const ( SectionRanked = 1 // manually ordered, above the ⤵️ Unranked tasks divider SectionUnranked = 2 // under ⤵️ Unranked tasks, 📅 Overdue tasks, ⏰ Scheduled tasks, ✨ New tasks, 🏷️ Triaged tasks SectionOrphan = 3 // not referenced in any backlog page )
Section values for the PocketBase `section` field. Ranked=1, Unranked=2, Orphan=3 so that (backlog_index, section, rank) sorts ranked tasks before unranked tasks before orphans within any backlog.
Variables ¶
var ( HeaderFocus = Header{"🎯", "Focus"} HeaderOverdue = Header{"📅", "Overdue"} HeaderNewTasks = Header{"✨", "New"} HeaderTriaged = Header{"🏷️", "Triaged"} HeaderScheduled = Header{"⏰", "Scheduled"} HeaderUnranked = Header{"⤵️", "Unranked"} )
Backlog section header definitions. Detection uses Header.Matches (case-insensitive label search). Creation uses Header.String() so the canonical emoji+label+tasks is always written.
Functions ¶
func AddBlockRefToFocusPage ¶ added in v0.8.0
func AddBlockRefToFocusPage(transaction *logseq.Transaction, focusPageTitle, uuid string) error
AddBlockRefToFocusPage adds a block ref ((uuid)) to the Focus page.
func BlockRefExistsUnder ¶ added in v0.8.0
BlockRefExistsUnder returns true if a block ref with the given UUID exists anywhere in the descendant tree of parent.
func FindFirstSectionDivider ¶ added in v0.8.0
FindFirstSectionDivider finds the first block whose text matches a known section header.
func FormatCount ¶
FormatCount returns a string with the count and the singular or plural form of a word.
func MoveBlockRefToTriagedSection ¶ added in v0.8.0
func MoveBlockRefToTriagedSection( transaction *logseq.Transaction, backlogPage string, uuid logseqapi.TaskUUID, triagedText, scheduledText string, ) error
MoveBlockRefToTriagedSection moves a block ref to the Triaged section of a backlog page. If the ref exists in the regular area (not under Focus, New tasks, Overdue, or Scheduled), it is removed from there. If it's already in Triaged, no duplicate is added. Creates the Triaged section if it doesn't exist.
func NormalizeHeaderText ¶ added in v0.8.0
NormalizeHeaderText scans all top-level blocks on the page and normalizes any block whose text node contains a known header keyword:
- fixes the text to the canonical "emoji Label tasks" form
- upgrades a plain Paragraph container to a Heading level 1
Returns true if any block was changed.
func RemoveBlockRefFromRegularArea ¶ added in v0.8.0
RemoveBlockRefFromRegularArea removes the block ref with the given UUID from the regular area of the page. The regular area is any top-level block ref that is not itself a section divider. Section dividers (Focus, Overdue, New tasks, Triaged, Scheduled, Unranked) and their children are not part of the regular area. Since we walk only top-level blocks, child refs are never seen.
Types ¶
type Backlog ¶
type Backlog interface {
Graph() *logseq.Graph
ProcessAll(partialNames []string) error
ProcessOne(pageTitle string, funcQueryRefs func() (*logseqapi.CategorizedTasks, error)) (*Result, error)
}
func NewBacklog ¶
type Config ¶
type Config struct {
FocusPage string
Backlogs []SingleBacklogConfig
}
func (*Config) FindBacklogPageTitle ¶ added in v0.8.0
FindBacklogPageTitle looks up the full backlog page path from config by backlog name. Returns empty string if no matching backlog is found.
type ConfigReader ¶
func NewPageConfigReader ¶
func NewPageConfigReader(graph *logseq.Graph, configPage string) ConfigReader
NewPageConfigReader creates a new ConfigReader that reads the backlog configuration from a Logseq page.
type Header ¶ added in v0.8.0
Header represents a backlog section divider. Label is the display word(s) without the "tasks" suffix (e.g. "Focus"). String() always returns "Emoji Label tasks".
func (Header) Matches ¶ added in v0.8.0
Matches reports whether blockText contains the label, case-insensitively.
func (Header) NewHeading ¶ added in v0.8.0
NewHeading returns a level-1 heading node with the canonical header text followed by a [[quick capture]] page link. Use this when creating a new section divider so the user can identify blocks inserted by lqd backlog.