Documentation
¶
Overview ¶
Package doc extracts documentation from Rugo source files.
It works on raw .rg source before preprocessing, since the compiler's stripComments phase destroys comments. The extraction rule is simple: consecutive # lines immediately before a def/struct declaration (no blank line gap) are attached as the doc comment for that declaration.
Index ¶
- func FormatAllModules() string
- func FormatBridgePackage(pkg *gobridge.Package) string
- func FormatFile(fd *FileDoc) string
- func FormatModule(m *modules.Module) string
- func FormatSymbol(docStr, signature string) string
- func LookupSymbol(fd *FileDoc, name string) (doc string, signature string, found bool)
- type FileDoc
- type FuncDoc
- type StructDoc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatAllModules ¶
func FormatAllModules() string
FormatAllModules lists all available modules and bridge packages.
func FormatBridgePackage ¶
FormatBridgePackage formats a Go bridge package for terminal display.
func FormatFile ¶
FormatFile formats a FileDoc for terminal display.
func FormatModule ¶
FormatModule formats a stdlib module for terminal display.
func FormatSymbol ¶
FormatSymbol formats a single symbol lookup result.
Types ¶
type FileDoc ¶
type FileDoc struct {
Path string
Doc string // file-level doc (first # block before any code)
Funcs []FuncDoc
Structs []StructDoc
}
FileDoc holds all extracted documentation for a single Rugo file.
func ExtractDir ¶
ExtractDir reads all Rugo files in a directory (non-recursive) and returns aggregated documentation. The entry file's doc becomes the top-level doc. Other files contribute their functions and structs.
func ExtractFile ¶
ExtractFile reads a Rugo file and extracts all documentation.