MindAttic/MindAttic.Export
Library

MindAttic.Export.

From Markdown to print-ready DOCX, EPUB and PDF in one call.

MindAttic.Export is the one place a MindAttic app turns data into a file people use: books and academic documents rendered to DOCX, EPUB, PDF, TXT and Markdown, reports in every format, and atomic, safely named writes for everything else.

Active C# .NET 9 .NET 10 OpenXML QuestPDF Markdig

What it is

Every user-facing file, made one way

Write a book or a paper in Markdown, and MindAttic.Export renders it as a print-ready manuscript in five formats at once. The book path is a full house style, a 6 by 9 inch KDP trim set in Garamond; the document path is US Letter with a page-numbered contents page, headings, tables, lists, block quotes, LaTeX math and hanging-indent references.

Figures are first-class. A Markdown image on its own line becomes a figure that DOCX and PDF embed at its declared natural size, scaled down to fit and never up. SVG stays vector in both formats, with a PNG fallback inside DOCX for readers that cannot draw SVG. Sources resolve through a pluggable resolver, so images can live in files, data: URIs or an application's own media store.

For everything that is not a manuscript, recordings, JSON and CSV exports, HTML, zip bundles, ArtifactWriter gives every app the same guarantees: sanitized names, atomic writes, UTF-8 without a BOM by default, and an explicit choice for an existing file: archive, uniquify, overwrite or fail. Nothing is ever silently deleted.

It is trusted where it matters: the book renderer was migrated verbatim from Prose and checked byte for byte against an entire published book corpus, and legacy-equivalence tests render hundreds of generated manuscripts through both the frozen original and the library to keep it that way.

Who it's for

  • Authors and self-publishersTurn a Markdown manuscript into KDP-ready DOCX, EPUB and PDF with a consistent house style.
  • Academics and report writersRender papers and reports with contents pages, tables, LaTeX math, figures and APA-style references.
  • .NET developersGive every file your app produces safe names, atomic writes and an archive-never-delete policy with one call.

Features

What you get

01

Five formats from one manuscript

DocxRenderer, EpubRenderer, PdfRenderer, TextRenderer and MarkdownRenderer render the same model; ExportBundleAsync writes a versioned bundle like <Name> V<N>.{docx,pdf,txt,md}.

02

A real book style

6 by 9 inch KDP trim, Garamond, chapters, tenets, markers and glossaries: the Prose house style, byte-identical to its original output.

03

A real document style

US Letter, page-numbered contents, headings, tables, lists, block quotes, LaTeX math and hanging-indent references for reports and academic work.

04

Figures done properly

Images are embedded at their natural size from SVG units, viewBox or stored dpi; SVG stays vector in PDF and DOCX; unresolved figures print a visible placeholder instead of vanishing.

05

Pluggable image sources

The default resolver reads paths, file: and data: URIs and never downloads from the web. Chain your own in front, for example to pull media:{uid} images from MindAttic.Storage.

06

Markdown in, structure out

MarkdownManuscriptReader reads chapters, document blocks and math from one or many files, and has a report mode for single documents.

07

Reports in every format

ReportExporter exports one Markdown report as .md plus .txt, .docx, .pdf and .epub renders.

08

Safe artifact writes

ArtifactWriter sanitizes names, writes atomically and applies an explicit policy for an existing file: archive, uniquify, overwrite or fail.

09

A CLI for config-driven exports

mindattic-export --config export.json names the title page, sources, output folder, formats and page profile; firstHeadingIsTitle turns a single paper into one continuous document.

How it works

Markdown to manuscript

  1. Write in Markdown

    Chapters, tables, math and figures in plain .md files.

  2. Describe the export

    In code with BundleRequest, or in an export.json with the title page, sources, formats and page profile.

  3. Render

    Run mindattic-export or call ExportBundleAsync; each format comes from the same manuscript model.

  4. Ship it

    A versioned bundle lands in the output folder; earlier versions are archived, never deleted.

Quick start

Export from the command line

Formats and an output folder can override what export.json says.

The full setup guide lives in the documentation.

shell
> mindattic-export --config export.json --formats docx,epub,pdf,txt,md --out ./out

Part of MindAttic

One piece of a bigger workshop

MindAttic.Export is shared by much of the family. Prose uses it for book export, previews and book reports; the Synthetic Exchange Theory dissertation is built with its CLI; and KdpPublish, Automata, JobHunt, Tutor, IdeaCms, IdiotProof, MediaButler and OpenCredentials write their recordings, data exports and bundles through ArtifactWriter.

Package versions are pinned to Prose's, so a consumer resolves exactly one version of OpenXML, QuestPDF and Markdig.

Status

Where it stands

Active

6.0 in use; 7.0 makes figure layout complete

Version 6.0.0 is published and consumed, with figures, SVG in PDF and DOCX and the pluggable resolver all shipped. The 7.0 release keeps APA captions on the same page as their figures, removes a blank leaf in books that end with a tenet and a glossary, and is proven on the dissertation.

Current milestone: MindAttic.Export 7.0: figure-complete documents.

Next step

Publish from plain text

Guides, reference and design notes are in the searchable MindAttic documentation. The source, issues and history are on GitHub.