parser

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(ext string, c Factory)

Types

type Factory

type Factory func(*core.Context) MarkupParser

type Heading

type Heading struct {
	Id       string
	Level    int32
	Title    string
	Children []*Heading
}

type MarkupParser

type MarkupParser interface {
	Parse(io.Reader) (*Result, error)
}

type Parser

type Parser interface {
	Parse(string) (*Result, error)
	SupportedExtensions() []string
}

func New

func New(ctx *core.Context) Parser

type Result

type Result struct {
	FrontMatter map[string]any
	Toc         []*Heading
	Summary     string
	Content     string
	RawContent  string
}

func (*Result) SetFrontMatter

func (r *Result) SetFrontMatter(k, v string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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