Module: lib/elements

Methods

(static) markdownElements(markdown, optionsopt, nullable) → {*}

Generate an element model from a Markdown model.

Parameters:
Name Type Attributes Description
markdown Object

The Markdown model

options object <optional>
<nullable>

The options object

Source:
Returns:

The Markdown's element model

Type
*

(static) markdownElementsAsync(markdown, optionsopt, nullable) → {*}

Generate an element model from a Markdown model.

This is the asynchronous form of the markdownElements function. Use this form of the function if you have one or more asynchronous code block functions.

Parameters:
Name Type Attributes Description
markdown Object

The Markdown model

options object <optional>
<nullable>

The options object

Source:
Returns:

The Markdown's element model

Type
*

(static) markdownHeaderId(text) → {string}

Generate a Markdown header ID from text

Parameters:
Name Type Description
text string

The text

Source:
Returns:
Type
string

Type Definitions

CodeBlock

Type:
  • Object
Properties:
Name Type Attributes Description
language string

The code block language

lines Array.<string>

The code blocks lines

startLineNumber number <optional>

The code blocks lines

Source:

CodeBlockFn(codeBlock) → {*}

A code block render function

Parameters:
Name Type Description
codeBlock object

The code block model

Source:
Returns:

The code block's element model

Type
*

MarkdownElementsOptions

The markdownElements function's options object

Type:
  • Object
Properties:
Name Type Attributes Description
codeBlocks Object.<string, object> <optional>

The code block render-function map

urlFn function <optional>

The URL modifier function

headerIds boolean <optional>

If true, generate header IDs

usedHeaderIds Set <optional>

Set of used header IDs

Source:

URLFn(url) → {string}

A URL modifier function

Parameters:
Name Type Description
url string

The URL

Source:
Returns:

The modified URL

Type
string