Documentation ¶
Index ¶
- func EscapeString(s string) string
- func NewTableOfContents(ctx renderer.Context, doc types.Document) (types.TableOfContents, error)
- func Render(ctx renderer.Context, doc types.Document, output io.Writer) (types.Metadata, error)
- type Attribution
- type ContextualPipeline
- type RenderLinesConfig
- type RenderLinesOption
- type TableOfContents
- type TableOfContentsSection
- type TableOfContentsSectionGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeString ¶ added in v0.3.0
EscapeString uses the stdlib html5.Escape func except but bypasses a few replacements which
func NewTableOfContents ¶ added in v0.3.0
NewTableOfContents initializes a TableOfContents from the sections of the given document
Types ¶
type Attribution ¶ added in v0.3.0
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 ¶
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 ¶
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
Source Files ¶
- attribution.go
- blank_line.go
- contextual_pipeline.go
- cross_reference.go
- delimited_block.go
- document_details.go
- element_id.go
- elements.go
- footnote_reference.go
- html5.go
- html_escape.go
- image.go
- index_term.go
- inline_elements.go
- labeled_list.go
- link.go
- literal_blocks.go
- ordered_list.go
- paragraph.go
- passthrough.go
- quoted_text.go
- section.go
- string.go
- table.go
- table_of_contents.go
- template_utils.go
- unordered_list.go
- user_macro.go