icons

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(name string) string

Get returns an inline SVG for the given icon name.

func GetWithClass

func GetWithClass(name, class string) string

GetWithClass returns an inline SVG with an optional CSS class attribute. Used by block extensions (aside/card/linkcard/linkbutton). No fallback; defaults to 16x16. ARIA attributes (aria-hidden, focusable) are injected by the manager's renderer.

func LoadCollection

func LoadCollection(data []byte) error

LoadCollection loads an additional Iconify JSON collection from raw bytes and registers it as a provider under its prefix.

func LoadIconDirectory

func LoadIconDirectory(dirPath string) error

LoadIconDirectory registers a DirectoryProvider that loads SVG files from dirPath. Bare icon names resolve from this directory FIRST (project overrides win). A missing directory is not an error.

func Render

func Render(name, baseClass string, attrs map[string]string) string

Render returns an inline SVG for the template func and inline Markdown extension. Falls back to "circle-help" on miss, applies transforms, accessibility attributes.

func SetDefaultPrefix

func SetDefaultPrefix(p string)

SetDefaultPrefix sets the icon set used for bare (prefixless) names.

func SetRenderMode

func SetRenderMode(m string)

SetRenderMode selects the icon output mode.

func SpriteForHTML

func SpriteForHTML(pageHTML []byte) []byte

SpriteForHTML scans finished page HTML for sprite <use> references and returns a hidden <svg> holding one <symbol> per unique referenced icon.

func SpriteMode

func SpriteMode() bool

SpriteMode reports whether sprite output is enabled.

Types

type SetLicense

type SetLicense struct {
	Prefix string
	Title  string
	SPDX   string
	URL    string
}

SetLicense is a loaded icon set's license metadata, for attribution.

func LoadedSetLicenses

func LoadedSetLicenses() []SetLicense

LoadedSetLicenses returns license metadata for every loaded collection.

func UsedSetLicenses

func UsedSetLicenses() []SetLicense

UsedSetLicenses returns license metadata for the collections actually referenced during the build.

Jump to

Keyboard shortcuts

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