figure

package
v0.3.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TagOpen  = []byte("<figure")
	TagClose = []byte("</figure>")
)

Byte constants for HTML rendering.

Functions

func Caption added in v0.3.0

func Caption(caption string, nodes ...node.Node) *element

Caption Creates a figure with a caption and content. The caption is rendered as a figcaption element before the content nodes. Example: figure.Caption("An elephant", img.New().Src("elephant.jpg")) Renders: <figure><figcaption>An elephant</figcaption><img src="elephant.jpg" /></figure>

func New

func New(nodes ...node.Node) *element

New Creates a new figure element with the given child nodes. Example: figure.New(img.New().Src("elephant.jpg"), figcaption.New(text.Text("An elephant at sunset"))) Renders: <figure><img src="elephant.jpg" /><figcaption>An elephant at sunset</figcaption></figure>

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

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