Expand description
§quilldown
Convert GitHub-Flavored Markdown into high-fidelity Word .docx documents.
The crate parses Markdown with comrak (GFM extensions: tables, footnotes,
strikethrough, task lists, autolinks) and emits OOXML with docx_rs. Markdown
constructs are mapped to native Word constructs rather than being flattened:
| Markdown | Word |
|---|---|
#/##/### headings | Heading1/Heading2/Heading3 paragraph styles |
bold / italic / code | bold / italic runs / monospace runs |
| ordered / unordered lists | real Word numbering / bullets |
| GFM tables | Word tables with a shaded, bold header row |
| fenced code blocks | shaded, syntax-highlighted monospace with a language label |
| block images (incl. SVG) | embedded raster images (SVG rasterized to PNG) |
[^id] footnotes | a deduplicated, numbered “Notes” (endnotes) section |
§Quick start
use quilldown::{Converter, ConvertOptions};
let converter = Converter::new(ConvertOptions::default());
converter.convert_file("report.md".as_ref(), "report.docx".as_ref()).unwrap();Modules§
- ir
- An experimental, portable intermediate representation (IR) for quilldown, plus the two operations that surround it.
- typra_
runtime - typra_
spec
Structs§
- Convert
Options - Options controlling how Markdown is converted to DOCX.
- Converter
- Converts Markdown documents to Word
.docxusing a fixed set ofConvertOptions. - Margins
- Page margins in twips (1/1440 in), one value per side.
- Page
Setup - Page geometry: size, orientation, and margins. Drives the section properties and the usable text-column width that tables, code blocks, and rules size to.
- Render
Stats - Counts and warnings describing a single conversion. Useful for tests and CLI output.
- Theme
- A swappable style preset: the fonts, accent colors, and code appearance applied on top of
the page geometry. Every field is a static string so a
Themeis cheap to copy.
Enums§
- Convert
Error - Errors that can occur while converting Markdown to DOCX.
- Orientation
- Page orientation.
- Page
Size - A named or custom page size, expressed in portrait orientation.
Functions§
- convert_
str - Convenience free function: convert a Markdown string with default options.