Documentation ¶
Index ¶
- Constants
- Variables
- func Attributes(keys, values []string) (s []string)
- func AttributesContains(key string, attr []string) bool
- func EscapeHTMLCallouts(w io.Writer, d []byte, comments [][]byte)
- func EscapeHTMLString(s string) string
- func IntSliceToString(is []int) string
- func Is2119(word []byte) bool
- func IsAbstract(word []byte) bool
- func IsComment(data []byte) ([]byte, bool)
- type Flags
- type Renderer
- 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 ¶
const Generator = `<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.nl" -->`
Variables ¶
var ( ToolsRFC = "https://xml2rfc.ietf.org/public/rfc/bibxml" ToolsID = "https://xml2rfc.ietf.org/public/rfc/bibxml-ids" ToolsW3C = "https://xml2rfc.ietf.org/public/rfc/bibxml-w3c" )
var StatusToCategory = map[string]string{
"standard": "std",
"informational": "info",
"experimental": "exp",
"bcp": "bcp",
"fyi": "fyi",
"full-standard": "std",
}
StatusToCategory translate the status to a category.
Functions ¶
func Attributes ¶
Attributes returns the key values in a stringslice where each is type set as key="value".
func AttributesContains ¶
AttributesContains checks if the attribute list contains key.
func EscapeHTMLCallouts ¶
EscapeHTMLCallouts writes html-escaped d to w. It escapes &, <, > and " characters, *but* expands callouts <<N>> with the callout HTML, i.e. by calling rendering it as <N>.
func EscapeHTMLString ¶
EscapeHTMLString escapes the string s.
func IntSliceToString ¶
IntSliceToString converts and int slice to a string.
func IsAbstract ¶
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
NewRenderer creates and configures an Renderer object, which satisfies the Renderer interface.
func (*Renderer) RenderFooter ¶
RenderFooter writes HTML document footer.
func (*Renderer) RenderHeader ¶
RenderHeader writes HTML document preamble and TOC if requested.
func (*Renderer) RenderNode ¶
RenderNode renders a markdown node to XML.
func (*Renderer) TitleAuthor ¶
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 // Generator is a comment that is inserted in the generated XML to show what rendered it. Generator string }
RendererOptions is a collection of supplementary parameters tweaking the behavior of various parts of XML renderer.