html

package
v0.97.12 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package html converts markdown content to styled HTML suitable for headless-Chrome PDF printing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupTheme

func LookupTheme(name string) string

LookupTheme returns the theme CSS for the given name, falling back to "report" if the name is unknown or empty. Returns an empty string if "report" is also somehow unregistered (should not happen in practice).

func RegisterTheme

func RegisterTheme(t Theme)

RegisterTheme adds a theme to the registry. Safe to call from init functions. A later call with the same name overwrites the earlier registration.

func RenderHTML

func RenderHTML(ctx context.Context, markdown string, opts render.Options) (string, error)

RenderHTML converts markdown to a complete HTML document ready for headless-Chrome PDF printing.

func RenderHTMLWith

func RenderHTMLWith(ctx context.Context, markdown string, opts ...render.Option) (string, error)

RenderHTMLWith is a variadic-option convenience that wraps RenderHTML. New code should prefer this form.

Types

type Theme

type Theme struct {
	Name string
	CSS  string
}

Theme is a named CSS bundle appended to the rendered HTML document.

Directories

Path Synopsis
Package directives implements the ::: directive-block framework for go-kit's HTML/PDF renderer.
Package directives implements the ::: directive-block framework for go-kit's HTML/PDF renderer.
all
Package all imports every built-in directive subpackage so its init() self-registers with the directives registry.
Package all imports every built-in directive subpackage so its init() self-registers with the directives registry.
callout
Package callout implements the :::callout{type=...
Package callout implements the :::callout{type=...
grid
Package grid implements the :::grid{cols=N} directive.
Package grid implements the :::grid{cols=N} directive.
math
Package math implements the :::math directive, which renders a raw LaTeX source block inside a .vaelor-math container.
Package math implements the :::math directive, which renders a raw LaTeX source block inside a .vaelor-math container.
stats
Package stats implements the :::stats{...} directive.
Package stats implements the :::stats{...} directive.
timeline
Package timeline implements the :::timeline directive, which renders a vertical list of date/event pairs.
Package timeline implements the :::timeline directive, which renders a vertical list of date/event pairs.

Jump to

Keyboard shortcuts

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