FS is the file system used for resolving imports in the D2 text. Nil
disables imports. Callers that accept untrusted input should prefer a
filesystem constrained to the intended import root; lib/localfile provides
rooted and explicit unrestricted host-filesystem policies. FontFamily controls the font family used for all texts that are not the following:
- code
- latex
- pre-measured (web setting)
TODO maybe some will want to configure code font too, but that's much lower priorityInputPathstringLayout*stringLayoutResolverfunc(engine string) (d2graph.LayoutGraph, error) LayoutReuse allows scenarios and steps whose layout inputs are unchanged
to reuse the geometry of their base board. Callers should enable this only
when LayoutResolver and RouterResolver return a stable built-in Dagre or
ELK configuration for the duration of Compile. It is disabled by default
so custom resolvers retain their existing per-board behavior. MaxEdgeExpansion bounds distinct edge-segment and endpoint combinations
considered by edge globs. Zero uses the secure compiler default. Explicit
edges do not consume this budget. MaxEdgeExpansionWork bounds all endpoint-pair examinations performed by
edge globs, including lazy replays. Zero uses the secure compiler default. MaxGlobExpansion bounds work performed by glob matching and
materialization. Zero uses the secure compiler default. Explicit source
fields are not counted as materialization work. MaxVariableExpansion bounds work added by variable substitutions and the
automatic copies they induce. Zero uses the secure compiler default.MeasuredTexts[]*d2target.MText MonoFontFamily controls the font family used for code/mono textsRouterResolverfunc(engine string) (d2graph.RouteEdges, error)Ruler*textmeasure.RulerUTF16Posbool
func Compile(ctx context.Context, input string, compileOpts *CompileOptions, renderOpts *d2svg.RenderOpts) (*d2target.Diagram, *d2graph.Graph, error)
func Parse(ctx context.Context, input string, compileOpts *CompileOptions) (*d2ast.Map, error)
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.