html5

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeString added in v0.3.0

func EscapeString(s string) string

EscapeString uses the stdlib html5.Escape func except but bypasses a few replacements which

func NewTableOfContents added in v0.3.0

func NewTableOfContents(ctx renderer.Context, doc types.Document) (types.TableOfContents, error)

NewTableOfContents initializes a TableOfContents from the sections of the given document

func Render

func Render(ctx renderer.Context, doc types.Document, output io.Writer) (types.Metadata, error)

Render renders the given document in HTML and writes the result in the given `writer`

Types

type Attribution added in v0.3.0

type Attribution struct {
	First  string
	Second string
}

Attribution a document block attribution

func NewDelimitedBlockAttribution added in v0.3.0

func NewDelimitedBlockAttribution(b types.DelimitedBlock) Attribution

NewDelimitedBlockAttribution return a new attribution for the given delimited block. Can be empty if no attribution was specified.

func NewParagraphAttribution added in v0.3.0

func NewParagraphAttribution(p types.Paragraph) Attribution

NewParagraphAttribution return a new attribution for the given paragraph. Can be empty if no attribution was specified.

type ContextualPipeline

type ContextualPipeline struct {
	Context renderer.Context
	// The actual pipeline
	Data interface{}
}

ContextualPipeline as structure that carries the renderer context along with the pipeline data to process in a template or in a nested template

type RenderLinesConfig added in v0.3.0

type RenderLinesConfig struct {
	// contains filtered or unexported fields
}

RenderLinesConfig the config to use when rendering paragraph lines

type RenderLinesOption added in v0.3.0

type RenderLinesOption func(c *RenderLinesConfig)

RenderLinesOption an option to configure the rendering

func PlainText added in v0.3.0

func PlainText() RenderLinesOption

PlainText sets the render func to PlainText instead of HTML

func WithHardBreaks added in v0.3.0

func WithHardBreaks(hardbreaks bool) RenderLinesOption

WithHardBreaks sets the hard break option

type TableOfContents

type TableOfContents struct {
	Content template.HTML
}

TableOfContents the structure of the table of contents

type TableOfContentsSection

type TableOfContentsSection struct {
	Level    int
	Href     string
	Title    template.HTML
	Elements template.HTML
}

TableOfContentsSection a section in the table of contents

type TableOfContentsSectionGroup

type TableOfContentsSectionGroup struct {
	Level    int
	Elements []TableOfContentsSection
}

TableOfContentsSectionGroup a group of sections in the table of contents

Jump to

Keyboard shortcuts

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