Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPreamble ¶ added in v0.1.1
func DefaultPreamble() []byte
DefaultPreamble returns a copy of the default preamble provided by goldmark-latex. It does not include \begin{document} text within, as expected by Config.Preamble.
func NewRenderer ¶
func NewRenderer(opts ...Option) renderer.NodeRenderer
NewRenderer returns a new Renderer with given options. Options are applied in order of appearance. Example:
lr := latex.NewRenderer(latex.Config{ Unsafe: true, // Add desired configuration options. }) r := renderer.NewRenderer(renderer.WithNodeRenderers(util.Prioritized(lr, 1000))) md := goldmark.New(goldmark.WithRenderer(r)) md.Convert(markdown, LaTeXoutput)
Types ¶
type Config ¶
type Config struct { // Increase heading levels: if the offset is 1, \section (1) becomes \subsection (2) etc. // Negative offset is also valid. // Resulting levels are clipped between 1 and 6. HeadingLevelOffset int // Removes section numbering. NoHeadingNumbering bool // Replace the default preamble by setting this to a non-nil byte slice. // Should NOT end with \begin{document}, this is added automatically. Preamble []byte // If set renderer will render possibly unsafe elements, such as links and // code block raw content. Unsafe bool // Declares all used unicode characters in the preamble // and replaces them with the result of this function. DeclareUnicode func(rune) (raw string, isReplaced bool) }
Config contains parameters for controlling LaTeX output of a Renderer.
func (Config) SetLatexOption ¶
SetLatexOption implements the Option interface.
type Option ¶
type Option interface {
SetLatexOption(*Config)
}
An Option interface sets options for HTML based renderers.
type Renderer ¶
type Renderer struct {
Config Config
}
Renderer is a LaTeX renderer implementation for extending goldmark to generate .tex files.
func (*Renderer) RegisterFuncs ¶
func (r *Renderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)
RegisterFuncs implements goldmark's renderer.NodeRenderer interface.
Click to show internal directories.
Click to hide internal directories.