Evals / documents / Convert between formats
Markdown to a web page
Turn commonmark.md into a complete standalone HTML page called index.html.
The task
The reference answer shows the job can be done with deft. It is not an agent run.
deft md to-html commonmark.md -o index.html
Input
CommonMark
==========
CommonMark is a rationalized version of Markdown syntax,
with a [spec][the spec] and BSD-licensed reference
implementations in C and JavaScript.
[Try it now!](https://spec.commonmark.org/dingus/)
[the spec]: https://spec.commonmark.org/
For more details, see <https://commonmark.org>.
This repository contains the spec itself, along with tools for
running tests against the spec, and for creating HTML and PDF versions
of the spec.
The reference implementations live in separate repositories:
- <https://github.com/commonmark/cmark> (C)
- <https://github.com/commonmark/commonmark.js> (JavaScript)
There is a list of third-party libraries
in a dozen different languages
[here](https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations).
Running tests against the spec
------------------------------
[The spec] contains over 500 embedded examples which serve as conformance
tests. To run the tests using an executable `$PROG`:
python3 test/spec_tests.py --program $PROG
If you want to extract the raw test data from the spec without
actually running the tests, you can do:
python3 test/spec_tests.py --dump-tests
and you'll get all the tests in JSON format.
JavaScript developers may find it more convenient to use the
[`commonmark-spec` npm package], which is published from this
repository. It exports an array `tests` of JSON objects with
the format
```json
{
"markdown": "Foo\nBar\n---\n",
"html": "<h2>Foo\nBar</h2>\n",
"section": "Setext headings",
"number": 65
}
```
[`commonmark-spec` npm package]: https://www.npmjs.com/package/commonmark-spec
The spec
--------
The source of [the spec] is `spec.txt`. This is basically a Markdown
file, with code examples written in a shorthand form:
```````````````````````````````` example
Markdown source
.
expected HTML output
````````````````````````````````
To build an HTML version of the spec, do `make spec.html`. To build a
PDF version, do `make spec.pdf`. For both versions, you must
have the lua rock `lcmark` installed: after installing lua and
lua rocks, `luarocks install lcmark`. For the PDF you must also
have xelatex installed.
The spec is written from the point of view of the human writer, not
the computer reader. It is not an algorithm---an English translation of
a computer program---but a declarative description of what counts as a block
quote, a code block, and each of the other structural elements that can
make up a Markdown document.
Because John Gruber's [canonical syntax
description](https://daringfireball.net/projects/markdown/syntax) leaves
many aspects of the syntax undetermined, writing a precise spec requires
making a large number of decisions, many of them somewhat arbitrary.
In making them, we have appealed to existing conventions and
considerations of simplicity, readability, expressive power, and
consistency. We have tried to ensure that "normal" documents in the many
incompatible existing imple
… 4664 more charactersReference output
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>CommonMark</title>
<style>body{max-width:46rem;margin:2rem auto;padding:0 1rem;font:16px/1.6 -apple-system,'Segoe UI',Roboto,'PingFang SC','Noto Sans CJK SC',sans-serif;color:#1f2328}pre{background:#f6f8fa;padding:.8rem;overflow:auto;border-radius:6px}code{font:.9em ui-monospace,Menlo,Consolas,monospace}table{border-collapse:collapse}th,td{border:1px solid #d0d7de;padding:.3rem .6rem}blockquote{margin:0;padding:0 1rem;color:#59636e;border-left:.25rem solid #d0d7de}img{max-width:100%}</style>
</head>
<body>
<h1>CommonMark</h1>
<p>CommonMark is a rationalized version of Markdown syntax,
with a <a href="https://spec.commonmark.org/">spec</a> and BSD-licensed reference
implementations in C and JavaScript.</p>
<p><a href="https://spec.commonmark.org/dingus/">Try it now!</a></p>
<p>For more details, see <a href="https://commonmark.org">https://commonmark.org</a>.</p>
<p>This repository contains the spec itself, along with tools for
running tests against the spec, and for creating HTML and PDF versions
of the spec.</p>
<p>The reference implementations live in separate repositories:</p>
<ul>
<li><a href="https://github.com/commonmark/cmark">https://github.com/commonmark/cmark</a> (C)</li>
<li><a href="https://github.com/commonmark/commonmark.js">https://github.com/commonmark/commonmark.js</a> (JavaScript)</li>
</ul>
<p>There is a list of third-party libraries
in a dozen different languages
<a href="https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations">here</a>.</p>
<h2>Running tests against the spec</h2>
<p><a href="https://spec.commonmark.org/">The spec</a> contains over 500 embedded examples which serve as conformance
tests. To run the tests using an executable <code>$PROG</code>:</p>
<pre><code>python3 test/spec_tests.py --program $PROG
</code></pre>
<p>If you want to extract the raw test data from the spec without
actually running the tests, you can do:</p>
<pre><code>python3 test/spec_tests.py --dump-tests
</code></pre>
<p>and you'll get all the tests in JSON format.</p>
<p>JavaScript developers may find it more convenient to use the
<a href="https://www.npmjs.com/package/commonmark-spec"><code>commonmark-spec</code> npm package</a>, which is published from this
repository. It exports an array <code>tests</code> of JSON objects with
the format</p>
<pre><code class="language-json">{
"markdown": "Foo\nBar\n---\n",
"html": "<h2>Foo\nBar</h2>\n",
"section": "Setext headings",
"number": 65
}
</code></pre>
<h2>The spec</h2>
<p>The source of <a href="https://spec.commonmark.org/">the spec</a> is <code>spec.txt</code>. This is basically a Markdown
file, with code examples written in a shorthand form:</p>
<pre><code>```````````````````````````````` example
Markdown source
.
expected HTML output
````````````````````````````````
</code></pre>
<p>To build an HTML version of the spec, do
… 5948 more charactersHow a result is judged (1 check)
- text: file = "index.html", contains = ["<html", "<h1", "CommonMark"]
Runs
CodexWithout deftPassed2026-11-07
- Time
- 98s
- New tokens
- 14.9k
- Total input
- 61.9k
- Output tokens
- 5.1k
- Commands
- 2
- Failed
- 0
Trace
I’ll read `commonmark.md` and any local project instructions, then create a self-contained `index.html` in the current directory.
pwd && rg --files -g 'commonmark.md' -g 'AGENTS.md' -g 'index.html' -g '"'!node_modules'"' -g '"'!vendor'"'output
commonmark.md
cat commonmark.mdoutput
CommonMark ========== CommonMark is a rationalized version of Markdown syntax, with a [spec][the spec] and BSD-licensed reference implementations in C and JavaScript. [Try it now!](https://spec.commonmark.org/dingus/) [the spec]: https://spec.commonmark.org/ For more details, see <https://commonmark.org>. This repository contains the spec itself, along with tools for running tests against the spec, and for creating HTML and PDF versions of the spec. The reference implementations live in separate repositories: - <https://github.com/commonmark/cmark> (C) - <https://github.com/commonmark/commonmark.js> (JavaScript) There is a list of third-party libraries in a dozen different languages [here](https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations). Running tests against the spec ------------------------------ [The spec] contains over 500 embedded examples which serve as conformance tests. To run the tests using an executable `$PROG`: python3 test/spec_tests.py --program $PROG If you want to extract the raw test data from the spec without actually running the tests, you can do: python3 test/spec_tests.py --dump-tests and you'll get all the tests in JSON format. JavaScript developers may find it more convenient to use the [`commonmark-spec` npm package], which is published from this repository. It exports an array `tests` of JSON objects with the format ```json { "markdown": "Foo\nBar\n---\n", "html": "<h2>Foo\nBar</h2>\n", … 6163 more charactersThe file is a project overview rather than the full specification. I’m preserving its sections and links in a standalone page, with the examples marked up as code and the CommonMark terms presented clearly.
Edited index.html
Created [index.html](index.html) as a standalone, responsive page with the Markdown content, navigation, styling, and links.
Output
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="An overview of CommonMark, its specification, reference implementations, conformance tests, and history.">
<title>CommonMark — a Markdown specification</title>
<style>
:root {
color-scheme: light;
--ink: #17251f;
--muted: #607068;
--paper: #fbfaf7;
--panel: #fff;
--line: #e3e8e2;
--green: #176b4b;
--green-dark: #104a35;
--green-soft: #e9f3ec;
--code: #f1f4ef;
--shadow: 0 18px 55px rgb(23 37 31 / 7%);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
margin: 0;
background: var(--paper);
color: var(--ink);
font: 16px/1.72 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
-webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }
a:focus-visible { outline: 3px solid #89b99e; outline-offset: 3px; border-radius: 3px; }
.topbar { height: 66px; border-bottom: 1px solid var(--line); background: rgb(251 250 247 / 92%); }
.topbar-inner { max-width: 1160px; height: 100%; margin: auto; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -.03em; }
.brand-mark { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--green); font: 700 15px/1 ui-monospace, monospace; }
.top-link { color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.hero { background: radial-gradient(ellipse at 80% 15%, #e0efe4 0, transparent 38%), linear-gradient(135deg, #f4f7f1, #fbfaf7 72%); border-bottom: 1px solid var(--line); }
.hero-inner { max-width: 1160px; margin: auto; padding: 76px 28px 70px; }
.eyebrow { margin: 0 0 16px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 780px; margin: 0; font: 650 clamp(42px, 7vw, 76px)/1.04 ui-serif, Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
.hero-copy { max-width: 670px; margin: 22px 0 0; color: #4b5d53; font-size: 19px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; min-height: 46px; align-items: center; gap: 9px; padding: 0 17px; border: 1px solid var(--green); border-radius: 7px; background: var(--green); color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); background: var(--green-dark); co
… 12645 more charactersCodexWith deft, skill installedPassedRead the skillUsed deft2026-11-07
- Time
- 17s
- New tokens
- 7.4k
- Total input
- 77.1k
- Output tokens
- 0.6k
- Commands
- 4
- Failed
- 0
Trace
I’ll read the Markdown conversion guidance and the source file, then create `index.html` in the current directory.
cat .agents/skills/deft/SKILL.md && printf '\\n---FILES---\\n' && rg --files -g 'commonmark.md' -g 'AGENTS.md' -g 'package.json' -g '*.css' -g '*.html'output
--- name: deft description: "Use deft instead of writing a script for file jobs: PDF merge/split/compress/watermark, image resize/convert/compress, video and audio trim/convert/compress, spreadsheets, Markdown to PDF/HTML, and YouTube downloads and subtitles." --- # deft One local command for file jobs. Prefer it over writing Python or shell scripts. Syntax: `deft <group> <command> [inputs] [-o output] [--options]` Groups: - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert - `image`: Resize, crop, convert, compress, filters, montage, OCR - `video`: Trim, crop, speed, convert, compress, GIF, frames (ffmpeg) - `audio`: Convert, trim, merge, fade, speed, tag, normalize (ffmpeg) - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace - `slides`: PowerPoint: extract text, Markdown outline, PDF handout - `data`: JSON/YAML/TOML/XML: convert, query with jq syntax, merge, diff - `sheet`: Excel/CSV/ODS tables: filter, sort, join, pivot, convert - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents - `html`: HTML to Markdown, text, Word, PDF; screenshots - `epub`: E-books: info, to text, Markdown and PDF - `email`: EML files: headers, text, attachments - `contact`: VCF address books: to and from CSV - `calendar`: ICS calendars: to and from CSV - `gps`: GPX and KML tracks: convert, distance and time - `youtube`: Info, download, audio, subtitles, thumbnail (yt-dlp) - `file`: Any file: hash, duplicates, batch rename, base64, encoding - `qr`: Cre … 755 more characters
deft md --help && printf '\\n---SOURCE---\\n' && cat commonmark.mdoutput
deft md - commands (input -> output) from-docx doc -> md Convert to Markdown, keeping headings, lists and tables from-html html -> md Convert to Markdown; scripts and styles are dropped from-pdf pdf -> md Text as Markdown paragraphs [beta] to-docx md -> docx Write a Word document with headings, lists, tables, images to-epub md... -> epub Make an e-book; each top-level heading starts a chapter to-html md -> html Render to a styled HTML page, or --fragment to-pdf md -> pdf Typeset Markdown as PDF to-pptx md -> pptx Make a deck: each heading or --- starts a slide [beta] toc md -> md Insert a table of contents from the headings More: deft md <command> --help ---SOURCE--- CommonMark ========== CommonMark is a rationalized version of Markdown syntax, with a [spec][the spec] and BSD-licensed reference implementations in C and JavaScript. [Try it now!](https://spec.commonmark.org/dingus/) [the spec]: https://spec.commonmark.org/ For more details, see <https://commonmark.org>. This repository contains the spec itself, along with tools for running tests against the spec, and for creating HTML and PDF versions of the spec. The reference implementations live in separate repositories: - <https://github.com/commonmark/cmark> (C) - <https://github.com/commonmark/commonmark.js> (JavaScript) There is a list of third-party libraries in a dozen different languages [here](https://github.com/commonmark/Co … 6923 more characters
The source is a CommonMark project overview. I’m using `deft`’s Markdown-to-HTML converter to produce a standalone styled page.
deft md to-html --helpoutput
deft md to-html - Render to a styled HTML page, or --fragment Same as: deft convert Usage: deft md to-html <md>... [-o <html|dir>] [options] In: md (each handled separately) Out: html (default <name>.<ext>) Options: --fragment Body only, no <html> page --title <text> Page title (default: first heading) Common: -o --force --dry-run --json -j (deft help common) Examples: deft md to-html notes.md -o notes.html deft md to-html notes.md --fragment -o -
deft md to-html commonmark.md --title "CommonMark" -o index.html && ls -l index.html && head -c 1000 index.htmloutput
ok md.to-html commonmark.md -> index.html 9KB 0.00s -rw-r--r--@ 1 user staff 8955 Nov 6 17:14 index.html <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>CommonMark</title> <style>body{max-width:46rem;margin:2rem auto;padding:0 1rem;font:16px/1.6 -apple-system,'Segoe UI',Roboto,'PingFang SC','Noto Sans CJK SC',sans-serif;color:#1f2328}pre{background:#f6f8fa;padding:.8rem;overflow:auto;border-radius:6px}code{font:.9em ui-monospace,Menlo,Consolas,monospace}table{border-collapse:collapse}th,td{border:1px solid #d0d7de;padding:.3rem .6rem}blockquote{margin:0;padding:0 1rem;color:#59636e;border-left:.25rem solid #d0d7de}img{max-width:100%}</style> </head> <body> <h1>CommonMark</h1> <p>CommonMark is a rationalized version of Markdown syntax, with a <a href="https://spec.commonmark.org/">spec</a> and BSD-licensed reference implementations in C and JavaScript.</p> <p><a href="https://spec.commonmark.org/dingus/">Try it now!</a></p> <p>For more details, see <a href="https://commonmark.org">https://commonmark.org</a>.</pCreated [index.html](index.html) as a standalone HTML page with the Markdown content and embedded styles.
Output
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>CommonMark</title>
<style>body{max-width:46rem;margin:2rem auto;padding:0 1rem;font:16px/1.6 -apple-system,'Segoe UI',Roboto,'PingFang SC','Noto Sans CJK SC',sans-serif;color:#1f2328}pre{background:#f6f8fa;padding:.8rem;overflow:auto;border-radius:6px}code{font:.9em ui-monospace,Menlo,Consolas,monospace}table{border-collapse:collapse}th,td{border:1px solid #d0d7de;padding:.3rem .6rem}blockquote{margin:0;padding:0 1rem;color:#59636e;border-left:.25rem solid #d0d7de}img{max-width:100%}</style>
</head>
<body>
<h1>CommonMark</h1>
<p>CommonMark is a rationalized version of Markdown syntax,
with a <a href="https://spec.commonmark.org/">spec</a> and BSD-licensed reference
implementations in C and JavaScript.</p>
<p><a href="https://spec.commonmark.org/dingus/">Try it now!</a></p>
<p>For more details, see <a href="https://commonmark.org">https://commonmark.org</a>.</p>
<p>This repository contains the spec itself, along with tools for
running tests against the spec, and for creating HTML and PDF versions
of the spec.</p>
<p>The reference implementations live in separate repositories:</p>
<ul>
<li><a href="https://github.com/commonmark/cmark">https://github.com/commonmark/cmark</a> (C)</li>
<li><a href="https://github.com/commonmark/commonmark.js">https://github.com/commonmark/commonmark.js</a> (JavaScript)</li>
</ul>
<p>There is a list of third-party libraries
in a dozen different languages
<a href="https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations">here</a>.</p>
<h2>Running tests against the spec</h2>
<p><a href="https://spec.commonmark.org/">The spec</a> contains over 500 embedded examples which serve as conformance
tests. To run the tests using an executable <code>$PROG</code>:</p>
<pre><code>python3 test/spec_tests.py --program $PROG
</code></pre>
<p>If you want to extract the raw test data from the spec without
actually running the tests, you can do:</p>
<pre><code>python3 test/spec_tests.py --dump-tests
</code></pre>
<p>and you'll get all the tests in JSON format.</p>
<p>JavaScript developers may find it more convenient to use the
<a href="https://www.npmjs.com/package/commonmark-spec"><code>commonmark-spec</code> npm package</a>, which is published from this
repository. It exports an array <code>tests</code> of JSON objects with
the format</p>
<pre><code class="language-json">{
"markdown": "Foo\nBar\n---\n",
"html": "<h2>Foo\nBar</h2>\n",
"section": "Setext headings",
"number": 65
}
</code></pre>
<h2>The spec</h2>
<p>The source of <a href="https://spec.commonmark.org/">the spec</a> is <code>spec.txt</code>. This is basically a Markdown
file, with code examples written in a shorthand form:</p>
<pre><code>```````````````````````````````` example
Markdown source
.
expected HTML output
````````````````````````````````
</code></pre>
<p>To build an HTML version of the spec, do
… 5948 more charactersCodexWith deft, skill as AGENTS.mdPassed2026-11-05
- Time
- 14s
- New tokens
- 16.1k
- Total input
- 102.7k
- Output tokens
- 0.4k
- Commands
- 5
- Failed
- 0
Trace
I’ll inspect `commonmark.md` and convert it into a self-contained `index.html` in the current directory.
ls -la && sed -n '1,240p' commonmark.mdoutput
total 24 drwxr-xr-x@ 4 user staff 128 Nov 4 19:55 . drwx------@ 3392 user staff 108544 Nov 4 19:56 .. -rw-r--r--@ 1 user staff 1486 Nov 4 19:55 AGENTS.md -rw-r--r--@ 1 user staff 7671 Nov 4 19:32 commonmark.md CommonMark ========== CommonMark is a rationalized version of Markdown syntax, with a [spec][the spec] and BSD-licensed reference implementations in C and JavaScript. [Try it now!](https://spec.commonmark.org/dingus/) [the spec]: https://spec.commonmark.org/ For more details, see <https://commonmark.org>. This repository contains the spec itself, along with tools for running tests against the spec, and for creating HTML and PDF versions of the spec. The reference implementations live in separate repositories: - <https://github.com/commonmark/cmark> (C) - <https://github.com/commonmark/commonmark.js> (JavaScript) There is a list of third-party libraries in a dozen different languages [here](https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations). Running tests against the spec ------------------------------ [The spec] contains over 500 embedded examples which serve as conformance tests. To run the tests using an executable `$PROG`: python3 test/spec_tests.py --program $PROG If you want to extract the raw test data from the spec without actually running the tests, you can do: python3 test/spec_tests.py --dump-tests and you'll get all the tests in JSON format. JavaScript developers may find it mo … 6401 more charactersdeft md --helpoutput
deft md - commands (input -> output) to-html md -> html Render to a styled HTML page, or --fragment to-pdf md -> pdf Typeset a PDF with headings, tables, code, images More: deft md <command> --help
deft md to-html --helpoutput
deft md to-html - Render to a styled HTML page, or --fragment Same as: deft convert Usage: deft md to-html <md>... [-o <html|dir>] [options] In: md (each handled separately) Out: html (default <name>.<ext>) Options: --fragment Body only, no <html> page --title <text> Page title (default: first heading) Common: -o --force --dry-run --json -j (deft help common) Examples: deft md to-html notes.md -o notes.html deft md to-html notes.md --fragment -o -
deft md to-html commonmark.md -o index.htmloutput
ok md.to-html commonmark.md -> index.html 9KB 0.00s
sed -n '1,100p' index.html && rg -n '<link|<script|stylesheet|href=' index.htmloutput
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>CommonMark</title> <style>body{max-width:46rem;margin:2rem auto;padding:0 1rem;font:16px/1.6 -apple-system,'Segoe UI',Roboto,'PingFang SC','Noto Sans CJK SC',sans-serif;color:#1f2328}pre{background:#f6f8fa;padding:.8rem;overflow:auto;border-radius:6px}code{font:.9em ui-monospace,Menlo,Consolas,monospace}table{border-collapse:collapse}th,td{border:1px solid #d0d7de;padding:.3rem .6rem}blockquote{margin:0;padding:0 1rem;color:#59636e;border-left:.25rem solid #d0d7de}img{max-width:100%}</style> </head> <body> <h1>CommonMark</h1> <p>CommonMark is a rationalized version of Markdown syntax, with a <a href="https://spec.commonmark.org/">spec</a> and BSD-licensed reference implementations in C and JavaScript.</p> <p><a href="https://spec.commonmark.org/dingus/">Try it now!</a></p> <p>For more details, see <a href="https://commonmark.org">https://commonmark.org</a>.</p> <p>This repository contains the spec itself, along with tools for running tests against the spec, and for creating HTML and PDF versions of the spec.</p> <p>The reference implementations live in separate repositories:</p> <ul> <li><a href="https://github.com/commonmark/cmark">https://github.com/commonmark/cmark</a> (C)</li> <li><a href="https://github.com/commonmark/commonmark.js">https://github.com/commonmark/commonmark.js</a> (JavaScript)</li> </ul> <p>There is a list of third-party librarie … 5576 more charactersCreated [index.html](index.html) from `commonmark.md`. It includes the rendered content, page metadata, and embedded CSS, so it works as a standalone HTML page.
Output
Its files were not kept in this run. The last line of the trace is its own report.
Claude Opus 5.5Without deftPassed2026-11-07
- Time
- 28s
- New tokens
- 14.7k
- Total input
- 99.6k
- Output tokens
- 1.9k
- Commands
- 0
- Failed
- 0
Trace
Output
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CommonMark</title>
<style>
:root{color-scheme:light dark;--fg:#1f2328;--bg:#fff;--muted:#59636e;--link:#0969da;--code-bg:#f6f8fa;--border:#d1d9e0}
@media (prefers-color-scheme:dark){:root{--fg:#e6edf3;--bg:#0d1117;--muted:#9198a1;--link:#4493f8;--code-bg:#161b22;--border:#3d444d}}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--fg);font:16px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif}
main{max-width:46rem;margin:0 auto;padding:2.5rem 1.25rem 4rem}
h1,h2{line-height:1.25;border-bottom:1px solid var(--border);padding-bottom:.3em}
h1{font-size:2.2em;margin-top:0}h2{font-size:1.5em;margin-top:2em}
a{color:var(--link);text-decoration:none}a:hover{text-decoration:underline}
code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em;background:var(--code-bg);padding:.15em .35em;border-radius:4px}
pre{background:var(--code-bg);border:1px solid var(--border);border-radius:6px;padding:1em;overflow-x:auto;line-height:1.45}
pre code{background:none;padding:0;font-size:.85em}
li{margin:.35em 0}
blockquote{margin:0;padding:0 1em;color:var(--muted);border-left:.25em solid var(--border)}
</style>
</head>
<body>
<main>
<h1>CommonMark</h1>
<p>CommonMark is a rationalized version of Markdown syntax,
with a <a href="https://spec.commonmark.org/">spec</a> and BSD-licensed reference
implementations in C and JavaScript.</p>
<p><a href="https://spec.commonmark.org/dingus/">Try it now!</a></p>
<p>For more details, see <a href="https://commonmark.org">https://commonmark.org</a>.</p>
<p>This repository contains the spec itself, along with tools for
running tests against the spec, and for creating HTML and PDF versions
of the spec.</p>
<p>The reference implementations live in separate repositories:</p>
<ul>
<li><a href="https://github.com/commonmark/cmark">https://github.com/commonmark/cmark</a> (C)</li>
<li><a href="https://github.com/commonmark/commonmark.js">https://github.com/commonmark/commonmark.js</a> (JavaScript)</li>
</ul>
<p>There is a list of third-party libraries
in a dozen different languages
<a href="https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations">here</a>.</p>
<h2>Running tests against the spec</h2>
<p><a href="https://spec.commonmark.org/">The spec</a> contains over 500 embedded examples which serve as conformance
tests. To run the tests using an executable <code>$PROG</code>:</p>
<pre><code>python3 test/spec_tests.py --program $PROG
</code></pre>
<p>If you want to extract the raw test data from the spec without
actually running the tests, you can do:</p>
<pre><code>python3 test/spec_tests.py --dump-tests
</code></pre>
<p>and you'll get all the tests in JSON format.</p>
<p>JavaScript developers may find it more convenient to use the
<a href="https://www.npmjs.com/package/commonmark-spec"><code>commonmark-s
… 6739 more charactersClaude Opus 5.5With deft, skill installedPassedRead the skillUsed deft2026-11-07
- Time
- 11s
- New tokens
- 10.6k
- Total input
- 75.4k
- Output tokens
- 0.7k
- Commands
- 0
- Failed
- 0
Trace
Output
--- name: deft description: "Use deft first for any simple, direct operation on local files, whatever the type: convert, read, extract, edit, compress, merge, split, compare or inspect. Try it before writing a script or one-liner. If unsure, run deft find; if it says no command does this, use another tool. Not for programming work: to read, write or change source code, skip it." --- # deft One local command for file jobs. Prefer it over writing Python or shell scripts. Syntax: `deft <group> <command> [inputs] [-o output] [--options]` Groups: - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert - `image`: Resize, crop, convert, compress, adjust, montage, OCR - `video`: Trim, merge, convert, compress, subtitles, GIF, frames (ffmpeg) - `audio`: Convert, trim, normalize, denoise, cut silence (ffmpeg) - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace - `slides`: PowerPoint: extract text, Markdown outline - `sheet`: Excel/CSV/ODS tables: SQL query, pivot, merge, split, convert - `json`: JSON: convert, format, merge, diff, validate - `toml`: TOML: convert, format, merge, diff, validate - `xml`: XML: convert, format, merge, diff, validate - `yaml`: YAML: convert, format, merge, diff, validate - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents - `html`: HTML to Markdown, text, Word and PDF - `epub`: E-books: info, to text, Markdown and PDF - `gps`: GPX and KML tracks: convert, distance and time - `qr`: Create QR codes and barcodes; read QR codes How to use it: 1. Run `deft <group>` to list commands, or `deft find "<what you want>"` to search. If it says `no command does this`, use another tool. 2. Run `deft <group> <command> --help` for options and examples. 3. `deft convert <in> -o <out.ext>` converts between formats by extension. 4. Results are one line starting with `ok`, `partial` or `error`; add `--json` to parse them. Errors include a `hint:` with the fix. Inputs are never overwritten; pass `--force` or `--in-place` to allow it. Globs and directories work as inputs; several inputs run in parallel. If `deft` is not installed, ask the user, then follow https://github.com/firstprayer/deft/blob/main/docs/INSTALL.md
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>CommonMark</title>
<style>body{max-width:46rem;margin:2rem auto;padding:0 1rem;font:16px/1.6 -apple-system,'Segoe UI',Roboto,'PingFang SC','Noto Sans CJK SC',sans-serif;color:#1f2328}pre{background:#f6f8fa;padding:.8rem;overflow:auto;border-radius:6px}code{font:.9em ui-monospace,Menlo,Consolas,monospace}table{border-collapse:collapse}th,td{border:1px solid #d0d7de;padding:.3rem .6rem}blockquote{margin:0;padding:0 1rem;color:#59636e;border-left:.25rem solid #d0d7de}img{max-width:100%}</style>
</head>
<body>
<h1>CommonMark</h1>
<p>CommonMark is a rationalized version of Markdown syntax,
with a <a href="https://spec.commonmark.org/">spec</a> and BSD-licensed reference
implementations in C and JavaScript.</p>
<p><a href="https://spec.commonmark.org/dingus/">Try it now!</a></p>
<p>For more details, see <a href="https://commonmark.org">https://commonmark.org</a>.</p>
<p>This repository contains the spec itself, along with tools for
running tests against the spec, and for creating HTML and PDF versions
of the spec.</p>
<p>The reference implementations live in separate repositories:</p>
<ul>
<li><a href="https://github.com/commonmark/cmark">https://github.com/commonmark/cmark</a> (C)</li>
<li><a href="https://github.com/commonmark/commonmark.js">https://github.com/commonmark/commonmark.js</a> (JavaScript)</li>
</ul>
<p>There is a list of third-party libraries
in a dozen different languages
<a href="https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations">here</a>.</p>
<h2>Running tests against the spec</h2>
<p><a href="https://spec.commonmark.org/">The spec</a> contains over 500 embedded examples which serve as conformance
tests. To run the tests using an executable <code>$PROG</code>:</p>
<pre><code>python3 test/spec_tests.py --program $PROG
</code></pre>
<p>If you want to extract the raw test data from the spec without
actually running the tests, you can do:</p>
<pre><code>python3 test/spec_tests.py --dump-tests
</code></pre>
<p>and you'll get all the tests in JSON format.</p>
<p>JavaScript developers may find it more convenient to use the
<a href="https://www.npmjs.com/package/commonmark-spec"><code>commonmark-spec</code> npm package</a>, which is published from this
repository. It exports an array <code>tests</code> of JSON objects with
the format</p>
<pre><code class="language-json">{
"markdown": "Foo\nBar\n---\n",
"html": "<h2>Foo\nBar</h2>\n",
"section": "Setext headings",
"number": 65
}
</code></pre>
<h2>The spec</h2>
<p>The source of <a href="https://spec.commonmark.org/">the spec</a> is <code>spec.txt</code>. This is basically a Markdown
file, with code examples written in a shorthand form:</p>
<pre><code>```````````````````````````````` example
Markdown source
.
expected HTML output
````````````````````````````````
</code></pre>
<p>To build an HTML version of the spec, do
… 5948 more charactersClaude CodeWithout deftNot run yet
Claude CodeWith deftNot run yet