Documentation
¶
Overview ¶
Package docref is the canonical string form of a documentation reference (ADR-0164 §SD5): the one identifier a search hit carries so any surface — a results row, a query result cell, a launch request — can navigate to the section it names. Rows written to the facts plane outlive whichever process wrote them, which is why the format is frozen here, in one leaf package with no dependencies, rather than derived ad hoc per producer.
Three schemes, one per corpus:
help://<app-id>::<doc>#<slug> a help-book section (help.RefT) adr://<num>#<slug> an ADR section, num zero-padded to 4 chdoc://<name> a system.documentation entry
`::` separates the app id from the doc path because app ids are Go import paths and contain `/` — a plain slash would make `help://a/b/c#s` unparseable. The `#<slug>` fragment is optional everywhere it appears; absent means the document (or entry) itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PackageProps = packageprops.Props{ WASMWASI: packageprops.WASMCompiles, WASMJS: packageprops.WASMCompiles, WASMFreestanding: packageprops.WASMCompiles, }
PackageProps records this package's curated properties (ADR-0080). Seeded by `boxer code analysis golang wasmsurvey props generate`; curate by hand. The same group's `props verify` reconciles it.
Functions ¶
func FormatAdr ¶
FormatAdr renders an ADR section ref. The number is zero-padded to four digits, matching the corpus filenames.
func FormatChdoc ¶
FormatChdoc renders a system.documentation entry ref.
Types ¶
type Ref ¶
type Ref struct {
Scheme SchemeE
AppId string // SchemeHelp
Doc string // SchemeHelp
Num int // SchemeAdr
Name string // SchemeChdoc
Section string // SchemeHelp, SchemeAdr: heading slug, "" = whole doc
}
Ref is a parsed documentation reference. Only the fields of the active Scheme are populated.
func Parse ¶
Parse reads a canonical ref string. Strict: an unknown scheme, a help ref without the `::` separator, or a non-numeric ADR number is an error, not a guess — refs live in persisted rows, and a lenient parser here would let a malformed producer go unnoticed until its rows stop navigating.
type SchemeE ¶
type SchemeE uint8
SchemeE tags which corpus a parsed ref addresses.
const ( // SchemeInvalid is the zero value; Parse never returns it without // an error. SchemeInvalid SchemeE = iota // SchemeHelp — a help-book section: AppId, Doc, Section. SchemeHelp // SchemeAdr — an ADR section: Num, Section. SchemeAdr // SchemeChdoc — a system.documentation entry: Name. SchemeChdoc )