htmlfmt

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package htmlfmt pretty-prints compact HTML for the doc-site source tabs.

templ emits HTML on a single line; this re-indents it. x/net/html tokenizes (handling quotes, raw-text elements, comments, entities); the rest is a width-based indent pass. An element whose whole subtree fits on one line stays inline; a longer one breaks each child onto its own line. Prose (an element with direct text) flows its inline content instead of stacking it, unless it wraps a structural child too wide to inline, which forces a stack. A start tag wider than the target wraps one attribute per line.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(s string) string

Format re-indents compact HTML into the doc-site source-tab layout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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