parser

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFulfillment

func CheckFulfillment(content []byte, check string) bool
func HasNoteLinks(content []byte) bool

func ParseFrontMatter

func ParseFrontMatter(
	content []byte,
) (title string, tags []string)

Types

type Parser

type Parser struct {
	TaskHandler *TaskHandler
	TagHandler  *TagHandler
	DirPath     string
}

func NewParser

func NewParser(dirPath string) *Parser

func (*Parser) PrintSortedTagCounts

func (p *Parser) PrintSortedTagCounts(order string)

func (*Parser) PrintTagCounts

func (p *Parser) PrintTagCounts()

func (*Parser) PrintTasks

func (p *Parser) PrintTasks(sortType, sortOrder string)

func (*Parser) ShowTagTable

func (p *Parser) ShowTagTable()

func (*Parser) ShowTasksTable

func (p *Parser) ShowTasksTable()

func (*Parser) Walk

func (p *Parser) Walk() error

Walk traverses the directory set in the Parser and processes Markdown files.

type TagHandler

type TagHandler struct {
	TagCounts map[string]int
	TagList   []string
}

TagHandler handles the logic related to tags.

func NewTagHandler

func NewTagHandler() *TagHandler

NewTagHandler creates a new instance of TagHandler.

func (*TagHandler) ParseTag

func (th *TagHandler) ParseTag(tag string)

ParseTag parses and counts a single tag.

func (*TagHandler) PrintSortedTagCounts

func (th *TagHandler) PrintSortedTagCounts(order string)

func (*TagHandler) PrintTagCounts

func (th *TagHandler) PrintTagCounts()

PrintTagCounts prints the sorted list of tags and their counts.

func (*TagHandler) ShowTagTable

func (th *TagHandler) ShowTagTable()

func (*TagHandler) SortTagCounts

func (th *TagHandler) SortTagCounts(order string)

SortTagCounts sorts the tags by their counts.

type Task

type Task struct {
	Status  string
	Content string
	ID      int
}

type TaskHandler

type TaskHandler struct {
	Tasks  map[int]Task
	NextID int
}

func NewTaskHandler

func NewTaskHandler() *TaskHandler

func (*TaskHandler) AddTask

func (th *TaskHandler) AddTask(status, content string)

func (*TaskHandler) ParseTask

func (th *TaskHandler) ParseTask(content string)

func (*TaskHandler) PrintTasks

func (th *TaskHandler) PrintTasks(sortType, sortOrder string)

PrintTasks is a public method that prints tasks sorted by the specified type and order.

func (*TaskHandler) ShowTasksTable

func (th *TaskHandler) ShowTasksTable()

func (*TaskHandler) SortTasksByID

func (th *TaskHandler) SortTasksByID(order string) []Task

func (*TaskHandler) SortTasksByStatus

func (th *TaskHandler) SortTasksByStatus(order string) []Task

sortTasksByStatus is a private method that sorts tasks by status.

Jump to

Keyboard shortcuts

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