Documentation
¶
Overview ¶
Package render produces HTML for parsed diffs. Two modes share the same per-file structure (header + hunks); only line-level layout differs. Per-line syntax highlighting via Chroma; binary and image files get their own placeholders.
The renderer doesn't know about HTTP — callers wrap the output in `template.HTML` for the response. This keeps it usable from the commit page (S18), compare page (S20), and PR files-changed page (S22) without leaking response shape into the rendering surface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Mode Mode
HighlightCap int
PerFileLineCap int // collapse files with > this many changed lines (0 = 1000 default)
PerFileBytesCap int // collapse files larger than this (0 = 500 KiB)
WholeDiffFileCap int // truncate the whole-diff after this many files (0 = 100)
}
Options tunes a render. HighlightCap caps per-file highlight cost; past it the renderer falls back to plain `<pre>`. Zero uses the 200 KiB default from the spec.