parser

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package parser extends default Goldmark Markdown parser with additional functionality, necessary for building slide presentations.

Index

Constants

This section is empty.

Variables

View Source
var KindNotesBreak = ast.NewNodeKind("NotesBreak")

TODO: deprecate in favor of the package `notesbreak`

Functions

func Glue

func Glue(files ...string) ([]byte, error)

Glue builds a single Markdown document out of a set of files. Metadata is taken from the first file only.

func HasOnlyOneChildOfKind

func HasOnlyOneChildOfKind(n ast.Node, k ast.NodeKind) bool

TODO: depcrecate in favor of mdextension/figure/HasOnlyOneChildOfKind

func IsQuestion

func IsQuestion(node ast.Node, reader text.Reader) bool

func New

func New(withOptions ...Option) (_ parser.Parser, err error)

New returns a new Parser that is configured by default values.

func NewNotesBreakParser

func NewNotesBreakParser() parser.BlockParser

NewNotesBreakParser returns a new BlockParser that parses only thematic breaks composed of asterisks. It is based on parser.NewThematicBreakParser, so it should be placed higher in parser priority to work

func NewReviewQuestionExtractor

func NewReviewQuestionExtractor(extractor QuestionExtractor) parser.BlockParser

func NewReviewQuestionParser

func NewReviewQuestionParser() parser.BlockParser

func QuestionListFromContext

func QuestionListFromContext(ctx parser.Context) []ast.Node

Types

type NotesBreak

type NotesBreak struct {
	*ast.ThematicBreak
}

func (*NotesBreak) Kind

func (n *NotesBreak) Kind() ast.NodeKind

type Option

type Option func(*options) error

func WithListItemParser

func WithListItemParser(p parser.BlockParser) Option

func WithQuestionExtractor

func WithQuestionExtractor(extractor QuestionExtractor) Option

type QuestionExtractor

type QuestionExtractor func(pc parser.Context, question ast.Node)

Jump to

Keyboard shortcuts

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