Documentation
¶
Index ¶
- func BuildKazariEngine(ctx context.Context, cfg *config.CodeblocksSettings, projectDir string) (*kazari.Engine, error)
- func ImageLookupForPage(page *engine.Page, processor *asset.ImageProcessor) imagerender.ImageLookupFunc
- type Renderer
- func (r *Renderer) Fingerprint() string
- func (r *Renderer) LinkRenderer() *linkrender.Renderer
- func (r *Renderer) Render(markdown string) (engine.RenderResult, error)
- func (r *Renderer) ResetFlags()
- func (r *Renderer) SetImageLookup(lookup imagerender.ImageLookupFunc)
- func (r *Renderer) SetLinkContext(page *engine.Page)
- type RendererConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildKazariEngine ¶
func BuildKazariEngine(ctx context.Context, cfg *config.CodeblocksSettings, projectDir string) (*kazari.Engine, error)
BuildKazariEngine creates a Kazari code block engine. The highlighter backend is selected by cfg.Engine: "chroma" for fast Go-native highlighting (ideal for dev/live-reload), "nuri" (default) for accurate TextMate-based highlighting matching VS Code output.
func ImageLookupForPage ¶
func ImageLookupForPage(page *engine.Page, processor *asset.ImageProcessor) imagerender.ImageLookupFunc
ImageLookupForPage creates a lookup function for a specific page's resources.
Types ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer handles markdown to HTML conversion with heading extraction. Implements engine.MarkdownRenderer.
func NewRenderer ¶
func NewRenderer() *Renderer
NewRenderer creates a markdown renderer with all extensions and default security.
func NewRendererFromConfig ¶
func NewRendererFromConfig(cfg RendererConfig) *Renderer
NewRendererFromConfig creates a markdown renderer from a full configuration.
func NewRendererWithConfig ¶
NewRendererWithConfig creates a markdown renderer with the provided blocked href schemes. Deprecated: use NewRendererFromConfig for full configuration.
func (*Renderer) Fingerprint ¶
Fingerprint returns a content-addressed digest of the renderer's identity: registered extension types, config values, and Kazari CSS. The builder includes this in the page-cache key so the cache auto-invalidates when the rendering pipeline changes.
func (*Renderer) LinkRenderer ¶
func (r *Renderer) LinkRenderer() *linkrender.Renderer
LinkRenderer returns the internal link renderer for external configuration (setting PageIndex, URLResolver, Policy).
func (*Renderer) Render ¶
func (r *Renderer) Render(markdown string) (engine.RenderResult, error)
Render converts markdown to HTML, extracts headings, and returns both. Implements engine.MarkdownRenderer.
func (*Renderer) ResetFlags ¶
func (r *Renderer) ResetFlags()
ResetFlags zeroes content feature flags before each page render.
func (*Renderer) SetImageLookup ¶
func (r *Renderer) SetImageLookup(lookup imagerender.ImageLookupFunc)
SetImageLookup sets the lookup function for bundle-relative image processing. Swaps the lookup on the existing image renderer without rebuilding the Goldmark instance.
func (*Renderer) SetLinkContext ¶
SetLinkContext sets the current page for internal link resolution. Must be called before Render() for each page.
type RendererConfig ¶
type RendererConfig struct {
BlockedHrefSchemes []string
HeadingLinks bool
HeadingMinLevel int
HeadingMaxLevel int
// HardWraps renders a single newline inside a paragraph as <br>. Off by
// default, matching CommonMark, so prose wrapped in the source reflows.
HardWraps bool
KazariEngine *kazari.Engine
}
RendererConfig controls markdown renderer behavior.
Directories
¶
| Path | Synopsis |
|---|---|
|
extensions
|
|
|
blockutil
Package blockutil provides shared helpers for container-style block directive parsers.
|
Package blockutil provides shared helpers for container-style block directive parsers. |
|
codediff
Package codediff is a stub extension for organizational completeness.
|
Package codediff is a stub extension for organizational completeness. |