plain strings
Rest
...items: TItemsformatting elements
strings and elements in order
Creates bold text.
plain string or text with inline formatting
bold mark
Creates code block, without any syntax highlighting.
source as plain string (may be multiline)
code block
Creates code block with syntax highlighting.
programming language for syntax highlighting
source as plain string (may be multiline)
code block
Creates expandable details element, without custom summary text.
Not part of Markdown syntax, relies on support for HTML rendering.
plain string or text with inline or block formatting
details block
Creates expandable details element with custom summary text.
Not part of Markdown syntax, relies on support for HTML rendering.
plain string or text with inline formatting
plain string or text with inline or block formatting
details block
details('summary text always shown', 'text hidden until expanded')
details(
md`summary text with ${italic('inline')} formatting`,
md`text with ${bold('inline')} and ${list(['block'])} elements.`
)
MarkdownDocument.details method
Creates footnote label and registers content to be appended to document.
Footnotes allow you to add notes and references without cluttering the body of the document. When you create a footnote, a superscript number with a link appears where you added the footnote reference. Readers can click the link to jump to the content of the footnote at the bottom of the page.
plain string or text with inline formatting
Optional
label: stringcustom label for footnote link (default is auto-incremented number)
footnote mark
Creates heading.
heading level
plain string or text with inline formatting
heading block
Creates italic text.
plain string or text with inline formatting
italic mark
Creates link element.
link URL
Optional
text: InlineText<LinkInnerMarks>display text for link (defaults to URL)
Optional
title: stringtooltip when hovering over the link
link mark
Creates unordered list.
array of items, each of which may contain block or inline formatting
unordered list block
Creates unordered list.
type of list (may be ommitted since 'unordered'
is the default)
array of items, each of which may contain block or inline formatting
unordered list block
Creates ordered list.
type of list
array of items (without numbers), each of which may contain block or inline formatting
ordered list block
Creates task list (also known as checklist or todo list).
Part of extended Markdown syntax, not supported by all Markdown processors.
type of list
array of items, each of which is a tuple of checked state and text (plain or with formatting)
task list block
Creates paragraph.
plain string or text with inline or block formatting
paragraph block
Creates quote block.
plain string or text with inline or block formatting
quote block
Creates strikethrough text - rendered with horizontal line through the middle.
plain string or text with inline formatting
strikethrough mark
Creates table.
Part of extended Markdown syntax, not supported by all Markdown processors.
table header - column heading texts with optional column alignments
table body - rows with text content for column cells
table block
table(['x', 'y'], [['0', '0'], ['5', '20']])
table(
[
{ heading: 'Error', alignment: 'left' },
{ heading: link('./environments.md', 'Environment'), alignment: 'center' },
{ heading: 'Occurrences', alignment: 'right' },
],
[
[
code("TypeError: Cannot read properties of undefined (reading 'push')"),
'production',
'19',
],
[
code("TypeError: Cannot read properties of null (reading '0')"),
'staging',
'5',
],
]
)
Creates formatted markdown text, called using tagged template literal syntax.