Help us shape the future of Go! Take the 2026 Go Developer Survey

html

package
v0.102.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package html renders a doctree.Element into an HTML fragment.

This is a semantic-HTML-fragment writer, not a port of docutils' html5_polyglot writer (docutils' writers/_html_base.py + html5_polyglot/__init__.py total ~2300 lines and embed a full default CSS stylesheet, meta/doctype/head boilerplate, and CSS-class conventions Sphinx themes build on — replicating that byte-for-byte would be a second undertaking on the scale of the whole parser, for a stylesheet Sphinx doesn't even use — it has its own Jinja2 templates). SCOPE (v1): Render produces a BODY-CONTENT FRAGMENT only — no <!DOCTYPE>, <html>, <head>, or stylesheet; embedding it in a page is left to the caller. Tag choices follow docutils' html5_polyglot where there's an obvious correspondence (section/p/ul/ol/li/blockquote/ table/thead/tbody/tr, em/strong/code/cite/sub/sup/abbr), but CSS classes, ids, and other presentational attributes are NOT replicated — this parser doesn't run docutils' id-assignment pass, so there's nothing faithful to assign anyway.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(doc *doctree.Element) string

Render walks doc and returns an HTML fragment for its content.

Types

This section is empty.

Jump to

Keyboard shortcuts

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