cite

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package cite provides constructors and methods for the HTML <cite> element.

The <cite> HTML element is used to mark up the title of a creative work. The reference may be in an abbreviated form according to context-appropriate conventions related to citation metadata.

Index

Constants

This section is empty.

Variables

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

Byte constants for HTML rendering.

Functions

func New

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

New creates a new cite element with the given child nodes. Example: cite.New(text.Text("Nineteen Eighty-Four")) Renders: <cite>Nineteen Eighty-Four</cite>

func RawText

func RawText(str string) *element

RawText creates a new cite element with raw text content. Uses text.RawText which is not HTML-escaped. Example: cite.RawText("Nineteen Eighty-Four") Renders: <cite>Nineteen Eighty-Four</cite>

func RawTextf

func RawTextf(format string, args ...any) *element

RawTextf creates a new cite element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: cite.RawTextf("Nineteen %s", "Eighty-Four") Renders: <cite>Nineteen Eighty-Four</cite>

func Static

func Static(str string) *element

Static creates a new cite element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: cite.Static("Nineteen Eighty-Four") Renders: <cite>Nineteen Eighty-Four</cite>

func Text

func Text(str string) *element

Text creates a new cite element with text content. Uses text.Text which HTML-escapes the output. Example: cite.Text("Nineteen Eighty-Four") Renders: <cite>Nineteen Eighty-Four</cite>

func Textf

func Textf(format string, args ...any) *element

Textf creates a new cite element with formatted text content. Uses text.Textf which HTML-escapes the output. Example: cite.Textf("Nineteen %s", "Eighty-Four") Renders: <cite>Nineteen Eighty-Four</cite>

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