Documentation ¶
Index ¶
- Constants
- func NewCommonmarkPlugin(opts ...OptionFunc) converter.Plugin
- type OptionFunc
- func WithBulletListMarker(marker string) OptionFunc
- func WithCodeBlockFence(fence string) OptionFunc
- func WithEmDelimiter(delimiter string) OptionFunc
- func WithHeadingStyle(style headingStyle) OptionFunc
- func WithHorizontalRule(rule string) OptionFunc
- func WithLinkEmptyContentBehavior(behavior linkRenderingBehavior) OptionFunc
- func WithLinkEmptyHrefBehavior(behavior linkRenderingBehavior) OptionFunc
- func WithListEndComment(enabled bool) OptionFunc
- func WithStrongDelimiter(delimiter string) OptionFunc
- type ValidateConfigError
Constants ¶
const ( // For example: // // [view more](/about.html) LinkStyleInlined linkStyle = "inlined" LinkStyleReferencedIndex linkStyle = "referenced_index" LinkStyleReferencedShort linkStyle = "referenced_short" )
const ( // HeadingStyleATX is the heading style of prefixing the heading with "#" signs indicating the level. For example: // // ## Heading HeadingStyleATX headingStyle = "atx" // HeadingStyleSetext is the heading style of putting "=" or "-" on the followed line. For example: // // Heading // ------- HeadingStyleSetext headingStyle = "setext" )
const ( // LinkBehaviorRender renders the element as a link LinkBehaviorRender linkRenderingBehavior = "render" // LinkBehaviorSkip skips link rendering and falls back to the other rules (e.g. paragraph) LinkBehaviorSkip linkRenderingBehavior = "skip" )
Variables ¶
This section is empty.
Functions ¶
func NewCommonmarkPlugin ¶
func NewCommonmarkPlugin(opts ...OptionFunc) converter.Plugin
NewCommonmarkPlugin registers the markdown syntax of commonmark.
Types ¶
type OptionFunc ¶
type OptionFunc = func(config *config)
func WithBulletListMarker ¶
func WithBulletListMarker(marker string) OptionFunc
"-", "+", or "*"
default: "-"
func WithHeadingStyle ¶
func WithHeadingStyle(style headingStyle) OptionFunc
"setext" or "atx"
default: "atx"
func WithHorizontalRule ¶
func WithHorizontalRule(rule string) OptionFunc
Any Thematic break
default: "* * *"
func WithLinkEmptyContentBehavior ¶ added in v2.2.2
func WithLinkEmptyContentBehavior(behavior linkRenderingBehavior) OptionFunc
WithLinkEmptyContentBehavior configures how links *without content* are rendered. Take for example:
<a href="/page"></a>
LinkBehaviorRenderAsLink would result in "[](/page)""
LinkBehaviorSkipLink would result in an empty string.
func WithLinkEmptyHrefBehavior ¶ added in v2.2.2
func WithLinkEmptyHrefBehavior(behavior linkRenderingBehavior) OptionFunc
WithLinkEmptyHrefBehavior configures how links with *empty hrefs* are rendered. Take for example:
<a href="">the link content</a>
LinkBehaviorRenderAsLink would result in "[the link content]()""
LinkBehaviorSkipLink would result in "the link content"
func WithListEndComment ¶
func WithListEndComment(enabled bool) OptionFunc
func WithStrongDelimiter ¶
func WithStrongDelimiter(delimiter string) OptionFunc
** or __
default: **
type ValidateConfigError ¶
type ValidateConfigError struct { Key string Value string // By default is "Key:Value" but can be // overriden to e.g. "--key=value" KeyWithValue string // contains filtered or unexported fields }
TODO: should this be with the commonmark package? Or more general? TODO: Maybe make it an interface? And also have a GetPluginName function?
func (*ValidateConfigError) Error ¶
func (e *ValidateConfigError) Error() string