Documentation
¶
Overview ¶
Package render holds scribe's element producers.
Modules are pluggable content producers (badges, shields, text, include, component, build-contents, k8s-inventory, props) that render to inline markdown for a single stencil. Composition — joining elements into rows/regions — is NOT here: a scribe files region is rendered by scribe.renderRegion (items sugar) or the stencil engine (a freeform body:). This package only defines the producer interface and its concrete implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgeModule ¶
type BadgeModule struct {
Alt string // image alt text
ImgURL string // resolved image URL
Link string // resolved click target (empty = no link wrapper)
}
BadgeModule renders a markdown badge image, optionally wrapped in a link.
func (BadgeModule) Render ¶
func (b BadgeModule) Render() string
Render produces the inline markdown for this badge.
type BuildContentsModule ¶
type BuildContentsModule struct {
Manifest *manifest.Manifest
Section string
Renderer string
Columns []string
Include []string // name globs; empty = the whole section
Wrap string // "details" wraps in <details>/<summary>
Summary string // required when Wrap is set
}
BuildContentsModule renders a manifest section as markdown. Supports table, list, kv, badges, and versions renderers. Optional Wrap/Summary fields control container wrapping.
func (BuildContentsModule) Render ¶
func (b BuildContentsModule) Render() string
Render produces the markdown content for this manifest section. The Module interface does not permit error returns, so invalid state (e.g., unknown Wrap value) is treated as an invariant violation: config validation must reject it before construction. If it reaches runtime anyway, rendering refuses to proceed and returns empty output.
type ComponentModule ¶
type ComponentModule struct {
Docs string // pre-rendered markdown from component.GenerateDocs
}
ComponentModule renders pre-generated component documentation markdown. The spec file is parsed and docs generated by the caller; this module just carries the rendered output into the scribe composition pipeline.
func (ComponentModule) Render ¶
func (c ComponentModule) Render() string
Render returns the component documentation as-is.
type IncludeModule ¶
type IncludeModule struct {
Content string // raw file content (read by caller)
}
IncludeModule renders verbatim file content included via kind: include. The file is read by the caller; this module carries the raw content into the scribe composition pipeline without transformation.
func (IncludeModule) Render ¶
func (i IncludeModule) Render() string
Render returns the included content as-is.
type K8sInventoryModule ¶
type K8sInventoryModule struct {
CatalogPath string // optional path to catalog
RepoRoot string // for source link verification and Flux graph resolution
ClusterConfig config.ClusterConfig // passed to k8s.NewClient for auth + to Discover for exposure rules
}
K8sInventoryModule renders a cluster app inventory via live Kubernetes discovery. Orchestration only — all k8s auth, discovery, and rendering logic lives in src/k8s/.
func (*K8sInventoryModule) Render ¶
func (m *K8sInventoryModule) Render() string
Render discovers workloads from the live cluster, groups by app identity, classifies, and produces stable markdown. Returns empty string on error (Module interface contract — errors are logged via diag).
type Module ¶
type Module interface {
Render() string
}
Module produces inline markdown content for a single element.
type PropsModule ¶
type PropsModule struct {
Resolved props.ResolvedProp
Variant props.Variant
}
PropsModule renders a resolved prop through the shared FormatMarkdown path. The prop is resolved before this module is created.
func (PropsModule) Render ¶
func (p PropsModule) Render() string
Render produces the inline markdown for this prop via the shared render path.
type ShieldModule ¶
type ShieldModule struct {
Path string // shields.io path (e.g., "docker/pulls/myorg/myrepo")
Label string // override label (used as alt text; empty = last path segment)
Link string // click target URL (empty = no link wrapper)
}
ShieldModule renders a shields.io badge from a path shorthand. The path is appended to https://img.shields.io/ to form the image URL.
func (ShieldModule) Render ¶
func (s ShieldModule) Render() string
Render produces the inline markdown for this shields.io badge.
type TextModule ¶
type TextModule struct {
Text string // markdown content (templates already resolved by caller)
}
TextModule renders literal markdown text. Template variables ({version}, {env:VAR}, etc.) are resolved before rendering.
func (TextModule) Render ¶
func (t TextModule) Render() string
Render returns the text content as-is.