ol

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

	AttrReversed = []byte(" reversed")
	AttrStart    = []byte(" start=\"")
	AttrType     = []byte(" type=\"")
)

Byte constants for HTML rendering.

Functions

func Decimal

func Decimal(items ...*li.Element) *element

Decimal Creates an ordered list with decimal numbering (1, 2, 3...) Example: ol.Decimal(li.Text("one"), li.Text("two")) Renders: <ol type="1"><li>one</li><li>two</li></ol>

func Items added in v0.3.0

func Items(items ...*li.Element) *element

Items Creates an ordered list from li elements, enforcing correct nesting at compile time. Example: ol.Items(li.Text("one"), li.Text("two")) Renders: <ol><li>one</li><li>two</li></ol>

func LowerAlpha

func LowerAlpha(items ...*li.Element) *element

LowerAlpha Creates an ordered list with lowercase letters (a, b, c...) Example: ol.LowerAlpha(li.Text("one"), li.Text("two")) Renders: <ol type="a"><li>one</li><li>two</li></ol>

func LowerRoman

func LowerRoman(items ...*li.Element) *element

LowerRoman Creates an ordered list with lowercase Roman numerals (i, ii, iii...) Example: ol.LowerRoman(li.Text("one"), li.Text("two")) Renders: <ol type="i"><li>one</li><li>two</li></ol>

func New

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

New Creates a new ordered list element with optional child nodes (typically li elements) Example: ol.New() Renders: <ol></ol>

func UpperAlpha

func UpperAlpha(items ...*li.Element) *element

UpperAlpha Creates an ordered list with uppercase letters (A, B, C...) Example: ol.UpperAlpha(li.Text("one"), li.Text("two")) Renders: <ol type="A"><li>one</li><li>two</li></ol>

func UpperRoman

func UpperRoman(items ...*li.Element) *element

UpperRoman Creates an ordered list with uppercase Roman numerals (I, II, III...) Example: ol.UpperRoman(li.Text("one"), li.Text("two")) Renders: <ol type="I"><li>one</li><li>two</li></ol>

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