Guides
Write a document
Turn Markdown or HTML you wrote into a file people open: a Word document, a PDF, a deck or an e-book.
From Markdown
Write the Markdown, then convert it. The extension of the output names the format.
| To | What you get |
|---|---|
| docx | Headings, lists, tables, code blocks and images as native Word elements, in the default styles |
Typeset pages, A4 unless page_size says letter | |
| pptx | A section title slide for each top-level heading, and a slide for each second-level heading |
| epub | An e-book with a chapter at each top-level heading |
| html | One standalone page with simple built-in styles, or a reveal.js deck with slides |
| odt | Headings, lists, tables, code blocks and images as OpenDocument elements |
cv targets review.md lists every target, each with what it keeps and drops.
$ export CV_API_KEY=cv_sk_…Set your key once. Every cv command reads it.
---title: Pier 3 lease reviewauthor: Port office--- # Summary The lease runs for two years from 1 March 2026. ## Rent | Due | Amount ||---|---|| Rent | 1,300 || Deposit | 2,600 |$ cv convert review.md review.docxstderrreview.docx (11392 bytes) -> review.docxFrom HTML
HTML prints to PDF the way Chrome prints it: modern CSS, web fonts and JavaScript charts render first. Pages are A4 unless the CSS sets a size.
Common libraries such as Tailwind, Chart.js and MathJax load from a local copy of their CDN. Other remote resources do not load, so put styles and pictures in the page.
HTML to docx keeps headings, paragraphs, lists, tables, links and embedded images, and drops CSS layout, colors and scripts.
$ cv convert invoice.html invoice.pdfstderrinvoice.pdf (88214 bytes) -> invoice.pdfJoin several files
Give several inputs and one output file, and they are joined into one. Each input is converted to the format the join takes, then joined in the order given.
In the API, output.shape set to one joins the inputs. Without it, each input is converted on its own, as cv does with a directory as the output.
Markdown files join into one e-book with --to epub, and PDFs join into one PDF. When some inputs cannot become the format the join takes, the job fails with unsupported_elements.
$ cv convert intro.md terms.md annex.md lease-pack.pdfstderrlease-pack.pdf (64190 bytes) -> lease-pack.pdfPage size and slides
--opt page_size=letter sets Letter pages for Markdown or HTML to PDF. --opt slides=true turns Markdown into a reveal.js deck, one slide for each second-level heading and a title slide for each first-level one.
cv targets talk.md --json lists the options each target takes, with their ranges and defaults. See Options.
$ cv convert talk.md talk.html --opt slides=truestderrtalk.html (9877 bytes) -> talk.htmlUpdated 3 November 2026