Documentation
¶
Overview ¶
Package werich is a Blackfriday Markdown Processor WeApp rich-text Randerer Available at http://github.com/hyacinthus/werich
Copyright © 2018 Muninn <hyacinthus@gmail.com>. Distributed MIT License. See README.md for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Renderer ¶
type Renderer struct {
// If you define this as "pre-", the tag class will seems like "pre-md-xxx",
// don't forget "-". The default is empty, clsss will be "md-xxx".
CSSPrefix string
// Heading level offset, if it is 2, <h2> will change to <h4>
HeadingOffset int
}
Renderer is a type that implements the Renderer interface for rich-text output.
func (*Renderer) RenderFooter ¶
RenderFooter writes rich text nodes latter ]
func (*Renderer) RenderHeader ¶
RenderHeader writes rich text nodes front [
func (*Renderer) RenderNode ¶
RenderNode is a renderer of a single node of a markdown syntax tree. For block nodes it will be called twice: first time with entering=true, second time with entering=false, so that it could know when it's working on an open tag and when on close. It writes the result to w.
The return value is a way to tell the calling walker to adjust its walk pattern: e.g. it can terminate the traversal by returning Terminate. Or it can ask the walker to skip a subtree of this node by returning SkipChildren. The typical behavior is to return GoToNext, which asks for the usual traversal to the next node.