package util
import "github.com/bouncepaw/mycomarkup/util"
Package util provides simple utility functions usable in all modules.
Index ¶
- func BeautifulName(uglyName string) string
- func CanonicalName(name string) string
- func DefaultString(s, d string) string
- func SanitizeName(unsafeName string) string
- func StringID(s string) string
Functions ¶
func BeautifulName ¶
BeautifulName makes the ugly name beautiful by replacing _ with spaces and using title case
func CanonicalName ¶
CanonicalName returns the canonical form of the name. A name is canonical if it is lowercase, all left and right whitespace is trimmed and all spaces are replaced with underscores.
func DefaultString ¶
DefaultString returns d if s is an empty string, s otherwise.
func SanitizeName ¶
func StringID ¶
StringID sanitizes the string and makes it more suitable for the id attribute in HTML.
Source Files ¶
- Version
- v1.0.4 (latest)
- Published
- Sep 10, 2021
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 4 days ago –
Tools for package owners.