a

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Data

func Base64Data(str string, mime string, data string) *element

Base64Data Creates a new anchor element with base64 data URL for binary content downloads Example: a.Base64Data("Download Image", "image/png", "iVBORw0KGgoAAAANS...") Renders: <a href="data:image/png;base64,iVBORw0KGgoAAAANS...">Download Image</a>

func DataURL

func DataURL(str string, mime string, data string) *element

DataURL Creates a new anchor element with data URL for embedded content or downloads Example: a.DataURL("Download Text", "text/plain", "Hello%20World") Renders: <a href="data:text/plain,Hello%20World">Download Text</a>

func FTP

func FTP(url string, str string) *element

FTP Creates a new anchor element with FTP protocol Example: a.FTP("files.example.com/folder", "Download Files") Renders: <a href="files.example.com/folder">Download Files</a>

func JumpTo

func JumpTo(anchor string, str string) *element

JumpTo Creates a new anchor element for internal page navigation (fragment identifier) Example: a.JumpTo("section1", "Go to Section 1") Renders: <a href="section1">Go to Section 1</a>

func Link(href string, str string) *element

Link Creates a new anchor element with href and text content Example: a.Link("https://example.com", "Click here") Renders: <a href="https://example.com">Click here</a>

func MailTo

func MailTo(email string, str string) *element

MailTo Creates a new anchor element with mailto scheme that opens the user's email client Example: a.MailTo("john@example.com", "Email John") Renders: <a href="john@example.com">Email John</a>

func New

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

New Creates a new anchor element without any initial attributes. Example: a.New(text.Text("Click here")).Href("https://example.com") Renders: <a href="https://example.com">Click here</a>

func RawText

func RawText(str string) *element

RawText Creates a new anchor element with raw HTML content (unescaped) Example: a.RawText("Click <em>here</em>") Renders: <a>Click <em>here</em></a>

func RawTextf

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

RawTextf Creates a new a element with formatted raw text content as unescaped HTML using text.RawTextf. Example: a.RawTextf("Hello <em>%s</em>", "World") Renders: <a>Hello <em>World</em></a>

func SMS

func SMS(number string, str string) *element

SMS Creates a new anchor element with SMS scheme that opens the messaging app on mobile devices Example: a.SMS("+1234567890", "Send SMS") Renders: <a href="+1234567890">Send SMS</a>

func Static

func Static(str string) *element

Static Creates a new anchor element with static text content Example: a.Static("Click here") Renders: <a>Click here</a>

func Tel

func Tel(number string, str string) *element

Tel Creates a new anchor element with tel scheme that initiates a phone call on mobile devices Example: a.Tel("+1234567890", "Call Me") Renders: <a href="+1234567890">Call Me</a>

func Text

func Text(str string) *element

Text Creates a new anchor element with text content (HTML-encoded) Example: a.Text("Click here") Renders: <a>Click here</a>

func Textf

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

Textf Creates a new a element with formatted text content using text.Textf. Example: a.Textf("Hello %s", "World") Renders: <a>Hello World</a>

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