Documentation
¶
Overview ¶
Package mkdocs provides MkDocs integration for visionspec.
Package mkdocs generates MkDocs-compatible markdown files for visionspec projects.
Index ¶
- func DetectGraphizeOutput(projectPath string) string
- func EmbedGraphizeInIndex(w io.Writer, projectPath string, embedOpts GraphEmbedOptions) error
- func ExtractGraphFromSpec(specContent string, projectName string) ([]GraphNode, []GraphEdge)
- func GenerateGraphEmbed(w io.Writer, nodes []GraphNode, edges []GraphEdge, opts GraphEmbedOptions) error
- func GenerateProjectIndex(w io.Writer, report *status.Report, opts ProjectIndexOptions) error
- func GenerateProjectIndexWithGraph(projectPath string, report *status.Report) error
- func GenerateSpecsLanding(w io.Writer, projects []ProjectSummary, opts SpecsLandingOptions) error
- func RenderAllEvals(projectPath string, opts RenderEvalOptions) (int, error)
- func RenderEvalFile(evalPath string, outputPath string, opts RenderEvalOptions) error
- func RenderEvalToMarkdown(w io.Writer, result *eval.Result, opts RenderEvalOptions) error
- func WriteGraphPage(projectPath string, specContent string, opts GraphEmbedOptions) error
- func WriteNavigation(specsDir string, outputPath string) error
- func WriteProjectIndex(projectPath string, report *status.Report, opts ProjectIndexOptions) error
- func WriteSpecsLanding(specsDir string, opts SpecsLandingOptions) error
- type GraphEdge
- type GraphEmbedOptions
- type GraphNode
- type NavItem
- type ProjectIndexOptions
- type ProjectSummary
- type RenderEvalOptions
- type SpecsLandingOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectGraphizeOutput ¶ added in v0.10.0
DetectGraphizeOutput looks for graphize visualization in a project. Returns the path to the HTML visualization if found, empty string otherwise.
func EmbedGraphizeInIndex ¶ added in v0.10.0
func EmbedGraphizeInIndex(w io.Writer, projectPath string, embedOpts GraphEmbedOptions) error
EmbedGraphizeInIndex adds graphize visualization to an existing project index.
func ExtractGraphFromSpec ¶ added in v0.10.0
ExtractGraphFromSpec extracts graph nodes and edges from spec content. This is a simplified extraction - a full implementation would use more sophisticated NLP/parsing.
func GenerateGraphEmbed ¶ added in v0.10.0
func GenerateGraphEmbed(w io.Writer, nodes []GraphNode, edges []GraphEdge, opts GraphEmbedOptions) error
GenerateGraphEmbed generates markdown for embedding a graph visualization.
func GenerateProjectIndex ¶
GenerateProjectIndex generates index.md for a single project.
func GenerateProjectIndexWithGraph ¶ added in v0.10.0
GenerateProjectIndexWithGraph generates index.md with automatic graph detection.
func GenerateSpecsLanding ¶
func GenerateSpecsLanding(w io.Writer, projects []ProjectSummary, opts SpecsLandingOptions) error
GenerateSpecsLanding generates the main docs/specs/index.md file.
func RenderAllEvals ¶ added in v0.8.0
func RenderAllEvals(projectPath string, opts RenderEvalOptions) (int, error)
RenderAllEvals renders all eval JSON files in a project to markdown.
func RenderEvalFile ¶ added in v0.8.0
func RenderEvalFile(evalPath string, outputPath string, opts RenderEvalOptions) error
RenderEvalFile reads an eval JSON file and renders it to markdown.
func RenderEvalToMarkdown ¶ added in v0.8.0
RenderEvalToMarkdown converts an evaluation result to markdown.
func WriteGraphPage ¶ added in v0.10.0
func WriteGraphPage(projectPath string, specContent string, opts GraphEmbedOptions) error
WriteGraphPage generates a dedicated graph visualization page.
func WriteNavigation ¶ added in v0.8.0
WriteNavigation writes the nav section to a YAML file fragment.
func WriteProjectIndex ¶
func WriteProjectIndex(projectPath string, report *status.Report, opts ProjectIndexOptions) error
WriteProjectIndex writes index.md for a project.
func WriteSpecsLanding ¶
func WriteSpecsLanding(specsDir string, opts SpecsLandingOptions) error
WriteSpecsLanding writes the main specs/index.md file.
Types ¶
type GraphEdge ¶ added in v0.10.0
type GraphEdge struct {
From string `json:"from"`
To string `json:"to"`
Relation string `json:"relation"` // implements, depends_on, traces_to, validates
}
GraphEdge represents an edge in the spec graph.
type GraphEmbedOptions ¶ added in v0.10.0
type GraphEmbedOptions struct {
// Format is the graph output format: "mermaid", "iframe", "svg"
Format string
// Width is the iframe/svg width (e.g., "100%", "800px")
Width string
// Height is the iframe/svg height (e.g., "600px")
Height string
// GraphURL is the URL to the graph HTML file for iframe embedding
GraphURL string
// GraphPath is the local path to the graph file
GraphPath string
// Title is the optional title for the graph section
Title string
// Description is the optional description
Description string
}
GraphEmbedOptions configures graph embedding in documentation.
func DefaultGraphEmbedOptions ¶ added in v0.10.0
func DefaultGraphEmbedOptions() GraphEmbedOptions
DefaultGraphEmbedOptions returns default graph embed options.
type GraphNode ¶ added in v0.10.0
type GraphNode struct {
ID string `json:"id"`
Label string `json:"label"`
Type string `json:"type"` // requirement, feature, task, acceptance
Status string `json:"status,omitempty"`
Category string `json:"category,omitempty"`
}
GraphNode represents a node in the spec graph.
type NavItem ¶ added in v0.8.0
type NavItem struct {
}
NavItem represents a single item in the MkDocs navigation.
func GenerateNavigation ¶ added in v0.8.0
GenerateNavigation generates the nav section for mkdocs.yml from a specs directory.
func (NavItem) MarshalYAML ¶ added in v0.8.0
MarshalYAML implements custom YAML marshaling for NavItem.
type ProjectIndexOptions ¶
type ProjectIndexOptions struct {
// IncludeGraphLink adds a link to the graph visualization if available.
IncludeGraphLink bool
// GraphPath is the relative path to the graph HTML file.
GraphPath string
}
ProjectIndexOptions configures project index generation.
type ProjectSummary ¶
type ProjectSummary struct {
Name string
Path string
Status string // ready, in_progress, not_ready
StatusEmoji string
Progress int // Percentage
LastUpdated time.Time
SpecCount int
EvalCount int
ApprovalCount int
}
ProjectSummary contains summary information for the specs landing page.
func ScanProjects ¶
func ScanProjects(specsDir string) ([]ProjectSummary, error)
ScanProjects scans a specs directory and returns summaries for all projects.
type RenderEvalOptions ¶ added in v0.8.0
type RenderEvalOptions struct {
// IncludeEvidence includes evidence snippets in findings.
IncludeEvidence bool
// IncludeJudgeMetadata includes information about the LLM judge.
IncludeJudgeMetadata bool
}
RenderEvalOptions configures evaluation rendering.
type SpecsLandingOptions ¶
type SpecsLandingOptions struct {
// IncludeConstitution adds a link to CONSTITUTION.md if it exists.
IncludeConstitution bool
// IncludeRoadmap adds a link to ROADMAP.md if it exists.
IncludeRoadmap bool
// ConstitutionPath is the relative path to CONSTITUTION.md.
ConstitutionPath string
// RoadmapPath is the relative path to ROADMAP.md.
RoadmapPath string
}
SpecsLandingOptions configures the specs landing page generation.