mkdocs

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package mkdocs provides MkDocs integration for visionspec.

Package mkdocs generates MkDocs-compatible markdown files for visionspec projects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateProjectIndex

func GenerateProjectIndex(w io.Writer, report *status.Report, opts ProjectIndexOptions) error

GenerateProjectIndex generates index.md for a single project.

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

func RenderEvalToMarkdown(w io.Writer, result *eval.Result, opts RenderEvalOptions) error

RenderEvalToMarkdown converts an evaluation result to markdown.

func WriteNavigation added in v0.8.0

func WriteNavigation(specsDir string, outputPath string) error

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 NavItem struct {
	Title    string    `yaml:"title,omitempty"`
	Path     string    `yaml:"-"`
	Children []NavItem `yaml:"-"`
}

NavItem represents a single item in the MkDocs navigation.

func GenerateNavigation added in v0.8.0

func GenerateNavigation(specsDir string) ([]NavItem, error)

GenerateNavigation generates the nav section for mkdocs.yml from a specs directory.

func (n NavItem) MarshalYAML() (interface{}, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL