Documentation
¶
Overview ¶
Package referencegen extracts the ordered example overview used by the browser-based function reference.
Index ¶
Constants ¶
const SourcePath = "docs/reference/functions.sql"
SourcePath is the repository-relative, hand-maintained SQL reference.
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
func Encode(w io.Writer, sections []SectionExamples) error
Encode writes the generated overview in the format consumed by the web UI.
func FindRepoRoot ¶
FindRepoRoot returns the nearest parent directory that contains docs/reference/functions.sql. Generator entry points work from any directory.
func RenderHTML ¶ added in v0.66.0
RenderHTML retains explanatory comments and escapes all SQL as text.
func WriteFiles ¶ added in v0.66.0
WriteFiles regenerates both reference views without executing example SQL. FILE/HTTP examples and ambient clocks must not affect generated documentation.
Types ¶
type SectionExamples ¶
SectionExamples contains the SQL example blocks that belong to one top-level section in docs/reference/functions.sql.
func Generate ¶
func Generate(r io.Reader) ([]SectionExamples, error)
Generate extracts SQL example blocks from the canonical SQL reference. A section is only started by a title enclosed by the decorative comment rules used in that file. This deliberately ignores ordinary comments such as "COUNT" or "Example 1", which are descriptions within the current section rather than categories of their own.