ast

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Type       BlockType
	URL        string
	Value      string
	Children   []*Block
	Attributes map[string]string
}

Block is an element

func Parse

func Parse(src string) (*Block, error)

Parse src markdown to block

type BlockType

type BlockType int

BlockType is a type of block

const (
	// TypeRoot is root
	TypeRoot BlockType = iota + 1
	// TypeP is paragraph
	TypeP
	// TypeH1 is header level 1
	TypeH1
	// TypeH2 is header level 2
	TypeH2
	// TypeUL is unordered list
	TypeUL
	// TypeLI is list item
	TypeLI
	// TypePreCode is pre code
	TypePreCode
	// TypeCode is inline code
	TypeCode
	// TypeText is text
	TypeText
	// TypeAnchor is anchor
	TypeAnchor
	// TypeImage is image
	TypeImage
)

Jump to

Keyboard shortcuts

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