Constructor#
new Marpit(optsopt)#
Create a Marpit instance.
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | <optional> | Properties
|
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.
- Object
markdown :MarkdownIt#
- MarkdownIt
(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.
- Object
themeSet :ThemeSet#
Methods#
render(markdown, envopt) → {Marpit~RenderResult}#
Render Markdown into HTML and CSS string.
| Name | Type | Attributes | Default | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
markdown | string | A Markdown string. | ||||||||||||
env | Object | <optional> | {} | Environment object for passing to markdown-it. Properties
|
An object of rendering result.
- Type:
- Marpit~RenderResult
use(plugin, …params) → {Marpit}#
Load plugin either markdown-it or PostCSS into the current Marpit instance.
| Name | Type | Attributes | Description |
|---|---|---|---|
plugin | function | A markdown-it plugin or PostCSS plugin. | |
params | * | <repeatable> | Params to pass into markdown-it plugin. (Not used in PostCSS plugin) |
Type Definitions#
AnchorCallback(index) → {string}#
Convert slide page index into anchor string.
| Name | Type | Description |
|---|---|---|
index | number | Slide page index, beginning from zero. |
The text of anchor for id attribute, without prefix #.
- Type:
- string
InlineSVGOptions#
- Object
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
enabled | boolean | <optional> | true | Whether inline SVG mode is enabled. |
backdropSelector | boolean | <optional> | true | Whether |
RenderResult#
- Object
| Name | Type | Description |
|---|---|---|
html | string | | Rendered HTML. |
css | string | Rendered CSS. |
comments | Array.<Array.<string>> | Parsed HTML comments per slide pages, excepted YAML for directives. It would be useful for presenter notes. |