ast

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ast defines AST nodes that represents Obsidian's markdown elements.

Index

Constants

This section is empty.

Variables

View Source
var KindBlockID = gast.NewNodeKind("BlockID") // Const.

KindBlockID is a NodeKind of the BlockID node.

View Source
var KindPlugTasksCancelled = gast.NewNodeKind("PlugTasksCancelled") // Const.

KindPlugTasksCancelled is a NodeKind of the PlugTasksCancelled node.

View Source
var KindPlugTasksCreated = gast.NewNodeKind("PlugTasksCreated") // Const.

KindPlugTasksCreated is a NodeKind of the PlugTasksCreated node.

View Source
var KindPlugTasksDependsOn = gast.NewNodeKind("PlugTasksDependsOn") // Const.

KindPlugTasksDependsOn is a NodeKind of the PlugTasksDependsOn node.

View Source
var KindPlugTasksDone = gast.NewNodeKind("PlugTasksDone") // Const.

KindPlugTasksDone is a NodeKind of the PlugTasksDone node.

View Source
var KindPlugTasksDue = gast.NewNodeKind("PlugTasksDue") // Const.

KindPlugTasksDue is a NodeKind of the PlugTasksDue node.

View Source
var KindPlugTasksID = gast.NewNodeKind("PlugTasksID") // Const.

KindPlugTasksID is a NodeKind of the PlugTasksID node.

View Source
var KindPlugTasksOnCompletion = gast.NewNodeKind("PlugTasksOnCompletion") // Const.

KindPlugTasksOnCompletion is a NodeKind of the PlugTasksOnCompletion node.

View Source
var KindPlugTasksPrio = gast.NewNodeKind("PlugTasksPrio") // Const.

KindPlugTasksPrio is a NodeKind of the PlugTasksPrio node.

View Source
var KindPlugTasksRecurring = gast.NewNodeKind("PlugTasksRecurring") // Const.

KindPlugTasksRecurring is a NodeKind of the PlugTasksRecurring node.

View Source
var KindPlugTasksScheduled = gast.NewNodeKind("PlugTasksScheduled") // Const.

KindPlugTasksScheduled is a NodeKind of the PlugTasksScheduled node.

View Source
var KindPlugTasksStart = gast.NewNodeKind("PlugTasksStart") // Const.

KindPlugTasksStart is a NodeKind of the PlugTasksStart node.

View Source
var KindPlugTasksStatus = gast.NewNodeKind("PlugTasksStatus") // Const.

KindPlugTasksStatus is a NodeKind of the PlugTasksStatus node.

Functions

This section is empty.

Types

type BlockID

type BlockID struct {
	gast.BaseInline
	ID []byte
	// Invalid means this block id can't be used as a reference target.
	// This is how Obsidian works, so we are just following it behaviour.
	Invalid bool
}

A BlockID struct represents an Obsidian block id. https://help.obsidian.md/Linking+notes+and+files/Internal+links#Link+to+a+block+in+a+note

func NewBlockID

func NewBlockID(id []byte) *BlockID

NewBlockID returns a new valid BlockID node.

func NewInvalidBlockID

func NewInvalidBlockID(id []byte) *BlockID

NewInvalidBlockID returns a new invalid BlockID node.

func (*BlockID) Dump

func (n *BlockID) Dump(source []byte, level int)

Dump implements Node.Dump.

func (*BlockID) Kind

func (*BlockID) Kind() gast.NodeKind

Kind implements Node.Kind.

type PlugTasksCancelled

type PlugTasksCancelled struct {
	gast.BaseInline
	Date time.Time
}

A PlugTasksCancelled represents an Obsidian plugin Tasks's task cancelled date.

func NewPlugTasksCancelled

func NewPlugTasksCancelled(date time.Time) *PlugTasksCancelled

NewPlugTasksCancelled returns a new PlugTasksCancelled node.

func (*PlugTasksCancelled) Dump

func (n *PlugTasksCancelled) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksCancelled) IsValid

func (n *PlugTasksCancelled) IsValid() bool

IsValid reports whether date is valid.

func (*PlugTasksCancelled) Kind

Kind implements ast.Node.

type PlugTasksCreated

type PlugTasksCreated struct {
	gast.BaseInline
	Date time.Time
}

A PlugTasksCreated represents an Obsidian plugin Tasks's task created date.

func NewPlugTasksCreated

func NewPlugTasksCreated(date time.Time) *PlugTasksCreated

NewPlugTasksCreated returns a new PlugTasksCreated node.

func (*PlugTasksCreated) Dump

func (n *PlugTasksCreated) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksCreated) IsValid

func (n *PlugTasksCreated) IsValid() bool

IsValid reports whether date is valid.

func (*PlugTasksCreated) Kind

func (*PlugTasksCreated) Kind() gast.NodeKind

Kind implements ast.Node.

type PlugTasksDependsOn

type PlugTasksDependsOn struct {
	gast.BaseInline
	IDs []string
}

A PlugTasksDependsOn represents an Obsidian plugin Tasks's task dependencies.

func NewPlugTasksDependsOn

func NewPlugTasksDependsOn(ids []string) *PlugTasksDependsOn

NewPlugTasksDependsOn returns a new PlugTasksDependsOn node.

func (*PlugTasksDependsOn) Dump

func (n *PlugTasksDependsOn) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksDependsOn) Kind

Kind implements ast.Node.

type PlugTasksDone

type PlugTasksDone struct {
	gast.BaseInline
	Date time.Time
}

A PlugTasksDone represents an Obsidian plugin Tasks's task done date.

func NewPlugTasksDone

func NewPlugTasksDone(date time.Time) *PlugTasksDone

NewPlugTasksDone returns a new PlugTasksDone node.

func (*PlugTasksDone) Dump

func (n *PlugTasksDone) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksDone) IsValid

func (n *PlugTasksDone) IsValid() bool

IsValid reports whether date is valid.

func (*PlugTasksDone) Kind

func (*PlugTasksDone) Kind() gast.NodeKind

Kind implements ast.Node.

type PlugTasksDue

type PlugTasksDue struct {
	gast.BaseInline
	Date time.Time
}

A PlugTasksDue represents an Obsidian plugin Tasks's task due date.

func NewPlugTasksDue

func NewPlugTasksDue(date time.Time) *PlugTasksDue

NewPlugTasksDue returns a new PlugTasksDue node.

func (*PlugTasksDue) Dump

func (n *PlugTasksDue) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksDue) IsValid

func (n *PlugTasksDue) IsValid() bool

IsValid reports whether date is valid.

func (*PlugTasksDue) Kind

func (*PlugTasksDue) Kind() gast.NodeKind

Kind implements ast.Node.

type PlugTasksID

type PlugTasksID struct {
	gast.BaseInline
	ID string
}

A PlugTasksID represents an Obsidian plugin Tasks's task ID.

func NewPlugTasksID

func NewPlugTasksID(id string) *PlugTasksID

NewPlugTasksID returns a new PlugTasksID node.

func (*PlugTasksID) Dump

func (n *PlugTasksID) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksID) Kind

func (*PlugTasksID) Kind() gast.NodeKind

Kind implements ast.Node.

type PlugTasksOnCompletion

type PlugTasksOnCompletion struct {
	gast.BaseInline
	Action PlugTasksOnCompletionAction
}

A PlugTasksOnCompletion represents an Obsidian plugin Tasks's task action on completion.

func NewPlugTasksOnCompletion

func NewPlugTasksOnCompletion(action PlugTasksOnCompletionAction) *PlugTasksOnCompletion

NewPlugTasksOnCompletion returns a new PlugTasksOnCompletion node.

func (*PlugTasksOnCompletion) Dump

func (n *PlugTasksOnCompletion) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksOnCompletion) IsValid

func (n *PlugTasksOnCompletion) IsValid() bool

IsValid reports whether action is valid.

func (*PlugTasksOnCompletion) Kind

Kind implements ast.Node.

type PlugTasksOnCompletionAction

type PlugTasksOnCompletionAction int

PlugTasksOnCompletionAction is an Obsidian plugin Tasks's action on completion. See https://publish.obsidian.md/tasks/Getting+Started/On+Completion.

const (
	PlugTasksOnCompletionKeep PlugTasksOnCompletionAction = iota + 1
	PlugTasksOnCompletionDelete
)

Obsidian plugin Tasks's action on completion.

func (PlugTasksOnCompletionAction) String

String implements fmt.Stringer.

type PlugTasksPrio

type PlugTasksPrio struct {
	gast.BaseInline
	Prio PlugTasksPriority
}

A PlugTasksPrio represents an Obsidian plugin Tasks's task priority.

func NewPlugTasksPrio

func NewPlugTasksPrio(prio PlugTasksPriority) *PlugTasksPrio

NewPlugTasksPrio returns a new PlugTasksPrio node.

func (*PlugTasksPrio) Dump

func (n *PlugTasksPrio) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksPrio) Kind

func (*PlugTasksPrio) Kind() gast.NodeKind

Kind implements ast.Node.

type PlugTasksPriority

type PlugTasksPriority int

PlugTasksPriority is an Obsidian plugin Tasks's priority.

const (
	PlugTasksPrioLowest PlugTasksPriority = iota - 2
	PlugTasksPrioLow
	PlugTasksPrioDefault
	PlugTasksPrioMedium
	PlugTasksPrioHigh
	PlugTasksPrioHighest
)

Obsidian plugin Tasks's priorities.

func (PlugTasksPriority) String

func (t PlugTasksPriority) String() string

String implements fmt.Stringer.

type PlugTasksRecurring

type PlugTasksRecurring struct {
	gast.BaseInline
	Rule string
}

A PlugTasksRecurring represents an Obsidian plugin Tasks's recurring task.

Rule is not validated and may be invalid.

func NewPlugTasksRecurring

func NewPlugTasksRecurring(rule string) *PlugTasksRecurring

NewPlugTasksRecurring returns a new PlugTasksRecurring node.

func (*PlugTasksRecurring) Dump

func (n *PlugTasksRecurring) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksRecurring) Kind

Kind implements ast.Node.

type PlugTasksScheduled

type PlugTasksScheduled struct {
	gast.BaseInline
	Date time.Time
}

A PlugTasksScheduled represents an Obsidian plugin Tasks's task scheduled date.

func NewPlugTasksScheduled

func NewPlugTasksScheduled(date time.Time) *PlugTasksScheduled

NewPlugTasksScheduled returns a new PlugTasksScheduled node.

func (*PlugTasksScheduled) Dump

func (n *PlugTasksScheduled) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksScheduled) IsValid

func (n *PlugTasksScheduled) IsValid() bool

IsValid reports whether date is valid.

func (*PlugTasksScheduled) Kind

Kind implements ast.Node.

type PlugTasksStart

type PlugTasksStart struct {
	gast.BaseInline
	Date time.Time
}

A PlugTasksStart represents an Obsidian plugin Tasks's task start date.

func NewPlugTasksStart

func NewPlugTasksStart(date time.Time) *PlugTasksStart

NewPlugTasksStart returns a new PlugTasksStart node.

func (*PlugTasksStart) Dump

func (n *PlugTasksStart) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksStart) IsValid

func (n *PlugTasksStart) IsValid() bool

IsValid reports whether date is valid.

func (*PlugTasksStart) Kind

func (*PlugTasksStart) Kind() gast.NodeKind

Kind implements ast.Node.

type PlugTasksStatus

type PlugTasksStatus struct {
	gast.BaseInline
	Symbol     rune
	StatusType PlugTasksStatusType
}

A PlugTasksStatus represents a checkbox of an Obsidian plugin Tasks's task.

func NewPlugTasksStatus

func NewPlugTasksStatus(symbol rune, statusType PlugTasksStatusType) *PlugTasksStatus

NewPlugTasksStatus returns a new PlugTasksStatus node.

func (*PlugTasksStatus) Dump

func (n *PlugTasksStatus) Dump(source []byte, level int)

Dump implements ast.Node.

func (*PlugTasksStatus) IsChecked

func (n *PlugTasksStatus) IsChecked() bool

IsChecked reports whether Symbol != ' '.

func (*PlugTasksStatus) Kind

func (*PlugTasksStatus) Kind() gast.NodeKind

Kind implements ast.Node.

type PlugTasksStatusType

type PlugTasksStatusType int

PlugTasksStatusType represents Obsidian plugin Tasks's status type.

const (
	PlugTasksStatusTypeTODO PlugTasksStatusType = iota + 1
	PlugTasksStatusTypeInProgress
	PlugTasksStatusTypeDone
	PlugTasksStatusTypeCancelled
	PlugTasksStatusTypeNonTask
)

Obsidian plugin Tasks's status types.

func (PlugTasksStatusType) IsDone

func (t PlugTasksStatusType) IsDone() bool

IsDone reports whether the task is considered "done" (has status Done, Cancelled or NonTask).

func (PlugTasksStatusType) String

func (t PlugTasksStatusType) String() string

String implements fmt.Stringer.

Jump to

Keyboard shortcuts

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