Documentation
¶
Index ¶
- func Attributes(keys, values []string) (s []string)
- func EscapeHTMLString(s string) string
- func IntSliceToString(is []int) string
- func Is2119(word []byte) bool
- func IsAbstract(word []byte) bool
- type Flags
- type Renderer
- func (r *Renderer) EscapeHTMLCallouts(w io.Writer, d []byte)
- func (r *Renderer) RenderFooter(w io.Writer, _ ast.Node)
- func (r *Renderer) RenderHeader(w io.Writer, ast ast.Node)
- func (r *Renderer) RenderNode(w io.Writer, node ast.Node, entering bool) ast.WalkStatus
- func (r *Renderer) TitleAuthor(w io.Writer, a mast.Author)
- func (r *Renderer) TitleDate(w io.Writer, d time.Time)
- func (r *Renderer) TitleKeyword(w io.Writer, keyword []string)
- type RendererOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Attributes ¶ added in v1.9.94
Attributes returns the key values in a stringslice where key="value".
func EscapeHTMLString ¶ added in v1.9.94
EscapeHTMLString escapes the string s.
func IntSliceToString ¶ added in v1.9.94
IntSliceToString converts and int slice to a string.
func IsAbstract ¶ added in v1.9.94
IsAbstract returns if word is equal to abstract.
Types ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer implements Renderer interface for IETF XMLv3 output. See RFC 7991.
func NewRenderer ¶
func NewRenderer(opts RendererOptions) *Renderer
New creates and configures an Renderer object, which satisfies the Renderer interface.
func (*Renderer) EscapeHTMLCallouts ¶
EscapeHTMLCallouts writes html-escaped d to w. It escapes &, <, > and " characters, *but* expands callouts <<N>> with the callout HTML, i.e. by calling r.callout() with a newly created ast.Callout node.
func (*Renderer) RenderFooter ¶
RenderFooter writes HTML document footer.
func (*Renderer) RenderHeader ¶
RenderHeader writes HTML document preamble and TOC if requested.
func (*Renderer) RenderNode ¶
func (*Renderer) TitleAuthor ¶ added in v1.9.94
TitleAuthor outputs the author.
type RendererOptions ¶
type RendererOptions struct { // Callouts are supported and detected by setting this option to the callout prefix. Callout string Flags Flags // Flags allow customizing this renderer's behavior // if set, called at the start of RenderNode(). Allows replacing // rendering of some nodes RenderNodeHook html.RenderNodeFunc // Comments is a list of comments the renderer should detect when // parsing code blocks and detecting callouts. Comments [][]byte }