Skip to content

backlog

Go
import "github.com/andreoliwa/logseq-doctor/internal/backlog"

Index

func AddSibling

Go
func AddSibling(page logseq.Page, newBlock, before *content.Block, after ...*content.Block)

func FormatCount

Go
func FormatCount(count int, singular, plural string) string

FormatCount returns a string with the count and the singular or plural form of a word.

func addTasksToCategories

Go
func addTasksToCategories(jsonTasks []internal.TaskJSON, tasks *internal.CategorizedTasks, currentTime func() time.Time)

addTasksToCategories adds tasks to the appropriate categories in CategorizedTasks.

func blockRefsFromPages

Go
func blockRefsFromPages(page logseq.Page) *set.Set[string]

func defaultQuery

Go
func defaultQuery(pageTitle string) string

func nextChildHasPin

Go
func nextChildHasPin(node content.Node) bool

func printQuickCaptureURL

Go
func printQuickCaptureURL(graph *logseq.Graph)

func queryTasksFromPages

Go
func queryTasksFromPages(graph *logseq.Graph, api internal.LogseqAPI, pageTitles []string, currentTime func() time.Time) (*internal.CategorizedTasks, error)

queryTasksFromPages queries Logseq API for tasks from specified pages. It uses concurrent processing for multiple pages and sequential processing for a single page.

func queryTasksFromPagesConcurrent

Go
func queryTasksFromPagesConcurrent(api internal.LogseqAPI, pageTitles []string, tasks *internal.CategorizedTasks, finder internal.LogseqFinder, currentTime func() time.Time) (*internal.CategorizedTasks, error)

queryTasksFromPagesConcurrent processes pages concurrently using goroutines.

func queryTasksFromPagesSequential

Go
func queryTasksFromPagesSequential(api internal.LogseqAPI, pageTitles []string, tasks *internal.CategorizedTasks, finder internal.LogseqFinder, currentTime func() time.Time) (*internal.CategorizedTasks, error)

queryTasksFromPagesSequential processes pages sequentially (original implementation).

func queryTasksFromSinglePage

Go
func queryTasksFromSinglePage(api internal.LogseqAPI, pageTitle string, finder internal.LogseqFinder) ([]internal.TaskJSON, error)

queryTasksFromSinglePage queries tasks from a single page and returns the JSON tasks.

func removeEmptyDividers

Go
func removeEmptyDividers(save bool, dividers ...*content.Block) bool

removeEmptyDividers removes empty dividers (no blocks under it) and returns true if any were removed.

type Backlog

Go
type Backlog interface {
    Graph() *logseq.Graph
    ProcessAll(partialNames []string) error
    ProcessOne(pageTitle string, funcQueryRefs func() (*internal.CategorizedTasks, error)) (*Result, error)
}

func NewBacklog

Go
func NewBacklog(graph *logseq.Graph, api internal.LogseqAPI, reader ConfigReader, currentTime func() time.Time) Backlog

type Config

Go
type Config struct {
    FocusPage string
    Backlogs  []SingleBacklogConfig
}

type ConfigReader

Go
type ConfigReader interface {
    ReadConfig() (*Config, error)
}

func NewPageConfigReader

Go
func NewPageConfigReader(graph *logseq.Graph, configPage string) ConfigReader

NewPageConfigReader creates a new ConfigReader that reads the backlog configuration from a Logseq page.

type Result

Go
type Result struct {
    FocusRefsFromPage *set.Set[string]
    ShowQuickCapture  bool
}

func insertAndRemoveRefs

Go
func insertAndRemoveRefs(graph *logseq.Graph, pageTitle string, newBlockRefs, obsoleteBlockRefs, overdueBlockRefs, futureScheduledBlockRefs *set.Set[string]) (*Result, error)

type SingleBacklogConfig

Go
type SingleBacklogConfig struct {
    BacklogPage string
    Icon        string
    InputPages  []string
}

type backlogImpl

Go
type backlogImpl struct {
    graph        *logseq.Graph
    api          internal.LogseqAPI
    configReader ConfigReader
    currentTime  func() time.Time
}

func (*backlogImpl) Graph

Go
func (b *backlogImpl) Graph() *logseq.Graph

func (*backlogImpl) ProcessAll

Go
func (b *backlogImpl) ProcessAll(partialNames []string) error

func (*backlogImpl) ProcessOne

Go
func (b *backlogImpl) ProcessOne(pageTitle string, funcQueryRefs func() (*internal.CategorizedTasks, error)) (*Result, error)

type pageConfigReader

Go
type pageConfigReader struct {
    graph      *logseq.Graph
    configPage string
}

func (*pageConfigReader) ReadConfig

Go
func (p *pageConfigReader) ReadConfig() (*Config, error)

ReadConfig reads the backlog configuration from a Logseq page.

Generated by gomarkdoc