README to PDF
How to convert a README.md to PDF
A README works well in a repository, but sometimes you need to send it to clients, teachers, or teammates as a stable document. This guide shows how to clean it up, verify its structure, and export it to PDF.
Practical guide · 5 minBefore converting
- Use one main title and organize the rest with subheadings.
- Check that absolute links still work outside the repository.
- Label code blocks with a language to keep them readable.
01
From repository to document
Review the hierarchy
Keep one H1 heading for the project. Use H2 for installation, usage, and configuration, and H3 only when a section needs another level.
Fix relative resources
An image such as ./docs/screenshot.png depends on the repository. For a portable document, use a stable public URL or remove resources containing internal information.
Check code and tables
Label the code language and avoid overly wide tables. A short table fits A4 or Letter pages more reliably.
Adjust and export
Load the README, select the page size, and inspect the preview. For a long document, enable the table of contents before downloading the PDF.
README to PDF
Try a short README
Edit the description or add a requirement. The preview renders Markdown without running HTML or scripts.
You can edit the example here. Opening it in the converter loads the original version so you can export it.
Atlas CLI
A small tool that validates configuration files before deployment.
Installation
npm installnpm run buildUsage
- Copy
.env.exampleto.env. - Run
npm run validate. - Fix warnings before publishing.
| Command | Purpose |
|---|---|
npm test | Run the tests |
npm run build | Create the final build |
Tip: never include secrets or credentials in a README.
02
Details that improve the PDF
- Remove badges and counters that only make sense inside the repository.
- Replace directions such as “click above” with instructions that work on a page.
- If the README includes a full license, consider moving it to a new page with an explicit page break.
03
Frequently asked questions
Is the README sent to a server?
No. md2pdf reads and converts the content inside your browser.
Are code blocks preserved?
Yes. The PDF keeps the block, its language label, and wraps long lines.