Documentation
¶
Overview ¶
Package markup turns the Markdown of nodes and proofs into HTML (spec 06.2).
It adds four things to CommonMark and GFM:
- [[slug]] and [[slug|text]] link to a node;
- $...$ is inline math and a ```math block is display math, which KaTeX renders in the browser;
- a ```pseudo block is pseudocode with stable line ids (spec 06.4);
- other fenced blocks are highlighted with Chroma at build time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Highlight ¶
Highlight returns highlighted HTML for code in a language. It uses CSS classes, so that the light and the dark themes can share the markup.
func HighlightCSS ¶
func HighlightCSS() string
HighlightCSS returns the CSS of the light and the dark code themes.
Types ¶
type Options ¶
type Options struct {
Resolve Resolver
// Math renders formulas at build time. When it is nil, a formula is left as TeX between \( \) or \[ \], for a renderer in the browser.
Math MathFunc
}
Options are the inputs of RenderWith.
type Result ¶
type Result struct {
HTML string
TOC []Heading
Missing []string // slugs of [[links]] that do not resolve
LineIDs []string // the line ids of the pseudocode blocks, in order
Sections []string // the texts of the level 2 headings, in order
MathErrors []string // the formulas that do not render (rule W07)
}
Result is the output of Render.
Click to show internal directories.
Click to hide internal directories.