package main import ( "fmt" "net/http" "strings" "github.com/bouncepaw/mycorrhiza/util" ) // isCanonicalName checks if the `name` is canonical. func isCanonicalName(name string) bool { return HyphaPattern.MatchString(name) } // CanonicalName makes sure the `name` is canonical. A name is canonical if it is lowercase and all spaces are replaced with underscores. func CanonicalName(name string) string { return strings.ToLower(strings.ReplaceAll(name, " ", "_")) } // naviTitle turns `canonicalName` into html string with each hypha path parts higlighted as links. // TODO: rework as a template func naviTitle(canonicalName string) string { var ( html = fmt.Sprintf(`