Constructor
new Marpit(optsopt)
Create a Marpit instance.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object
|
<optional> |
|
Members
(readonly) customDirectives :Object
Definitions of the custom directive.
It has the assignable global
and local
object. They have consisted of
the directive name as a key, and parser function as a value. The parser
should return the validated object for updating meta of markdown-it
token.
Type:
-
Object
(readonly) options :Object
The current options for this instance.
This property is read-only and marked as immutable. You cannot change the value of options after creating instance.
Type:
-
Object
Methods
render(markdown, envopt) → {Marpit~RenderResult}
Render Markdown into HTML and CSS string.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
markdown |
string
|
A Markdown string. |
||||||||||||
env |
Object
|
<optional> |
{} |
Environment object for passing to markdown-it.
|
use(plugin, …params) → {Marpit}
Load the specified markdown-it plugin with given parameters.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
plugin |
function
|
markdown-it plugin. |
|
params |
*
|
<repeatable> |
Params to pass into plugin. |
Type Definitions
InlineSVGOptions
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
enabled |
boolean
|
<optional> |
true | Whether inline SVG mode is enabled. |
backdropSelector |
boolean
|
<optional> |
true | Whether |
Type:
-
Object