Documentation
¶
Index ¶
- Variables
- func CreateIconsMap(iconData string) map[string]string
- func NewAlertCallouts(options ...Option) *alertCalloutsOptions
- type Config
- type Option
- func UseGFMIcons() Option
- func UseGFMPlusIcons() Option
- func UseGFMStrictIcons() Option
- func UseGFMWithAliasesIcons() Option
- func UseHybridIcons() Option
- func UseObsidianIcons() Option
- func WithAllowNOICON(enable bool) Option
- func WithCustomAlerts(enable bool) Option
- func WithFolding(enable bool) Option
- func WithIcon(kind, icon string) Option
- func WithIcons(icons map[string]string) Option
Constants ¶
This section is empty.
Variables ¶
var AlertCallouts = NewAlertCallouts( UseGFMStrictIcons(), )
AlertCallouts will initialize the extension with the basic GFM icon set This can be initialized using the `goldmark.WithExtensions(alertcallouts.AlertCallouts)` syntax
Functions ¶
func CreateIconsMap ¶ added in v0.6.0
CreateIconsMap creates a map of icon names to their SVG data from the given icon data string. This is a public wrapper around the internal utilities function, allowing users to create custom icon maps from their own icon data files.
func NewAlertCallouts ¶ added in v0.5.0
func NewAlertCallouts(options ...Option) *alertCalloutsOptions
NewAlertCallouts creates a new AlertCallouts extension with the given options. This follows the standard Goldmark extension initialization pattern.
Types ¶
type Config ¶ added in v0.7.0
type Config struct {
Icons map[string]string // Icon map for different alert types
FoldingEnabled bool // Whether folding functionality is enabled
CustomAlertsEnabled bool // Whether custom alert types are allowed
DefaultIcons int // Which default icon set to use (constants.ICONS_*)
AllowNOICON bool // Whether to allow NOICON alert types (example of new option)
}
Config holds all configuration options for alert callouts rendering. This struct is passed to renderer constructors to avoid long parameter lists and make it easy to add new options without breaking function signatures.
func (*Config) GetIconKeys ¶ added in v0.7.0
GetIconKeys returns a slice of all icon keys from the Config.Icons map. This allows access to the icon names without the SVG data, useful for validation, searching, or listing available alert types without the overhead of passing large SVG strings.
type Option ¶ added in v0.5.0
type Option func(*alertCalloutsOptions)
Option is a functional option for configuring alertCalloutsOptions.
func UseGFMIcons ¶ added in v0.6.0
func UseGFMIcons() Option
UseGFMIcons sets the icon map to the GFM (GitHub Flavored Markdown) icon set. Deprecated: Use UseGFMStrictIcons() instead.
func UseGFMPlusIcons ¶ added in v0.6.0
func UseGFMPlusIcons() Option
UseGFMPlusIcons sets the GFMPlus + Aliases that mimic some Obsidian callouts but
still use the default five (5) GFM Alerts
Deprecated: Use UseHybridIcons() instead
func UseGFMStrictIcons ¶ added in v0.7.0
func UseGFMStrictIcons() Option
func UseGFMWithAliasesIcons ¶ added in v0.7.0
func UseGFMWithAliasesIcons() Option
UseGFMWithAliasesIcons sets the GFM with extra aliases Deprecated: Use UseHybridIcons() instead
func UseHybridIcons ¶ added in v0.7.0
func UseHybridIcons() Option
UseGFMPlusIcons sets the icon map to the GFM Plus icon set (essentially a melding of GFM and Obsidian).
func UseObsidianIcons ¶ added in v0.6.0
func UseObsidianIcons() Option
UseObsidianIcons sets the icon map to the Obsidian-style icon set.
func WithAllowNOICON ¶ added in v0.7.0
WithAllowNOICON sets whether to allow NOICON prefix to alert types. This is a rendering option -- the parser will ALWAYS strip the 'noicon-' or 'noicon_' prefix
during the parsing phase and set the 'noicon' attribute on the node. It's the renderer that will use this 'AllowNOICON' option to decide how to handle icons.
func WithCustomAlerts ¶ added in v0.7.0
WithCustomAlerts sets whether to allow custom alert types and titles.
func WithFolding ¶ added in v0.5.0
WithFolding sets the folding functionality for alert callouts.