Documentation
¶
Overview ¶
Package hashtag provides support for #tag-style tags for the Goldmark Markdown parser.
Deprecated: Use go.abhg.dev/goldmark/hashtag instead.
Index ¶
Constants ¶
const ( // DefaultVariant is the default flavor of hashtag syntax supported by // this package. // // In this format, hashtags start with "#" and an alphabet, followed by // zero or more alphanumeric characters and the following symbols. // // /_- DefaultVariant = hashtag.DefaultVariant // ObsidianVariant is a flavor of the hashtag syntax that aims to be // compatible with Obsidian (https://obsidian.md/). // // In this format, hashtags start with "#" followed by alphabets, // numbers, emoji, or any of the following symbols. // // /_- // // Hashtags cannot be entirely numeric and must contain at least one // non-numeric character. // // See also https://help.obsidian.md/How+to/Working+with+tags. ObsidianVariant = hashtag.ObsidianVariant )
Variables ¶
var Kind = hashtag.Kind
Kind is the kind of hashtag AST nodes.
Functions ¶
This section is empty.
Types ¶
type Extender ¶
Extender extends a goldmark Markdown object with support for parsing and rendering hashtags.
Install it on your Markdown object upon creation.
goldmark.New(
goldmark.WithExtensions(
// ...
&hashtag.Extender{...},
),
// ...
)
Provide a Resolver to render tags as links that point to a specific destination.
type Parser ¶
Parser is a Goldmark inline parser for parsing hashtag nodes.
Hashtags start with "#". The list of other characters allowed in the hashtag is determined by variant. See the documentation for Variant for more details.
type Renderer ¶
Renderer renders hashtag nodes into HTML, optionally linking them to specific pages.
#foo
Renders as the following by default.
<span class="hashtag">#foo</span>
Supply a Resolver that returns a non-empty destination to render it like the following.
<span class="hashtag"><a href="...">#foo</a></span>