markdown

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 58 Imported by: 0

Documentation

Index

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

func NewRendererWithConfig(blockedHrefSchemes []string) *Renderer

NewRendererWithConfig creates a markdown renderer with the provided blocked href schemes. Deprecated: use NewRendererFromConfig for full configuration.

func (*Renderer) Fingerprint

func (r *Renderer) Fingerprint() string

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

func (r *Renderer) SetLinkContext(page *engine.Page)

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
	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.
kbd

Jump to

Keyboard shortcuts

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