Printdown

Export a GitHub README or Markdown docs to PDF

By ·

A README is written for people browsing a repository, but sooner or later someone needs it as a document: a client signing off a delivery, an auditor who wants the docs of one specific release, or you, wanting an offline copy. GitHub displays Markdown well on screen but has no button that turns a file into a PDF. Since a README is just Markdown, you can take the source, fix the few things that only make sense inside a repository and print it with proper typography. Going the other way, from Word to a README? See Turn a Word document into a GitHub README.

1. Get the raw Markdown

For a single file, open it on GitHub (click README.md in the file list, not on the repository’s front page) and click Raw in the upper-right corner of the file view. Select all of the plain text, copy it and paste it into the Markdown pane of the editor. The copy icon next to Raw does the same in one click.

For several files, such as a docs/ folder, get the repository onto your disk. Use Code → Download ZIP, or clone only the latest version:

git clone --depth 1 https://github.com/acme/widget.git

Then use Open .md file. It loads one file and replaces the editor’s content; section 4 shows how to merge several files first.

2. Rewrite relative paths

On GitHub, ![Screenshot](docs/screenshot.png) is resolved inside the repository. The editor’s page doesn’t live in your repository, so the browser looks for docs/screenshot.png on the editor’s own site, finds nothing and shows a broken image. Relative links such as [Contributing](CONTRIBUTING.md) break for the same reason.

The fix is to make every path absolute:

  • Images: https://raw.githubusercontent.com/OWNER/REPO/BRANCH/path/to/image.png
  • Links to other files: https://github.com/OWNER/REPO/blob/BRANCH/path/to/file.md, so readers land on the rendered page on GitHub.

Worked example: in the repository acme/widget, branch main, docs/setup.md contains:

![Architecture](images/architecture.png)
<img src="../assets/logo.svg" width="120">
See the [configuration reference](configuration.md#environment-variables).

Paths are relative to the folder of the file, here docs/, and ../ goes up one level. So it becomes:

![Architecture](https://raw.githubusercontent.com/acme/widget/main/docs/images/architecture.png)
<img src="https://raw.githubusercontent.com/acme/widget/main/assets/logo.svg" width="120">
See the [configuration reference](https://github.com/acme/widget/blob/main/docs/configuration.md#environment-variables).

A path that starts with / is relative to the repository root. If the PDF documents a specific release, use its tag instead of the branch (…/acme/widget/v2.4.0/docs/…), so the images match that version even after main moves on.

You don’t have to edit each line by hand. Click in the Markdown pane and press Ctrl+F (Cmd+F on a Mac): the search panel has a replace field and a replace all button. Search for ](images/ and replace it with ](https://raw.githubusercontent.com/acme/widget/main/docs/images/, then do the same for each HTML src="…" that isn’t a full URL yet.

3. What carries over from GitHub

The editor understands most of GitHub’s Markdown (compare with GitHub’s formatting syntax reference), but a few GitHub extras need a small edit:

GitHub featureIn the PDFWhat to do
Tables, column alignment, strikethrough, footnotesWorkNothing
Task lists (- [x])Work, as ticked and empty checkboxesNothing
Fenced code with a languageHighlighted for over 20 common languages, such as Bash, Python, JavaScript, TypeScript, Go, Rust, Java, C#, SQL and YAMLOthers, such as PowerShell, GraphQL, HCL or Lua, print as plain monospaced text
Mermaid diagramsWork, as vector graphicsNothing
Math with $…$ and $$…$$WorksChange ```math blocks to $$…$$
AutolinksFull URLs (https://…) become linksWrite www. addresses, #123 issues and @mentions as full URLs
Alerts (> [!NOTE])An ordinary quote with [!NOTE] visibleReplace the marker with a bold label
<details> and <summary>Work, but print collapsedWrite <details open>
Raw HTML (<p align="center">, <img width="…">, <br>)Works; scripts are removedMake src and href absolute
Badges (shields.io)Load like any other imageConsider removing them for non-technical readers
Emoji shortcodes (:rocket:)Printed as typedPaste the emoji itself (🚀)
Heading anchorsGenerated automaticallyCheck links to headings with accents, symbols or emoji

An alert converts like this: > [!WARNING] followed by > Back up the database before upgrading. becomes > **Warning:** Back up the database before upgrading. In the editor, quotes are set in italics with a rule on the left.

Heading ids follow GitHub’s rule for plain headings: ## Getting started becomes #getting-started and a repeated heading gets -1, -2, so a hand-written table of contents keeps working. Accents differ: ## Instalación rápida becomes #instalacion-rapida, while GitHub keeps #instalación-rápida, so check such links in the preview.

Also, in normal text the editor turns straight quotes into typographic ones and -- into an en dash; code is left untouched, so commands stay safe to copy.

4. Combine README, docs and changelog

To get a single handbook, merge the files into one Markdown file with a page-break marker between them, so each one starts on a new page. Rewrite the relative paths in each file first: images/flow.png means something different inside docs/ than at the root. Then, on macOS, Linux or Git Bash:

awk 'FNR==1 && NR>1 {print "\n<!-- pagebreak -->\n"} 1' README.md docs/*.md CHANGELOG.md > handbook.md

In PowerShell:

(Get-Content README.md, docs\*.md, CHANGELOG.md -Raw -Encoding utf8) -join "`n`n<!-- pagebreak -->`n`n" | Set-Content handbook.md -Encoding utf8

The docs/*.md pattern sorts files alphabetically; list them by name if you need a different order. Open handbook.md with Open .md file and make two more adjustments:

  • Links between the files now point inside the same document: change [Configuration](docs/configuration.md) to [Configuration](#configuration).
  • The first heading becomes the suggested file name of the PDF, so start with the project’s # title.

Changelogs grow long. For a client, the last two or three releases are usually enough; cut the rest or link to the full file on GitHub.

5. Use the Technical theme for code-heavy docs

Open the Style panel. Technical pairs Roboto for body text with JetBrains Mono for headings, in dark green, and suits developer documentation. There is no separate code-font setting: code blocks use JetBrains Mono in every theme, at 82% of the body size, so the Font size slider controls both. At the default 11 pt on A4 with normal margins, a code line holds about 85 characters; 10 pt with Narrow margins gets you close to 100.

For readers who don’t write code, Modern or Clean look less technical, and code blocks keep their monospaced font anyway.

6. Export and hand it over

Click Download PDF and choose Save as PDF in the print dialog; the editor waits for images to load before it opens. Turn off Headers and footers to remove the date and the page address. The trade-off: the editor has no page-number setting, so if a client needs page numbers, leave headers and footers on and accept the date, title and address the browser prints around them. Avoid More → Quick PDF for documentation: it saves pages as images, so nobody can search the text or copy a command.

Before sending a README to non-technical stakeholders:

  • Remove the badge row and developer-only sections (building from source, contributing, CI setup), or move them to an appendix after a page break.
  • Add a line under the title with the version and date, for example Release 2.4 · 7 October 2026. With headers off, nothing else on the page says which version they are reading.
  • Write link text that makes sense on paper, or show the address itself, because a printed page cannot be clicked.

Troubleshooting

  • An image shows as a broken icon or its alt text. The path is still relative, or the repository is private: images in a private repository aren’t publicly reachable, so they don’t load in the editor. Host the image somewhere public, or embed it: encode it with base64 -w0 diagram.png (Linux and Git Bash; base64 -i diagram.png on macOS) and write ![Diagram](data:image/png;base64,iVBOR…). This works for PNG, JPEG, GIF and WebP, not SVG.
  • Images appear in the preview but not in the Quick PDF. Quick PDF redraws the page on a canvas, and browsers only allow that for images whose server permits cross-origin use (CORS). raw.githubusercontent.com and img.shields.io do; some other hosts don’t. Download PDF prints any image the preview shows.
  • Long code lines. They wrap instead of being cut off, but a wrapped command is easy to mistype. Break long commands with \ at the end of a line (a backtick, `, in PowerShell), or lower the font size.
  • Wide tables. Columns are squeezed to the page width, and rows never split across pages. Lower the font size to 9 or 10 pt, choose narrow margins, abbreviate the headers or split the table in two. The Style panel has no landscape option.
  • A Mermaid diagram shows red text. That is Mermaid’s error message: the diagram code has a syntax error.

Everything runs in your browser: the Markdown is never uploaded, which matters for internal documentation. For every element the editor supports, see the Markdown guide.

More guides