referencegen

package
v0.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

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

func FindRepoRoot(start string) (string, error)

FindRepoRoot returns the nearest parent directory that contains FUNCTIONS.sql. It lets both generator entry points work from any directory.

Types

type SectionExamples

type SectionExamples struct {
	Section  string   `json:"section"`
	Examples []string `json:"examples"`
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL