package extension

Import Path
	github.com/yuin/goldmark/extension (on go.dev)

Dependency Relation
	imports 13 packages, and imported by one package

Involved Source Files cjk.go definition_list.go footnote.go gfm.go linkify.go Package extension is a collection of builtin extensions. strikethrough.go table.go tasklist.go typographer.go
Package-Level Type Names (total 18)
/* sort by: | */
A CJKOption sets options for CJK support mostly for HTML based renderers. func WithEastAsianLineBreaks(style ...EastAsianLineBreaks) CJKOption func WithEscapedSpace() CJKOption func NewCJK(opts ...CJKOption) goldmark.Extender
DefinitionListHTMLRenderer is a renderer.NodeRenderer implementation that renders DefinitionList nodes. Config html.Config Config.EastAsianLineBreaks html.EastAsianLineBreaks Config.HardWraps bool Config.Unsafe bool Config.Writer html.Writer Config.XHTML bool RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs. SetOption implements renderer.NodeRenderer.SetOption. *DefinitionListHTMLRenderer : github.com/yuin/goldmark/renderer.NodeRenderer *DefinitionListHTMLRenderer : github.com/yuin/goldmark/renderer.SetOptioner
A EastAsianLineBreaks is a style of east asian line breaks. func WithEastAsianLineBreaks(style ...EastAsianLineBreaks) CJKOption const EastAsianLineBreaksCSS3Draft const EastAsianLineBreaksNone const EastAsianLineBreaksSimple
FootnoteConfig holds configuration values for the footnote extension. Link* and Backlink* configurations have some variables: Occurrences of “^^” in the string will be replaced by the corresponding footnote number in the HTML output. Occurrences of “%%” will be replaced by a number for the reference (footnotes can have multiple references). BacklinkClass is a class for footnote backlinks. BacklinkHTML is an HTML content for footnote backlinks. BacklinkTitle is an optional title attribute for footnote backlinks. Config html.Config Config.EastAsianLineBreaks html.EastAsianLineBreaks Config.HardWraps bool Config.Unsafe bool Config.Writer html.Writer Config.XHTML bool IDPrefix is a prefix for the id attributes generated by footnotes. IDPrefix is a function that determines the id attribute for given Node. LinkClass is a class for footnote links. LinkTitle is an optional title attribute for footnote links. SetOption implements renderer.SetOptioner. *FootnoteConfig : github.com/yuin/goldmark/renderer.SetOptioner func NewFootnoteConfig() FootnoteConfig func FootnoteOption.SetFootnoteOption(*FootnoteConfig)
FootnoteHTMLRenderer is a renderer.NodeRenderer implementation that renders FootnoteLink nodes. FootnoteConfig FootnoteConfig BacklinkClass is a class for footnote backlinks. BacklinkHTML is an HTML content for footnote backlinks. BacklinkTitle is an optional title attribute for footnote backlinks. FootnoteConfig.Config html.Config FootnoteConfig.Config.EastAsianLineBreaks html.EastAsianLineBreaks FootnoteConfig.Config.HardWraps bool FootnoteConfig.Config.Unsafe bool FootnoteConfig.Config.Writer html.Writer FootnoteConfig.Config.XHTML bool IDPrefix is a prefix for the id attributes generated by footnotes. IDPrefix is a function that determines the id attribute for given Node. LinkClass is a class for footnote links. LinkTitle is an optional title attribute for footnote links. RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs. SetOption implements renderer.SetOptioner. *FootnoteHTMLRenderer : github.com/yuin/goldmark/renderer.NodeRenderer *FootnoteHTMLRenderer : github.com/yuin/goldmark/renderer.SetOptioner
FootnoteOption interface is a functional option interface for the extension. ( FootnoteOption) SetConfig(*renderer.Config) SetFootnoteOption sets given option to the extension. FootnoteOption : github.com/yuin/goldmark/renderer.Option func WithFootnoteBacklinkClass[T](a T) FootnoteOption func WithFootnoteBacklinkHTML[T](a T) FootnoteOption func WithFootnoteBacklinkTitle[T](a T) FootnoteOption func WithFootnoteHTMLOptions(opts ...html.Option) FootnoteOption func WithFootnoteIDPrefix[T](a T) FootnoteOption func WithFootnoteIDPrefixFunction(a func(gast.Node) []byte) FootnoteOption func WithFootnoteLinkClass[T](a T) FootnoteOption func WithFootnoteLinkTitle[T](a T) FootnoteOption func NewFootnote(opts ...FootnoteOption) goldmark.Extender func NewFootnoteHTMLRenderer(opts ...FootnoteOption) renderer.NodeRenderer
An LinkifyConfig struct is a data structure that holds configuration of the Linkify extension. AllowedProtocols [][]byte EmailRegexp *regexp.Regexp URLRegexp *regexp.Regexp WWWRegexp *regexp.Regexp SetOption implements SetOptioner. *LinkifyConfig : github.com/yuin/goldmark/parser.SetOptioner func LinkifyOption.SetLinkifyOption(*LinkifyConfig)
A LinkifyOption interface sets options for the LinkifyOption. ( LinkifyOption) SetLinkifyOption(*LinkifyConfig) ( LinkifyOption) SetParserOption(*parser.Config) LinkifyOption : github.com/yuin/goldmark/parser.Option func WithLinkifyAllowedProtocols[T](value []T) LinkifyOption func WithLinkifyEmailRegexp(value *regexp.Regexp) LinkifyOption func WithLinkifyURLRegexp(value *regexp.Regexp) LinkifyOption func WithLinkifyWWWRegexp(value *regexp.Regexp) LinkifyOption func NewLinkify(opts ...LinkifyOption) goldmark.Extender func NewLinkifyParser(opts ...LinkifyOption) parser.InlineParser
StrikethroughHTMLRenderer is a renderer.NodeRenderer implementation that renders Strikethrough nodes. Config html.Config Config.EastAsianLineBreaks html.EastAsianLineBreaks Config.HardWraps bool Config.Unsafe bool Config.Writer html.Writer Config.XHTML bool RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs. SetOption implements renderer.NodeRenderer.SetOption. *StrikethroughHTMLRenderer : github.com/yuin/goldmark/renderer.NodeRenderer *StrikethroughHTMLRenderer : github.com/yuin/goldmark/renderer.SetOptioner
TableCellAlignMethod indicates how are table cells aligned in HTML format. func WithTableCellAlignMethod(a TableCellAlignMethod) TableOption const TableCellAlignAttribute const TableCellAlignDefault const TableCellAlignNone const TableCellAlignStyle
TableConfig struct holds options for the extension. Config html.Config Config.EastAsianLineBreaks html.EastAsianLineBreaks Config.HardWraps bool Config.Unsafe bool Config.Writer html.Writer Config.XHTML bool TableCellAlignMethod indicates how are table celss aligned. SetOption implements renderer.SetOptioner. *TableConfig : github.com/yuin/goldmark/renderer.SetOptioner func NewTableConfig() TableConfig func TableOption.SetTableOption(*TableConfig)
TableHTMLRenderer is a renderer.NodeRenderer implementation that renders Table nodes. TableConfig TableConfig TableConfig.Config html.Config TableConfig.Config.EastAsianLineBreaks html.EastAsianLineBreaks TableConfig.Config.HardWraps bool TableConfig.Config.Unsafe bool TableConfig.Config.Writer html.Writer TableConfig.Config.XHTML bool TableCellAlignMethod indicates how are table celss aligned. RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs. SetOption implements renderer.SetOptioner. *TableHTMLRenderer : github.com/yuin/goldmark/renderer.NodeRenderer *TableHTMLRenderer : github.com/yuin/goldmark/renderer.SetOptioner
TableOption interface is a functional option interface for the extension. ( TableOption) SetConfig(*renderer.Config) SetTableOption sets given option to the extension. TableOption : github.com/yuin/goldmark/renderer.Option func WithTableCellAlignMethod(a TableCellAlignMethod) TableOption func WithTableHTMLOptions(opts ...html.Option) TableOption func NewTable(opts ...TableOption) goldmark.Extender func NewTableHTMLRenderer(opts ...TableOption) renderer.NodeRenderer
TaskCheckBoxHTMLRenderer is a renderer.NodeRenderer implementation that renders checkboxes in list items. Config html.Config Config.EastAsianLineBreaks html.EastAsianLineBreaks Config.HardWraps bool Config.Unsafe bool Config.Writer html.Writer Config.XHTML bool RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs. SetOption implements renderer.NodeRenderer.SetOption. *TaskCheckBoxHTMLRenderer : github.com/yuin/goldmark/renderer.NodeRenderer *TaskCheckBoxHTMLRenderer : github.com/yuin/goldmark/renderer.SetOptioner
An TypographerConfig struct is a data structure that holds configuration of the Typographer extension. Substitutions [][]byte SetOption implements SetOptioner. *TypographerConfig : github.com/yuin/goldmark/parser.SetOptioner func TypographerOption.SetTypographerOption(*TypographerConfig)
A TypographerOption interface sets options for the TypographerParser. ( TypographerOption) SetParserOption(*parser.Config) ( TypographerOption) SetTypographerOption(*TypographerConfig) TypographerOption : github.com/yuin/goldmark/parser.Option func WithTypographicSubstitutions[T](values map[TypographicPunctuation]T) TypographerOption func NewTypographer(opts ...TypographerOption) goldmark.Extender func NewTypographerParser(opts ...TypographerOption) parser.InlineParser
TypographicPunctuation is a key of the punctuations that can be replaced with typographic entities. func WithTypographicSubstitutions[T](values map[TypographicPunctuation]T) TypographerOption const Apostrophe const Ellipsis const EmDash const EnDash const LeftAngleQuote const LeftDoubleQuote const LeftSingleQuote const RightAngleQuote const RightDoubleQuote const RightSingleQuote
TypographicSubstitutions is a list of the substitutions for the Typographer extension.
Package-Level Functions (total 40)
NewCJK returns a new extension with given options.
NewDefinitionDescriptionParser return a new parser.BlockParser that can parse definition description starts with ':'.
NewDefinitionListHTMLRenderer returns a new DefinitionListHTMLRenderer.
NewDefinitionListParser return a new parser.BlockParser that can parse PHP Markdown Extra Definition lists.
NewFootnote returns a new extension with given options.
NewFootnoteASTTransformer returns a new parser.ASTTransformer that insert a footnote list to the last of the document.
NewFootnoteBlockParser returns a new parser.BlockParser that can parse footnotes of the Markdown(PHP Markdown Extra) text.
NewFootnoteConfig returns a new Config with defaults.
NewFootnoteHTMLRenderer returns a new FootnoteHTMLRenderer.
NewFootnoteParser returns a new parser.InlineParser that can parse footnote links of the Markdown(PHP Markdown Extra) text.
NewLinkify creates a new [goldmark.Extender] that allow you to parse text that seems like a URL.
NewLinkifyParser return a new InlineParser can parse text that seems like a URL.
NewStrikethroughHTMLRenderer returns a new StrikethroughHTMLRenderer.
NewStrikethroughParser return a new InlineParser that parses strikethrough expressions.
NewTable returns a new extension with given options.
NewTableASTTransformer returns a parser.ASTTransformer for tables.
NewTableConfig returns a new Config with defaults.
NewTableHTMLRenderer returns a new TableHTMLRenderer.
NewTableParagraphTransformer returns a new ParagraphTransformer that can transform paragraphs into tables.
NewTaskCheckBoxHTMLRenderer returns a new TaskCheckBoxHTMLRenderer.
NewTaskCheckBoxParser returns a new InlineParser that can parse checkboxes in list items. This parser must take precedence over the parser.LinkParser.
NewTypographer returns a new Extender that replaces punctuations with typographic entities.
NewTypographerParser return a new InlineParser that parses typographer expressions.
WithEastAsianLineBreaks is a functional option that indicates whether softline breaks between east asian wide characters should be ignored. style defauts to [EastAsianLineBreaksSimple] .
WithEscapedSpace is a functional option that indicates that a '\' escaped half-space(0x20) should not be rendered.
Type Parameters: T: []byte | string WithFootnoteBacklinkClass is a functional option that is a class for footnote backlinks.
Type Parameters: T: []byte | string WithFootnoteBacklinkHTML is an HTML content for footnote backlinks.
Type Parameters: T: []byte | string WithFootnoteBacklinkTitle is a functional option that is an optional title attribute for footnote backlinks.
WithFootnoteHTMLOptions is functional option that wraps goldmark HTMLRenderer options.
Type Parameters: T: []byte | string WithFootnoteIDPrefix is a functional option that is a prefix for the id attributes generated by footnotes.
WithFootnoteIDPrefixFunction is a functional option that is a prefix for the id attributes generated by footnotes.
Type Parameters: T: []byte | string WithFootnoteLinkClass is a functional option that is a class for footnote links.
Type Parameters: T: []byte | string WithFootnoteLinkTitle is a functional option that is an optional title attribute for footnote links.
Type Parameters: T: []byte | string WithLinkifyAllowedProtocols is a functional option that specify allowed protocols in autolinks. Each protocol must end with ':' like 'http:' .
WithLinkifyEmailRegexp is a functional otpion that specify a pattern of the email address.
WithLinkifyURLRegexp is a functional option that specify a pattern of the URL including a protocol.
WithLinkifyWWWRegexp is a functional option that specify a pattern of the URL without a protocol. This pattern must start with 'www.' .
WithTableCellAlignMethod is a functional option that indicates how are table cells aligned in HTML format.
WithTableHTMLOptions is functional option that wraps goldmark HTMLRenderer options.
Type Parameters: T: []byte | string WithTypographicSubstitutions is a functional otpion that specify replacement text for punctuations.
Package-Level Variables (total 18)
CJK is a goldmark extension that provides functionalities for CJK languages.
DefinitionDescriptionAttributeFilter defines attribute names which dd elements can have.
DefinitionList is an extension that allow you to use PHP Markdown Extra Definition lists.
DefinitionListAttributeFilter defines attribute names which dl elements can have.
DefinitionTermAttributeFilter defines attribute names which dd elements can have.
Footnote is an extension that allow you to use PHP Markdown Extra Footnotes.
GFM is an extension that provides Github Flavored markdown functionalities.
Linkify is an extension that allow you to parse text that seems like a URL.
Strikethrough is an extension that allow you to use strikethrough expression like '~~text~~' .
StrikethroughAttributeFilter defines attribute names which dd elements can have.
Table is an extension that allow you to use GFM tables .
TableAttributeFilter defines attribute names which table elements can have.
TableHeaderAttributeFilter defines attribute names which <thead> elements can have.
TableRowAttributeFilter defines attribute names which <tr> elements can have.
TableTdCellAttributeFilter defines attribute names which table <td> cells can have.
TableThCellAttributeFilter defines attribute names which table <th> cells can have.
TaskList is an extension that allow you to use GFM task lists.
Typographer is an extension that replaces punctuations with typographic entities.
Package-Level Constants (total 17)
Apostrophe is ' .
EastAsianLineBreaksCSS3Draft is a style where soft line breaks are ignored even if only one side of the break is an east asian wide character.
EastAsianLineBreaksNone renders line breaks as it is.
EastAsianLineBreaksSimple is a style where soft line breaks are ignored if both sides of the break are east asian wide characters.
Ellipsis is ... .
EmDash is --- .
EnDash is -- .
LeftAngleQuote is << .
LeftDoubleQuote is " .
LeftSingleQuote is ' .
RightAngleQuote is >> .
RightDoubleQuote is " .
RightSingleQuote is ' .
TableCellAlignAttribute renders alignments as an align attribute.
TableCellAlignDefault renders alignments by default method. With XHTML, alignments are rendered as an align attribute. With HTML5, alignments are rendered as a style attribute.
TableCellAlignNone does not care about alignments. If you using classes or other styles, you can add these attributes in an ASTTransformer.
TableCellAlignStyle renders alignments as a style attribute.