Documentation
¶
Index ¶
- func RenderHtml(doc Document) string
- type Datum
- type Document
- type Scanner
- func (s *Scanner) ClampPosition(pos int) int
- func (s *Scanner) InBounds(n int) bool
- func (s *Scanner) MatchBrackets(open string, close string, raw bool, canEscape bool) string
- func (s *Scanner) MatchUntil(needles []string, canEscape bool) string
- func (s *Scanner) MatchUntilNewline(canEscape bool) string
- func (s *Scanner) MatchUntilWhitespace(canEscape bool) string
- func (s *Scanner) Nudge(n int)
- func (s *Scanner) Peek(n int) string
- func (s *Scanner) SkipWhitespace() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderHtml ¶
RenderHtml - Render parsed document data as HTML.
Types ¶
type Datum ¶
type Datum struct { // special Name string Argument string Children []Datum // Raw Raw bool RawText string }
Datum - A parsed formatting node, similar to a tag in HTML
func NewRawDatum ¶
NewRawDatum - Generate a new Datum containing no elements, but Raw text.
func NewSpecialDatum ¶
NewSpecialDatum - Generate a new Datum which can contain elements.
func (*Datum) HasArgument ¶
HasArgument - Returns true if this Datum has a non-empty Argument, false otherwise.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
The Scanner scans strings.
func NewScanner ¶
func (*Scanner) ClampPosition ¶
func (*Scanner) MatchBrackets ¶
MatchBrackets consumes all characters from open to its matching instance of close. This function takes into account escapes and nesting (for things like parenthesis.)
func (*Scanner) MatchUntil ¶
MatchUntil matches all characters until any element of an array is found or the end of the file.
func (*Scanner) MatchUntilNewline ¶
MatchUntilNewline matches all characters until a newline (CRLF, CR, or LF) or EOF.
func (*Scanner) MatchUntilWhitespace ¶
MatchUntilWhitespace matches all characters until whitespace (CRLF, CR, LF, tab or space) or EOF.
func (*Scanner) Peek ¶
Peek Get the next or previous n characters from position depending on if n is positive or negative.
func (*Scanner) SkipWhitespace ¶
SkipWhitespace skips whitespace and returns the number of skipped newlines.