Documentation
¶
Overview ¶
Package parser contains all the code used to tokenize the input and parsing it. It is divided in the tokenizer.go, which tokenize the input from start to paragraphs, and parser.go which contains some usefull utils and hight level parsing.
Index ¶
- func OptionsFromParagraphs(paragraphs []token.ParagraphToken) (sMark.Options, []token.ParagraphToken)
- func ParseReader(fl io.Reader) ([]token.ParagraphToken, error)
- func TitleFromParagraph(paragraph []token.ParagraphToken) string
- func TokenToLine(tokens []token.Token) []token.LineToken
- func TokenToParagraph(lines []token.LineToken) []token.ParagraphToken
- func TokenToStructure(tokens []token.Token) []token.Token
- func Tokenizer(reader io.Reader) ([]token.Token, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OptionsFromParagraphs ¶
func OptionsFromParagraphs(paragraphs []token.ParagraphToken) (sMark.Options, []token.ParagraphToken)
OptionsFromParagraphs analyze the passed slice of paragraphs returning the final options contined in token.HeaderParagraphs. It return the optained options and a new list of paragraphs containing all the paragraphs but HeaderParagraphs
func ParseReader ¶
func ParseReader(fl io.Reader) ([]token.ParagraphToken, error)
ParseReader parse a source file and returns the paragraphs
func TitleFromParagraph ¶
func TitleFromParagraph(paragraph []token.ParagraphToken) string
TitleFromParagraph resolve a possible title from the passed paragraphs
func TokenToLine ¶
TokenToLine divide a slice of tokens in lines
func TokenToParagraph ¶
func TokenToParagraph(lines []token.LineToken) []token.ParagraphToken
TokenToParagraph divide a slice of lines in paragraphs
func TokenToStructure ¶
TokenToStructure checks the slice of tokens for multi-token tokens, like bold/italic text
Types ¶
This section is empty.