How DocGen works

This page explains some technical details about how DocGen works.

You don't need to read these details to use DocGen (they explain how to the tool works internally for advanced users).

CLI

DocGen is a CLI (command-line interface) tool that is written TypeScript for Node.js

Markdown

DocGen uses the markdown-it Markdown parser with CommonMark spec for parsing Markdown content files.

Website

The website is generated using React as template engine.

Styles

DocGen uses Style Dictionary for defining design tokens and generating styles.

The website styles are defined in Sass.

The PDF styles are defined in CSS-in-JS format. The React PDF engine uses Yoga Layout, which supports a print-friendly subset of modern CSS.

PDF

DocGen uses ReactPDF as its engine for generating PDF documents, which is built on PDFKit.

Additionally, DocGen uses the react-pdf-html package for converting Markdown HTML output into React PDF primitives (it internally parses HTML with node-html-parser and CSSTree).