Skip to content

MarkdownAPI

The markdown API provides utilities for creating markdown using js.

Constructors

new MarkdownAPI()

new MarkdownAPI(apiInstance): MarkdownAPI

Parameters

Parameter Type

apiInstance

API

Returns

MarkdownAPI

Defined in

jsEngine/api/MarkdownAPI.ts:24

Methods

create()

create(markdown): MarkdownString

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

Defined in

jsEngine/api/MarkdownAPI.ts:42


createBlockQuote()

createBlockQuote(): BlockQuoteElement

Creates a new markdown block quote element.

Returns

BlockQuoteElement

Defined in

jsEngine/api/MarkdownAPI.ts:140


createBoldText()

createBoldText(text): TextElement

Creates a new markdown text element with bold formatting.

Parameters

Parameter Type Description

text

string

Returns

TextElement

Defined in

jsEngine/api/MarkdownAPI.ts:64


createBuilder()

createBuilder(): MarkdownBuilder

Creates a markdown builder.

Returns

MarkdownBuilder

Defined in

jsEngine/api/MarkdownAPI.ts:31


createCallout()

createCallout(title, type, args): CalloutElement

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

Defined in

jsEngine/api/MarkdownAPI.ts:151


createCode()

createCode(text): CodeElement

Creates a new markdown code element.

Parameters

Parameter Type Description

text

string

Returns

CodeElement

Defined in

jsEngine/api/MarkdownAPI.ts:108


createCodeBlock()

createCodeBlock(language, content): CodeBlockElement

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

Defined in

jsEngine/api/MarkdownAPI.ts:177


createCollapsibleCallout()

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

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

Defined in

jsEngine/api/MarkdownAPI.ts:165


createCursiveText()

createCursiveText(text): TextElement

Creates a new markdown text element with cursive formatting.

Parameters

Parameter Type Description

text

string

Returns

TextElement

Defined in

jsEngine/api/MarkdownAPI.ts:75


createHeading()

createHeading(level, content): HeadingElement

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

Defined in

jsEngine/api/MarkdownAPI.ts:131


createHighlightedText()

createHighlightedText(text): TextElement

Creates a new markdown text element with highlighted formatting.

Parameters

Parameter Type Description

text

string

Returns

TextElement

Defined in

jsEngine/api/MarkdownAPI.ts:97


createList()

createList(ordered): ListElement

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

Defined in

jsEngine/api/MarkdownAPI.ts:200


createOrderedList()

createOrderedList(): ListElement

Creates a new ordered markdown list element.

Returns

ListElement

Defined in

jsEngine/api/MarkdownAPI.ts:209


createParagraph()

createParagraph(content): ParagraphElement

Creates a new markdown paragraph element.

Parameters

Parameter Type Description

content

string

Returns

ParagraphElement

Defined in

jsEngine/api/MarkdownAPI.ts:119


createTable()

createTable(header, body): TableElement

Creates a new markdown table element.

Parameters

Parameter Type Description

header

string[]

the header row

body

string[][]

the table body

Returns

TableElement

Defined in

jsEngine/api/MarkdownAPI.ts:189


createText()

createText(text): TextElement

Creates a new markdown text element.

Parameters

Parameter Type Description

text

string

Returns

TextElement

Defined in

jsEngine/api/MarkdownAPI.ts:53


createUnderlinedText()

createUnderlinedText(text): TextElement

Creates a new markdown text element with underline formatting.

Parameters

Parameter Type Description

text

string

Returns

TextElement

Defined in

jsEngine/api/MarkdownAPI.ts:86