monolith

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package monolith wraps the monolith CLI (https://github.com/Y2Z/monolith). It accepts a rendered HTML DOM on stdin, inlines every asset as base64 data: URIs, and returns a single self-contained HTML document.

Index

Constants

This section is empty.

Variables

View Source
var ErrMissing = errors.Errorf("monolith binary not found on PATH")

ErrMissing is returned when the monolith binary cannot be found on PATH. Callers (e.g. capturebatch) translate this into a `dependency-missing` per-capture error per RFC 0001.

Functions

func Process

func Process(ctx context.Context, dom io.Reader, baseURL string) (io.ReadCloser, error)

Process pipes dom through `monolith -b <baseURL> -o - -q -M -` and returns the resulting self-contained HTML as a ReadCloser. Output is fully buffered: monolith's asset inlining requires it to read the whole document anyway, so streaming here would buy nothing.

The `-M` (no-metadata) flag is set so the output is deterministic for a given DOM + asset snapshot; without it monolith appends a timestamp/source comment that would defeat content-addressed storage.

Types

This section is empty.

Source Files

  • monolith.go

Jump to

Keyboard shortcuts

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