Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FontAwesomeIconShortcode = Shortcode{ Name: "fa-icon", InlineFn: func(node *Node, ctx clContext.Context) (output string) { class, _ := node.Attributes.Lookup["class"] classes := htmlcss.ParseClass(class) styles := make(map[string]string) if v, ok := node.Attributes.Lookup["fa-icon"]; ok && v != "" { if _, ignore := node.Attributes.Lookup["name"]; !ignore { node.Attributes.Set("name", v) } } faParseFamilyStyle(node, classes) faParseIconName(node, classes) faParseIconSize(node, classes) faParseFlipRotate(node, classes, styles) faParseFixedWidth(node, classes) faParseBorder(node, classes, styles) faParsePull(node, classes, styles) output += `<i` if v := classes.String(); v != "" { output += fmt.Sprintf(` class=%q`, v) } if len(styles) > 0 { s := "" for _, key := range maps.SortedKeys(styles) { s += key + ":" + styles[key] + ";" } output += fmt.Sprintf(` style=%q`, s) } output += `></i>` return }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.