Documentation
¶
Overview ¶
Package reference derives a module's reference pages from the files it embeds, and answers the routing questions `pgedge llms` and the generator ask of them.
The layout is the contract. A package's llms.txt is its index page, and every llms/**/*.txt beneath it is one more page whose scope is the file path with the directory separators and the extension removed: llms/database/mcp.txt under "starfleet byoc" is the page for `pgedge starfleet byoc database mcp`. Nothing declares the set, so no list can fall behind the files.
Index ¶
- Constants
- func Children(docs []module.Document, scope string) []module.Document
- func Find(docs []module.Document, scope string) (module.Document, bool)
- func FromFS(fsys fs.FS, dir, scope string) ([]module.Document, error)
- func LongestPrefix(docs []module.Document, scope string) (module.Document, bool)
- func Scopes(docs []module.Document) []string
- func TopicSummary(body []byte) (string, bool)
Constants ¶
const PageSizeBudget = 25 * 1024
PageSizeBudget bounds one reference page below the module index.
An agent working on one resource reads only that page, so a page has to be small enough for that to be a saving; 25 KB is about 6k tokens. A module index carries the prose every resource shares and is not bound by it.
Variables ¶
This section is empty.
Functions ¶
func Children ¶
Children returns the pages one word below scope, in scope order. They are what a routing table lists and what Tab completion offers.
func FromFS ¶
FromFS returns the pages a package embeds, sorted by scope. dir is the package's path under the repository root and scope its command path under `pgedge`, "" for the root; both are recorded on every page so a caller can go from a served page back to its file.
func LongestPrefix ¶
LongestPrefix returns the page whose scope is the longest prefix of scope, word-wise, so a miss can be reported against the nearest page that does exist.
func Scopes ¶
Scopes returns every page's scope, in order, which is the set of ownership scopes the generator and the conformance gate share.
func TopicSummary ¶
TopicSummary reports whether a page is a topic page, one that documents a task spanning several resources rather than a command, and returns the summary its routing-table row shows. The first-line marker, `<!-- topic: <summary> -->`, is the only thing that tells it apart from a resource page whose command was deleted.
Types ¶
This section is empty.