render

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderD2

func RenderD2(w io.Writer, doc *capstack.CapabilityStack, opts D2Options) error

RenderD2 generates a D2 diagram from a CapabilityStack.

func RenderD2String

func RenderD2String(doc *capstack.CapabilityStack, opts D2Options) (string, error)

RenderD2String is a convenience function that returns the D2 diagram as a string.

func RenderHTML

func RenderHTML(w io.Writer, doc *capstack.CapabilityStack, opts HTMLOptions) error

RenderHTML generates static HTML from a CapabilityStack.

func RenderHTMLString

func RenderHTMLString(doc *capstack.CapabilityStack, opts HTMLOptions) (string, error)

RenderHTMLString is a convenience function that returns HTML as a string.

Types

type D2Options

type D2Options struct {
	// Title shown at the top of the diagram.
	Title string

	// Style controls the overall rendering approach.
	Style D2Style

	// ShowDependencies renders dependency arrows between capabilities.
	// Ignored when Style is D2StyleGrid.
	ShowDependencies bool

	// ShowFoundational includes foundational capabilities in a separate section.
	ShowFoundational bool

	// ShowLegend displays the status color legend.
	ShowLegend bool

	// ColorByStatus uses status-based colors instead of category colors.
	ColorByStatus bool

	// Direction sets the layout direction ("down" or "right").
	Direction string

	// GridColumns sets the number of columns per layer row (0 = auto).
	// Only used when Style is D2StyleGrid.
	GridColumns int
}

D2Options configures D2 diagram generation.

func DefaultD2Options

func DefaultD2Options() D2Options

DefaultD2Options returns sensible defaults for D2 rendering.

func GridD2Options

func GridD2Options() D2Options

GridD2Options returns options optimized for executive grid view.

type D2Style

type D2Style string

D2Style defines the rendering style for D2 diagrams.

const (
	// D2StyleDefault renders with dependency arrows and detailed layout.
	D2StyleDefault D2Style = "default"

	// D2StyleGrid renders a clean grid layout suitable for executives.
	// No dependency arrows, capabilities aligned in grid within layers.
	D2StyleGrid D2Style = "grid"
)

type HTMLOptions

type HTMLOptions struct {
	// Title overrides the document title.
	Title string

	// ShowLegend displays the status color legend.
	ShowLegend bool

	// ShowFoundational includes foundational capabilities.
	ShowFoundational bool

	// Standalone generates a complete HTML document (vs. embeddable fragment).
	Standalone bool

	// DarkTheme uses dark color scheme.
	DarkTheme bool
}

HTMLOptions configures static HTML rendering.

func DefaultHTMLOptions

func DefaultHTMLOptions() HTMLOptions

DefaultHTMLOptions returns sensible defaults for HTML rendering.

Jump to

Keyboard shortcuts

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