API¶
The canonical Go API reference for Quill is pkg.go.dev/github.com/avmnu-sng/quill-template-engine, generated from the exported doc comments and runnable examples. This page is a thin index into it; pkg.go.dev is authoritative for signatures, and this guide site is the narrative layer.
Where to look¶
- The facade (
quill):Environment,New,NewFromMap, theRender/RenderTo/RenderValuesfamily (each taking acontext.Contextfirst),LoadTemplate/CompileStringandRenderPreparedfor the parse-once/render-many path, the opaqueTemplate, and theOptionvalues (WithAutoescapeHTML,WithStrictVariables,WithCoverage,WithExtensions,WithExtension,WithSandboxPolicy,WithSandboxActive,WithTypes,WithTabWidth,WithCompiled,WithLogger). - The value model (
runtime): the opaqueValuewith itsKind()andAsBool/AsInt/AsFloat/AsStr/AsArray/AsObjectaccessors, the constructors (Str,Int,Float,Bool,Arr,Null,Safe), the ordered*Array, theObjectinterface, andFromGo. - Loaders (
loader):Loader,NewFilesystemLoader,NewArrayLoader,NewChainLoader,NewPrefixLoader,NewFSLoader,NewFuncLoader. - Extensions (
ext):Filter,Function,Test,Set,Bundle,BaseExtension, and the typed helpersNewFilter,NewFunction,NewTest,NewFilter1. - Coverage (
cover):Collector,Report, the writers, andMergeReports. - The sandbox (
sandbox): the opaquePolicy, itsNewPolicybuilder and allow-options (AllowTags,AllowFilters,AllowFunctions,AllowMethods,AllowProperties,Strict,WithTypeGraph), andNewTypeGraph. - The type checker (
check):Registry,Signature,Type. - The compiled-render contract (
compiled): theManifest/FingerprintcontractWithCompiledinstalls, built withNewManifest/NewFingerprint. The compile-to-Go backend itself is internal; generate a unit with thequill compilecommand (see the CLI). - Errors (
errors): the structured error family, including*errors.Securityfor sandbox violations.
Examples¶
Runnable ExampleXxx functions in the package populate the Examples tab on
pkg.go.dev and double as tests, so the snippets there compile and pass on every
build. The guide pages here cross-link into the same API for the mechanism behind
each feature:
- Getting Started: the facade and the render options.
- Extensions & Loaders: the
extandloaderpackages in depth. - Coverage: the
coverAPI and the go-test integration pattern. - Architecture: how the packages are layered.
Stability¶
From v1.0.0, Quill follows semantic versioning: no exported symbol in the root
package or the pkg/ packages changes incompatibly within the v1 series. Error
message strings are not part of that contract. Classify a failure by its
exported Kind, with errors.As/errors.Is, or against a sentinel such as
loader.ErrNotFound, never by matching message text. The engine internals (the
lexer, parser, interpreter, and compile-to-Go backend) live under internal/ and
are not importable; the quill command's flags, exit codes, and generated-source
shape are the compile backend's stable surface. Changes are noted in the
Changelog; pin a major version in your go.mod and review the
changelog before upgrading.