Skip to main content


Server-side GitHub Flavored Markdown rendering for Deno, including GitHub style CSS, syntax highlighting, and HTML sanitization.


import { CSS, render } from "";

const markdown = `
# Hello, world!

| Type | Value |
| ---- | ----- |
| x    | 42    |

console.log("Hello, world!");
const rootUrl = "";

const body = render(markdown, rootUrl);

const html = `
<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
      main {
        max-width: 800px;
        margin: 0 auto;
    <main data-color-mode="light" data-light-theme="light" data-dark-theme="dark" class="markdown-body">


The GitHub CSS styles ( are used. There are two themes available: light and dark.

There are three data attributes that can be used to control the theme:

  • data-color-mode: light or dark or auto.
  • data-light-theme: the name of the light theme (light or dark).
  • data-dark-theme: the name of the dark theme (light or dark).

For example, if you want to use the dark theme only, set the following:

<div data-color-mode="dark" data-dark-theme="dark" class="markdown-body">
  ... markdown body here ...

If you want to use the light or dark theme depending on the user’s browser preference, set the following:

<div data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" class="markdown-body">
  ... markdown body here ...

Also see the example application in the example/ directory.


By default syntax highlighting for JavaScript, Markdown, and HTML is included. You can include more languages importing them:

import { CSS, render } from "";

// Add support for TypeScript, Bash, and Rust.
import "";
import "";
import "";

A full list of supported languages is available here: