Documentation
¶
Overview ¶
Package export renders the module graph and the symbol graph into formats other tools read: GraphML, Cypher, JSON, DOT, Mermaid, an Obsidian vault and a token-budgeted markdown wiki. Output is deterministic.
Index ¶
Constants ¶
const ( ScopeModules = "modules" ScopeSymbols = "symbols" )
Scope picks which graph a single-file format renders.
Variables ¶
var Formats = []string{"graphml", "cypher", "json", "dot", "mermaid", "obsidian", "markdown-wiki"}
Formats lists every supported format name.
Functions ¶
func WriteStdout ¶
WriteStdout prints files, with a marker line between files when there are several.
Types ¶
type Edge ¶
type Edge struct {
From string `json:"from"`
To string `json:"to"`
Kind string `json:"kind"`
Conf string `json:"confidence,omitempty"`
Score float64 `json:"score,omitempty"`
}
Edge is the shared edge shape for all graph formats.
type Model ¶
type Model struct {
Scope string `json:"scope"`
Nodes []Node `json:"nodes"`
Edges []Edge `json:"edges"`
}
Model is a flattened graph.
type Node ¶
type Node struct {
ID string `json:"id"`
Label string `json:"label"`
Kind string `json:"kind"`
File string `json:"source_file,omitempty"`
Line int `json:"line,omitempty"`
Group string `json:"group,omitempty"`
}
Node is the shared node shape for all graph formats.
type Options ¶
type Options struct {
Scope string // ScopeModules or ScopeSymbols; empty picks symbols when a graph is present
PageTokens int // markdown-wiki per page budget in tokens; 0 reads STACKLIT_EXPORT_PAGE_TOKENS
MaxNodes int // dot and mermaid node cap; 0 reads STACKLIT_EXPORT_MAX_NODES
}
Options tunes rendering.