Documentation ¶
Index ¶
Constants ¶
View Source
const ( // BlockPrefix is the prefix for a block opener. BlockPrefix = "- " // BlockContentPrefix is the prefix for a continued block content line. BlockContentPrefix = " " // IndentMarker is the character used to indicate indentation. IndentMarker = "\t" // PropIndicator helps identify properties. PropIndicator = ":: " )
Variables ¶
View Source
var ErrEmptyBlock = errors.New("empty block")
View Source
var ErrInvalidLine = errors.New("invalid line")
View Source
var ErrInvalidLogseqLine = errors.New("invalid Logseq line")
ErrInvalidLogseqLine is returned when a line is not a valid Logseq line.
View Source
var ErrMismatchedDepth = errors.New("mismatched depth")
View Source
var ErrPropNotBoolean = errors.New("property is not a boolean")
View Source
var ErrPropNotFound = errors.New("property not found")
Functions ¶
func LineIsProp ¶
LineIsProp returns true if the line describes a Logseq property.
Types ¶
type Block ¶
type Block struct { // Lines is the content of the block. Lines []*LogseqLine // Props is a map of properties for the block. Props map[string]*Prop // Depth is the indentation level of the block. Depth int }
Block represents a single block in a Logseq page.
func NewBlock ¶
func NewBlock(lines []*LogseqLine) (*Block, error)
NewBlock creates a new block from a slice of lines.
type LogseqLine ¶
type LogseqLine struct { // Raw is the raw text of the line. Raw string // Adjusted is the line with outline structures removed. Adjusted string // Depth is the indentation level of the line. Depth int // IsProp is true if the line indicates a property. IsProp bool }
LogseqLine holds the data for a single line in a Logseq page.
func NewLogseqLine ¶
func NewLogseqLine(line string) (*LogseqLine, error)
NewLogseqLine creates a new LogseqLine.
type PageTally ¶
func NewPageTally ¶
NewPageTally creates a new PageTally struct.
Click to show internal directories.
Click to hide internal directories.