Documentation
¶
Overview ¶
Package referencegen extracts the ordered example overview used by the browser-based function reference.
Index ¶
Constants ¶
This section is empty.
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 FUNCTIONS.sql. It lets both generator entry points work from any directory.
Types ¶
type SectionExamples ¶
SectionExamples contains the SQL example blocks that belong to one top-level section in FUNCTIONS.sql.
func Generate ¶
func Generate(r io.Reader) ([]SectionExamples, error)
Generate extracts SQL example blocks from FUNCTIONS.sql. 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.