xml

package
v1.9.982 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2018 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 added in v1.9.94

func Attributes(keys, values []string) (s []string)

Attributes returns the key values in a stringslice where each is type set as key="value".

func AttributesContains added in v1.9.96

func AttributesContains(key string, attr []string) bool

AttributesContains checks if the attribute list contains key.

func EscapeHTMLCallouts added in v1.9.980

func EscapeHTMLCallouts(w io.Writer, d []byte, comments [][]byte)

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 added in v1.9.94

func EscapeHTMLString(s string) string

EscapeHTMLString escapes the string s.

func IntSliceToString added in v1.9.94

func IntSliceToString(is []int) string

IntSliceToString converts and int slice to a string.

func Is2119

func Is2119(word []byte) bool

Is2119 checks if word is a RFC 2119 word.

func IsAbstract added in v1.9.94

func IsAbstract(word []byte) bool

IsAbstract returns if word is equal to abstract.

Types

type Flags

type Flags int

Flags control optional behavior of XML3 renderer.

const (
	FlagsNone   Flags = 0
	XMLFragment Flags = 1 << iota // Don't generate a complete XML document
	SkipHTML                      // Skip preformatted HTML blocks - skips comments
	SkipImages                    // Skip embedded images

	CommonFlags Flags = FlagsNone
)

HTML renderer configuration options.

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

func (r *Renderer) RenderFooter(w io.Writer, _ ast.Node)

RenderFooter writes HTML document footer.

func (*Renderer) RenderHeader

func (r *Renderer) RenderHeader(w io.Writer, ast ast.Node)

RenderHeader writes HTML document preamble and TOC if requested.

func (*Renderer) RenderNode

func (r *Renderer) RenderNode(w io.Writer, node ast.Node, entering bool) ast.WalkStatus

RenderNode renders a markdown node to XML.

func (*Renderer) TitleAuthor added in v1.9.94

func (r *Renderer) TitleAuthor(w io.Writer, a mast.Author)

TitleAuthor outputs the author.

func (*Renderer) TitleDate added in v1.9.94

func (r *Renderer) TitleDate(w io.Writer, d time.Time)

TitleDate outputs the date from the TOML title block.

func (*Renderer) TitleKeyword added in v1.9.94

func (r *Renderer) TitleKeyword(w io.Writer, keyword []string)

TitleKeyword outputs the keywords from the TOML title block.

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
}

RendererOptions is a collection of supplementary parameters tweaking the behavior of various parts of XML renderer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL