parser

package
v0.0.0-...-1d84f56 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseD2

func ParseD2(input []byte, options *ParseOptions) ([]byte, error)

ParseD2 takes in the bytes, such as from a file or a stream, and processes it through the D2 library for output

Types

type LeafData

type LeafData struct {
	Title    string
	FileName string
	Tags     []string
	SiteTags map[string][]LeafData // needed for the nav
	Links    []LeafData            // needed for the nav
	Diagrams []string              // needed for the index
	Content  template.HTML         // used for converting to an html template
	Summary  string                // used for search displays, found in the meta
}

LeafData holds the data for a leaf that will then be used to build the site

func ParseMD

func ParseMD(content []byte, prefix string) (*LeafData, error)

ParseMD takes a series of bytes, such as from a file, and parses the MD into HTML, with meta data set in the LeafData return

type ParseOptions

type ParseOptions struct {
	D2Theme  int64
	D2Layout string // one of elk or dagre, defaults ot dagre; tala is not supported in the library
}

ParseOptions are options relevants specifically to parsing, usually filled in automatically from the CommandOptions if run from the binary

Jump to

Keyboard shortcuts

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