Documentation ¶
Index ¶
- func BlockNodes(nodes []types.Node) []types.Node
- func CompactNodes(nodes []types.Node) []types.Node
- func Parse(name string, r io.Reader, opts Options) (*types.Codelab, error)
- func ParseFragment(name string, r io.Reader, opts Options) ([]types.Node, error)
- func Parsers() []string
- func Register(name string, p Parser)
- type MarkdownParser
- type Options
- type Parser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockNodes ¶
nodeBlocks encapsulates all nodes of the same block into a new ListNode with its B field set to true. Nodes which are not blockSquashable remain as is.
func CompactNodes ¶
Although nodes slice is not modified, its elements are.
func Parse ¶
Parse parses source r into a Codelab using a parser registered with the specified name.
func ParseFragment ¶
ParseFragment parses a codelab fragment provided in r, using a parser registered with the specified name.
Types ¶
type MarkdownParser ¶
type MarkdownParser int
const ( Blackfriday MarkdownParser = iota Goldmark MarkdownParser = iota )
type Options ¶
type Options struct { PassMetadata map[string]bool MDParser MarkdownParser }
Container for parsing options.
func NewOptions ¶
func NewOptions(mdp MarkdownParser) *Options
type Parser ¶
type Parser interface { // Parse parses source r into a Codelab for the specified environment env. Parse(r io.Reader, opts Options) (*types.Codelab, error) // ParseFragment is similar to Parse except it doesn't parse codelab metadata. ParseFragment(r io.Reader, opts Options) ([]types.Node, error) }
Parser parses a codelab in specific resource format. Each parser needs to call Register to become a known parser.
Directories ¶
Path | Synopsis |
---|---|
Package md implements a parser for CLaaT. It expects, as input, the output of running a Markdown file through the Devsite Markdown processor.
|
Package md implements a parser for CLaaT. It expects, as input, the output of running a Markdown file through the Devsite Markdown processor. |
Click to show internal directories.
Click to hide internal directories.