Skip to content

MarkdownAPI

Defined in: jsEngine/api/MarkdownAPI.ts:21

The markdown API provides utilities for creating markdown using js.

Constructors

new MarkdownAPI()

new MarkdownAPI(apiInstance): MarkdownAPI

Defined in: jsEngine/api/MarkdownAPI.ts:24

Parameters

Parameter Type

apiInstance

API

Returns

MarkdownAPI

Methods

create()

create(markdown): MarkdownString

Defined in: jsEngine/api/MarkdownAPI.ts:42

Creates a markdown string form a normal string. This does not modify the string. It only wraps it in an object, so that the plugin can recognize and render it as markdown.

Parameters

Parameter Type Description

markdown

string

the string to wrap

Returns

MarkdownString


createBlockQuote()

createBlockQuote(): BlockQuoteElement

Defined in: jsEngine/api/MarkdownAPI.ts:140

Creates a new markdown block quote element.

Returns

BlockQuoteElement


createBoldText()

createBoldText(text): TextElement

Defined in: jsEngine/api/MarkdownAPI.ts:64

Creates a new markdown text element with bold formatting.

Parameters

Parameter Type Description

text

string

Returns

TextElement


createBuilder()

createBuilder(): MarkdownBuilder

Defined in: jsEngine/api/MarkdownAPI.ts:31

Creates a markdown builder.

Returns

MarkdownBuilder


createCallout()

createCallout(title, type, args): CalloutElement

Defined in: jsEngine/api/MarkdownAPI.ts:151

Creates a new markdown callout element.

Parameters

Parameter Type Default value Description

title

string

undefined

the title of the callout

type

string

undefined

the type of the callout

args

string

''

the callout args, optional

Returns

CalloutElement


createCode()

createCode(text): CodeElement

Defined in: jsEngine/api/MarkdownAPI.ts:108

Creates a new markdown code element.

Parameters

Parameter Type Description

text

string

Returns

CodeElement


createCodeBlock()

createCodeBlock(language, content): CodeBlockElement

Defined in: jsEngine/api/MarkdownAPI.ts:177

Creates a new markdown code block element.

Parameters

Parameter Type Description

language

string

the language of the code block

content

string

the content of the code block

Returns

CodeBlockElement


createCollapsibleCallout()

createCollapsibleCallout(title, type, args, collapsed): CalloutElement

Defined in: jsEngine/api/MarkdownAPI.ts:165

Creates a new markdown collapsible callout element.

Parameters

Parameter Type Default value Description

title

string

undefined

the title of the callout

type

string

undefined

the type of the callout

args

string

''

the callout args, optional

collapsed

boolean

false

whether the callout should be collapsed by default, optional

Returns

CalloutElement


createCursiveText()

createCursiveText(text): TextElement

Defined in: jsEngine/api/MarkdownAPI.ts:75

Creates a new markdown text element with cursive formatting.

Parameters

Parameter Type Description

text

string

Returns

TextElement


createHeading()

createHeading(level, content): HeadingElement

Defined in: jsEngine/api/MarkdownAPI.ts:131

Creates a new markdown heading element.

Parameters

Parameter Type Description

level

number

the level of the heading from 1 to 6

content

string

the text of the heading

Returns

HeadingElement


createHighlightedText()

createHighlightedText(text): TextElement

Defined in: jsEngine/api/MarkdownAPI.ts:97

Creates a new markdown text element with highlighted formatting.

Parameters

Parameter Type Description

text

string

Returns

TextElement


createList()

createList(ordered): ListElement

Defined in: jsEngine/api/MarkdownAPI.ts:200

Creates a new markdown list element.

Parameters

Parameter Type Default value Description

ordered

boolean

false

whether the list should be ordered or not (use 1. or -), defaults to unordered

Returns

ListElement


createOrderedList()

createOrderedList(): ListElement

Defined in: jsEngine/api/MarkdownAPI.ts:209

Creates a new ordered markdown list element.

Returns

ListElement


createParagraph()

createParagraph(content): ParagraphElement

Defined in: jsEngine/api/MarkdownAPI.ts:119

Creates a new markdown paragraph element.

Parameters

Parameter Type Description

content

string

Returns

ParagraphElement


createTable()

createTable(header, body): TableElement

Defined in: jsEngine/api/MarkdownAPI.ts:189

Creates a new markdown table element.

Parameters

Parameter Type Description

header

string[]

the header row

body

string[][]

the table body

Returns

TableElement


createText()

createText(text): TextElement

Defined in: jsEngine/api/MarkdownAPI.ts:53

Creates a new markdown text element.

Parameters

Parameter Type Description

text

string

Returns

TextElement


createUnderlinedText()

createUnderlinedText(text): TextElement

Defined in: jsEngine/api/MarkdownAPI.ts:86

Creates a new markdown text element with underline formatting.

Parameters

Parameter Type Description

text

string

Returns

TextElement