markdown

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package renderer renders the given AST to certain formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(r *Renderer)

func WithSoftWraps

func WithSoftWraps() Option

WithSoftWraps allows you to wrap lines even on soft line breaks.

func WithUnderlineHeadings

func WithUnderlineHeadings() Option

type Renderer

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

Renderer allows to render markdown AST into markdown bytes in consistent format. Render is reusable across Renders, it holds configuration only.

func NewRenderer

func NewRenderer() *Renderer

func (*Renderer) AddMarkdownOptions

func (mr *Renderer) AddMarkdownOptions(opts ...Option)

func (*Renderer) AddOptions

func (mr *Renderer) AddOptions(...renderer.Option)

func (*Renderer) Render

func (mr *Renderer) Render(w io.Writer, source []byte, node ast.Node) error

Render renders the given AST node to the given buffer with the given Renderer. NOTE: This is the entry point used by Goldmark.

Jump to

Keyboard shortcuts

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