Skip to main content

Crate quilldown

Crate quilldown 

Source
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:

MarkdownWord
#/##/### headingsHeading1/Heading2/Heading3 paragraph styles
bold / italic / codebold / italic runs / monospace runs
ordered / unordered listsreal Word numbering / bullets
GFM tablesWord tables with a shaded, bold header row
fenced code blocksshaded, syntax-highlighted monospace with a language label
block images (incl. SVG)embedded raster images (SVG rasterized to PNG)
[^id] footnotesa 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§

ConvertOptions
Options controlling how Markdown is converted to DOCX.
Converter
Converts Markdown documents to Word .docx using a fixed set of ConvertOptions.
Margins
Page margins in twips (1/1440 in), one value per side.
PageSetup
Page geometry: size, orientation, and margins. Drives the section properties and the usable text-column width that tables, code blocks, and rules size to.
RenderStats
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 Theme is cheap to copy.

Enums§

ConvertError
Errors that can occur while converting Markdown to DOCX.
Orientation
Page orientation.
PageSize
A named or custom page size, expressed in portrait orientation.

Functions§

convert_str
Convenience free function: convert a Markdown string with default options.