Documentation ¶
Overview ¶
Package pikchr adds support for pikchr diagrams to the Goldmark Markdown parser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Kind = ast.NewNodeKind("PikchrBlock")
Kind is the kind of a pikchr block.
Functions ¶
This section is empty.
Types ¶
type Block ¶
Block is a pikchr block.
```pikchr arrow right 200% "Markdown" "Source" box rad 10px "Markdown" "Formatter" "(markdown.c)" fit arrow right 200% "HTML+SVG" "Output" arrow <-> down 70% from last box.s box same "Pikchr" "Formatter" "(pikchr.c)" fi t ```
Its raw contents are the plain text of the pikchr diagram.
type Extender ¶
type Extender struct {
DarkMode bool
}
Extender adds support for pikchr diagrams to a Goldmark Markdown parser.
Use it by installing it to the goldmark.Markdown object upon creation.
goldmark.New( // ... goldmark.WithExtensions( // ... &pikchr.Exender{}, ), )
type Renderer ¶
type Renderer struct {
DarkMode bool
}
Renderer renders pikchr diagrams as HTML, to be rendered into images client side.
func (*Renderer) RegisterFuncs ¶
func (r *Renderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)
RegisterFuncs registers the renderer for pikchr blocks with the provided Goldmark Registerer.
type Transformer ¶
type Transformer struct{}
Transformer transforms a Goldmark Markdown AST with support for pikchr diagrams by replacing pikchr code blocks with Block nodes.