Function Updated 20 May 2026
markdown(text)
Converts Markdown-formatted text to HTML.
Parameters
textstringrequiredThe Markdown-formatted text to convert to HTML.
Returns
String containing the HTML representation of the input Markdown.
Example
Mixed HTML (or any text file) with inline JavaScript between hash signs.
#{
// Convert Markdown to HTML
let md = "# Hello World\n\nThis is **bold** and *italic*.\n\n- Item 1\n- Item 2\n- Item 3";
let html = docly.markdown(md);
write(html);
}#The template above produces this output:
<h1 id="hello-world">Hello World</h1>
<p>This is <strong>bold</strong> and <em>italic</em>.</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>