Skip to content

MarkdownBuilder

Allows for easily building markdown using JavaScript.

Extends

  • AbstractMarkdownElementContainer

Constructors

new MarkdownBuilder()

new MarkdownBuilder(): MarkdownBuilder

Returns

MarkdownBuilder

Overrides

AbstractMarkdownElementContainer.constructor

Defined in

jsEngine/api/markdown/MarkdownBuilder.ts:8

Properties

markdownElements

markdownElements: AbstractMarkdownElement[]

Inherited from

AbstractMarkdownElementContainer.markdownElements

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:9

Methods

addBoldText()

addBoldText(text): AbstractMarkdownElementContainer

Parameters

Parameter Type

text

string

Returns

AbstractMarkdownElementContainer

Inherited from

AbstractMarkdownElementContainer.addBoldText

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:46


addCode()

addCode(text): AbstractMarkdownElementContainer

Parameters

Parameter Type

text

string

Returns

AbstractMarkdownElementContainer

Inherited from

AbstractMarkdownElementContainer.addCode

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:64


addCursiveText()

addCursiveText(text): AbstractMarkdownElementContainer

Parameters

Parameter Type

text

string

Returns

AbstractMarkdownElementContainer

Inherited from

AbstractMarkdownElementContainer.addCursiveText

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:52


addElement()

addElement(element): void

Adds a child element to the container.

Parameters

Parameter Type Description

element

AbstractMarkdownElement

Returns

void

Throws

Error if the element is not allowed in the container.

Inherited from

AbstractMarkdownElementContainer.addElement

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:32


addText()

addText(text): AbstractMarkdownElementContainer

Parameters

Parameter Type

text

string

Returns

AbstractMarkdownElementContainer

Inherited from

AbstractMarkdownElementContainer.addText

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:40


addUnderlinedText()

addUnderlinedText(text): AbstractMarkdownElementContainer

Parameters

Parameter Type

text

string

Returns

AbstractMarkdownElementContainer

Inherited from

AbstractMarkdownElementContainer.addUnderlinedText

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:58


createBlockQuote()

createBlockQuote(): BlockQuoteElement

Returns

BlockQuoteElement

Inherited from

AbstractMarkdownElementContainer.createBlockQuote

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:82


createCallout()

createCallout(title, type, args): CalloutElement

Parameters

Parameter Type Default value

title

string

undefined

type

string

undefined

args

string

''

Returns

CalloutElement

Inherited from

AbstractMarkdownElementContainer.createCallout

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:88


createCodeBlock()

createCodeBlock(language, content): CodeBlockElement

Parameters

Parameter Type

language

string

content

string

Returns

CodeBlockElement

Inherited from

AbstractMarkdownElementContainer.createCodeBlock

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:100


createCollapsibleCallout()

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

Parameters

Parameter Type Default value

title

string

undefined

type

string

undefined

args

string

''

collapsed

boolean

false

Returns

CalloutElement

Inherited from

AbstractMarkdownElementContainer.createCollapsibleCallout

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:94


createHeading()

createHeading(level, content): HeadingElement

Parameters

Parameter Type

level

number

content

string

Returns

HeadingElement

Inherited from

AbstractMarkdownElementContainer.createHeading

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:76


createList()

createList(ordered): ListElement

Parameters

Parameter Type

ordered

boolean

Returns

ListElement

Inherited from

AbstractMarkdownElementContainer.createList

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:112


createParagraph()

createParagraph(content): ParagraphElement

Parameters

Parameter Type

content

string

Returns

ParagraphElement

Inherited from

AbstractMarkdownElementContainer.createParagraph

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:70


createTable()

createTable(header, body): TableElement

Parameters

Parameter Type

header

string[]

body

string[][]

Returns

TableElement

Inherited from

AbstractMarkdownElementContainer.createTable

Defined in

jsEngine/api/markdown/AbstractMarkdownElementContainer.ts:106


toMarkdown()

toMarkdown(): MarkdownString

Converts the element to a MarkdownString.

Returns

MarkdownString

Inherited from

AbstractMarkdownElementContainer.toMarkdown

Defined in

jsEngine/api/markdown/AbstractMarkdownElement.ts:21


toString()

toString(): string

Converts the element to a string.

Returns

string

Overrides

AbstractMarkdownElementContainer.toString

Defined in

jsEngine/api/markdown/MarkdownBuilder.ts:12