Documentation
¶
Index ¶
- Constants
- Variables
- func DiffFileSet(setA, setB map[string]struct{}) map[string]struct{}
- func FileSet(path, ext string) map[string]struct{}
- func GetHTMLFile(library, icon string) ([]byte, error)
- func GetTemplFile(library, icon string) ([]byte, error)
- func KebabToPascal(v string) (string, error)
- func NonAlphaPrefixer(v string) string
- func ToHTML(name, svg, outputPath string) error
- func ToTempl(library, name, svg, outputPath string) error
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 ¶
DiffSet returns the difference set of `setA` minus `setB`.
func FileSet ¶
FileSet returns a set of names of files of type 'ext' from the specified 'path' with 'ext' trimmed.
func GetHTMLFile ¶
GetHTMLFile returns the contents of the given html icon file.
func GetTemplFile ¶
GetTemplFile returns the contents of the given templ icon file.
func KebabToPascal ¶
KebabToPascal converts a kebab case string to a pascal case string.
func NonAlphaPrefixer ¶
NonAlphaPrefixer prefixes the given string with T if it starts with a non alphanumeric character.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.