Documentation
¶
Overview ¶
Package goldmark implements functions to convert markdown text to a desired format.
Index ¶
- func Convert(source []byte, w io.Writer, opts ...parser.ParseOption) error
- func DefaultParser() parser.Parser
- func DefaultRenderer() renderer.Renderer
- func DoTestCaseFile(m Markdown, filename string, t *testing.T)
- func DoTestCases(m Markdown, cases []MarkdownTestCase, t *testing.T)
- type Extender
- type Markdown
- type MarkdownTestCase
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert interprets a UTF-8 bytes source in Markdown and write rendered contents to a writer w.
func DefaultParser ¶
DefaultParser returns a new Parser that is configured by default values.
func DefaultRenderer ¶
DefaultRenderer returns a new Renderer that is configured by default values.
func DoTestCaseFile ¶ added in v1.0.5
func DoTestCases ¶ added in v1.0.5
func DoTestCases(m Markdown, cases []MarkdownTestCase, t *testing.T)
Types ¶
type Extender ¶
type Extender interface {
// Extend extends the Markdown.
Extend(Markdown)
}
An Extender interface is used for extending Markdown.
type Markdown ¶
type Markdown interface {
// Convert interprets a UTF-8 bytes source in Markdown and write rendered
// contents to a writer w.
Convert(source []byte, writer io.Writer, opts ...parser.ParseOption) error
// Parser returns a Parser that will be used for conversion.
Parser() parser.Parser
// SetParser sets a Parser to this object.
SetParser(parser.Parser)
// Parser returns a Renderer that will be used for conversion.
Renderer() renderer.Renderer
// SetRenderer sets a Renderer to this object.
SetRenderer(renderer.Renderer)
}
A Markdown interface offers functions to convert Markdown text to a desired format.
type MarkdownTestCase ¶ added in v1.0.5
type Option ¶
type Option func(*markdown)
Option is a functional option type for Markdown objects.
func WithParser ¶
WithParser allows you to override the default parser.
func WithParserOptions ¶
WithParserOptions applies options for the parser.
func WithRenderer ¶
WithRenderer allows you to override the default renderer.
func WithRendererOptions ¶
WithRendererOptions applies options for the renderer.
Directories
¶
| Path | Synopsis |
|---|---|
|
_benchmark
|
|
|
cmark
command
|
|
|
Package ast defines AST nodes that represent markdown elements.
|
Package ast defines AST nodes that represent markdown elements. |
|
ast
Package ast defines AST nodes that represents extension's elements
|
Package ast defines AST nodes that represents extension's elements |
|
Package parser contains stuff that are related to parsing a Markdown text.
|
Package parser contains stuff that are related to parsing a Markdown text. |
|
Package renderer renders the given AST to certain formats.
|
Package renderer renders the given AST to certain formats. |
|
Package util provides utility functions for the goldmark.
|
Package util provides utility functions for the goldmark. |