Documentation
¶
Overview ¶
Package appendix adds numbered footnotes to D2 SVGs and animation frames.
Index ¶
- Constants
- func Append(diagram *d2target.Diagram, renderOpts *d2svg.RenderOpts, ...) []byte
- func AppendRendered(diagram *d2target.Diagram, renderOpts *d2svg.RenderOpts, ...) ([]byte, error)
- func AppendWithError(diagram *d2target.Diagram, renderOpts *d2svg.RenderOpts, ...) ([]byte, error)
- func FindViewboxSlice(svg []byte) []string
Constants ¶
const ( PAD_TOP = 50 PAD_SIDES = 40 SPACER = 20 FONT_SIZE = 16 ICON_RADIUS = 16 )
Variables ¶
This section is empty.
Functions ¶
func Append ¶
func Append(diagram *d2target.Diagram, renderOpts *d2svg.RenderOpts, ruler *textmeasure.Ruler, in []byte) []byte
Append adds footnotes to the SVG, returning nil if rendering fails.
func AppendRendered ¶ added in v0.10.0
func AppendRendered(diagram *d2target.Diagram, renderOpts *d2svg.RenderOpts, ruler *textmeasure.Ruler, in []byte) ([]byte, error)
AppendRendered adds an appendix to output from d2svg.Render. Its scoped stylesheet already selects any faces embedded by the diagram, including for the new footnotes and numbered markers.
func AppendWithError ¶ added in v0.10.0
func AppendWithError(diagram *d2target.Diagram, renderOpts *d2svg.RenderOpts, ruler *textmeasure.Ruler, in []byte) ([]byte, error)
AppendWithError adds footnotes and reports errors such as an appendix exceeding the scaled SVG dimension range.
func FindViewboxSlice ¶
Types ¶
This section is empty.