mirror of
https://github.com/status-im/markdown.git
synced 2025-02-23 16:48:14 +00:00
[SQUASH] Doc update
This commit is contained in:
parent
3cc9341a19
commit
a47518da29
14
doc.go
14
doc.go
@ -4,14 +4,14 @@
|
|||||||
// then be further processed to HTML (provided by Blackfriday itself) or other
|
// then be further processed to HTML (provided by Blackfriday itself) or other
|
||||||
// formats (provided by the community).
|
// formats (provided by the community).
|
||||||
//
|
//
|
||||||
// The simplest way to invoke Blackfriday is to call one of Markdown*
|
// The simplest way to invoke Blackfriday is to call the Markdown function. It
|
||||||
// functions. It will take a text input and produce a text output in HTML (or
|
// will take a text input and produce a text output in HTML (or other format).
|
||||||
// other format).
|
|
||||||
//
|
//
|
||||||
// A slightly more sophisticated way to use Blackfriday is to call Parse, which
|
// A slightly more sophisticated way to use Blackfriday is to create a Processor
|
||||||
// returns a syntax tree for the input document. You can use that to write your
|
// and to call Parse, which returns a syntax tree for the input document. You
|
||||||
// own renderer or, for example, to leverage Blackfriday's parsing for content
|
// can leverage Blackfriday's parsing for content extraction from markdown
|
||||||
// extraction from markdown documents.
|
// documents. You can assign a custom renderer and set various options to the
|
||||||
|
// Processor.
|
||||||
//
|
//
|
||||||
// If you're interested in calling Blackfriday from command line, see
|
// If you're interested in calling Blackfriday from command line, see
|
||||||
// https://github.com/russross/blackfriday-tool.
|
// https://github.com/russross/blackfriday-tool.
|
||||||
|
@ -156,8 +156,9 @@ type Renderer interface {
|
|||||||
// for each character that triggers a response when parsing inline data.
|
// for each character that triggers a response when parsing inline data.
|
||||||
type inlineParser func(p *Processor, data []byte, offset int) (int, *Node)
|
type inlineParser func(p *Processor, data []byte, offset int) (int, *Node)
|
||||||
|
|
||||||
// Processor holds runtime state used by the parser.
|
// Processor holds:
|
||||||
// This is constructed by the Markdown function.
|
// - extensions and the runtime state used by Parse,
|
||||||
|
// - the renderer.
|
||||||
type Processor struct {
|
type Processor struct {
|
||||||
renderer Renderer
|
renderer Renderer
|
||||||
referenceOverride ReferenceOverrideFunc
|
referenceOverride ReferenceOverrideFunc
|
||||||
@ -254,8 +255,8 @@ type Reference struct {
|
|||||||
// See the documentation in Options for more details on use-case.
|
// See the documentation in Options for more details on use-case.
|
||||||
type ReferenceOverrideFunc func(reference string) (ref *Reference, overridden bool)
|
type ReferenceOverrideFunc func(reference string) (ref *Reference, overridden bool)
|
||||||
|
|
||||||
// NewProcessor constructs a Parser. You can use the same With* functions as for
|
// NewProcessor constructs a Processor. You can use the same With* functions as
|
||||||
// Markdown() to customize parser's behavior.
|
// for Markdown() to customize parser's behavior.
|
||||||
func NewProcessor(opts ...Option) *Processor {
|
func NewProcessor(opts ...Option) *Processor {
|
||||||
var p Processor
|
var p Processor
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user