Turning Markdown into a document

Write once in plain text. Produce the fixed document for printing and the page for everyone else.

A plain text source with a converter gives you every format from one file. The mistake is deciding the fixed document is the real output.

One plain text source generating a page and a fixed document.
One plain text source generating a page and a fixed document.

Why the source format matters

Plain text with light markup is readable without any tool, survives version control properly, shows meaningful differences between revisions, and will open in forty years.

Every output, page, fixed document, slides, word processor file, is generated from it. Nothing is maintained twice, which is what goes wrong when the document itself is the master copy.

Output Use
Page Reading, on any device
Fixed document Printing, filing
Word processor file Somebody who must edit it
Slides Presenting
The source The thing you keep

The install problem

Producing a fixed-page document generally means a full typesetting engine, which is a multi-gigabyte install and a set of error messages written for people who already use it.

There is a shorter route. Convert to a page, open it, and print to a fixed document from the browser. The typography is less refined and the output is entirely acceptable for a report, a manual or a set of notes.

Install the engine when the typography is the point. For everything else, the browser is the converter you already have.

Templates

Default output looks unfinished, and people conclude the tool is crude.

It is not: the defaults are deliberately plain, and a template is what makes the output look like a document somebody produced on purpose. One template file, applied to every conversion afterwards, carries the typeface, spacing, margins and heading treatment.

Write it once. It is the difference between a converted file and a document you would send.

The same source converted with default settings and with a template.
The same source converted with default settings and with a template.

Images are resolved at conversion time, relative to where the conversion runs. Running it from a different directory is the usual reason images vanish, and the message about it is easy to miss.

Links become clickable in the fixed document and disappear the moment it is printed. If the document may be printed, write the address in the text as well as linking it.

Which output people should get

Publish the page. Send its address.

It opens on a phone, reflows to the screen, can be searched, and is corrected by regenerating it. Link the fixed document from the page for anyone printing or filing.

Attaching the document and keeping the page as an afterthought is the common arrangement and it is backwards: the majority of readers are on a device where the page is better and the document is a download.

Two neighbouring cases are worth a look: What an MD file is and AI-generated HTML to a PDF that looks right.

Ask the assistant for a page, not prose HTML Check what came back render it before trusting it publish Give it an address so others can read it
Markup from a chat, checked in a renderer, then given an address.

Put it at an address

Keep the source in plain text, generate the page first, apply a template before judging the output, check images resolve at conversion time, and publish the page with the document linked from it.

Questions people ask

Why convert from plain text at all?

The source stays readable, diffable and permanent, and every output format is generated rather than maintained by hand.

Do I need a typesetting engine installed?

For a fixed-page document, yes, and it is a large install. Going through a page first and printing to a document avoids it entirely.

Why does my document look plain?

Because no template was specified. Defaults are conservative, and a template file is what turns a conversion into something presentable.

What about images and links?

Images need to be reachable at conversion time. Links become clickable in the document and are meaningless once it is printed.

Which output should people actually receive?

The page, for anything read on a screen. Keep the fixed document for printing and for anyone who wants to file it.

Keep reading