Documentation ¶
Overview ¶
Package plugin contains all the rules that are not part of Commonmark like GitHub Flavored Markdown.
Index ¶
- Constants
- Variables
- func ConfluenceAttachments() md.Plugin
- func ConfluenceCodeBlock() md.Plugin
- func EXPERIMENTALFrontMatter(format string) md.Plugin
- func EXPERIMENTALVimeoEmbed(variation vimeoVariation) md.Plugin
- func GitHubFlavored() md.Plugin
- func Strikethrough(character string) md.Plugin
- func Table() md.Plugin
- func TableCompat() md.Plugin
- func TaskListItems() md.Plugin
Constants ¶
const ( VimeoOnlyThumbnail vimeoVariation = iota VimeoWithTitle VimeoWithDescription )
Configure how the Vimeo Plugin should display the video in markdown.
Variables ¶
var EXPERIMENTALYoutubeEmbed = []md.Rule{ { Filter: []string{"iframe"}, Replacement: func(content string, selec *goquery.Selection, opt *md.Options) *string { src := selec.AttrOr("src", "") if !strings.Contains(src, "www.youtube.com") { return nil } alt := selec.AttrOr("title", "") parts := youtubeID.FindStringSubmatch(src) if len(parts) != 2 { return nil } id := parts[1] text := fmt.Sprintf("[![%s](https://img.youtube.com/vi/%s/0.jpg)](https://www.youtube.com/watch?v=%s)", alt, id, id) return &text }, }, }
EXPERIMENTALYoutubeEmbed registers a rule (for iframes) and returns a markdown compatible representation (link to video, ...).
var Timeout = time.Second * 10
Timeout for the http client
Functions ¶
func ConfluenceAttachments ¶
ConfluenceAttachments converts `<ri:attachment ri:filename=""/>` elements [Contributed by @Skarlso]
func ConfluenceCodeBlock ¶
ConfluenceCodeBlock converts `<ac:structured-macro>` elements that are used in Atlassian’s Wiki “Confluence”. [Contributed by @Skarlso]
func EXPERIMENTALFrontMatter ¶ added in v1.2.0
EXPERIMENTALFrontMatter was an experiment to add certain data from a callback function into the beginning of the file as frontmatter. It not really working right now.
If someone has a need for it, let me know what your use-case is. Then I can create a plugin with a good interface.
func EXPERIMENTALVimeoEmbed ¶ added in v1.2.0
EXPERIMENTALVimeoEmbed registers a rule (for iframes) and returns a markdown compatible representation (link to video, ...).
func Strikethrough ¶
Strikethrough converts `<strike>`, `<s>`, and `<del>` elements
func Table ¶ added in v1.2.0
Table converts a html table (using hyphens and pipe characters) to a visuall representation in markdown.
Note: This Plugin overrides the default compatibility rules from `commonmark.go`. Only use this Plugin in an environment that has extendeded the normal syntax, like GitHub's Flavored Markdown.
func TableCompat ¶ added in v1.2.0
TableCompat is a compatibility plugon for environments where only commonmark markdown (without Tables) is supported.
Note: In an environment that supports "real" Tables, like GitHub's Flavored Markdown use `plugin.Table()` instead.
func TaskListItems ¶
TaskListItems converts checkboxes into task list items.
Types ¶
This section is empty.