internal

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const HTML_TEMPLATE = `{{ define "%s" }}
%s
  {{ range $value := . }}
    {{ $value }}
  {{ end }}
>
  %s
{{ end }}`
View Source
const TEMPL_TEMPLATE = `package %s

templ %s(attrs ...templ.Attributes) {
	%s
		if len(attrs) > 0 {
			{ attrs[0]... }
		}
	>
		%s
}`

Variables

View Source
var IconEmbeds = map[string]embed.FS{
	"lucide":       lucide.Templates,
	"simple-icons": simpleicons.Templates,
	"radix-icons":  radixicons.Templates,
	"ionicons":     ionicons.Templates,
	"material":     material.Templates,
}
View Source
var SupportedFormats = map[string]struct{}{
	"html":  {},
	"templ": {},
}
View Source
var SupportedLibraries = map[string][]string{
	"lucide":       {"./lucide-repo/icons", "./lucide"},
	"simple-icons": {"./simple-icons-repo/icons", "./simple-icons"},
	"radix-icons":  {"./radix-icons-repo/packages/radix-icons/icons", "./radix-icons"},
	"ionicons":     {"./ionicons-repo/src/svg", "./ionicons"},
	"material":     {"./material-repo/packages/mui-icons-material/material-icons", "./material"},
}

key=library, value[0]=icons path in cloned repo, value[1]=path in current repo

Functions

func DiffFileSet

func DiffFileSet(setA, setB map[string]struct{}) map[string]struct{}

DiffSet returns the difference set of `setA` minus `setB`.

func FileSet

func FileSet(path, ext string) map[string]struct{}

FileSet returns a set of names of files of type 'ext' from the specified 'path' with 'ext' trimmed.

func GetHTMLFile

func GetHTMLFile(library, icon string) ([]byte, error)

GetHTMLFile returns the contents of the given html icon file.

func GetTemplFile

func GetTemplFile(library, icon string) ([]byte, error)

GetTemplFile returns the contents of the given templ icon file.

func KebabToPascal

func KebabToPascal(v string) (string, error)

KebabToPascal converts a kebab case string to a pascal case string.

func NonAlphaPrefixer

func NonAlphaPrefixer(v string) string

NonAlphaPrefixer prefixes the given string with T if it starts with a non alphanumeric character.

func ToHTML

func ToHTML(name, svg, outputPath string) error

ToHTML embeds the 'svg' into a html template and saves it as 'name' to the 'outputPath'.

func ToTempl

func ToTempl(library, name, svg, outputPath string) error

ToTempl embeds the 'svg' into a templ template and saves it as 'name' to the 'outputPath'.

Types

This section is empty.

Jump to

Keyboard shortcuts

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