docrender

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package docrender renders evaluated documents into backend-specific artifacts, consuming only the document IR — never plans, symbols, or ASTs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DocumentFileName

func DocumentFileName(fqn string) string

DocumentFileName derives the deterministic Markdown file name of a rendered document from its fully-qualified name, using the same escaping as anchors so distinct documents never collide.

func Markdown

func Markdown(document *docir.Document) (string, error)

Markdown renders an evaluated document as deterministic CommonMark: the title as a level-1 ATX heading, each section one level deeper (saturating at 6), paragraphs from space-joined text runs, GitHub-flavored pipe tables with projected column headers, bullet or numbered lists, and diagrams as fenced Mermaid blocks (table-kind views as pipe tables). Metacharacters in content are escaped so no value can corrupt the document structure.

Types

type Error

type Error struct {
	Kind    ErrorKind
	Content string
	Actual  string
}

Error is a typed document-rendering failure.

func (*Error) Error

func (e *Error) Error() string

type ErrorKind

type ErrorKind string

ErrorKind classifies a document-rendering failure.

const (
	ErrorNilDocument         ErrorKind = "nil-document"
	ErrorUnknownContent      ErrorKind = "unknown-content"
	ErrorMissingRendering    ErrorKind = "missing-rendering"
	ErrorUnrenderableDiagram ErrorKind = "unrenderable-diagram"
)

Jump to

Keyboard shortcuts

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