explaingit

relaxedjs/relaxed

11,792JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

ReLaXed converts Pug or plain HTML files into polished PDFs using a headless browser, letting you style documents with CSS frameworks and JavaScript libraries instead of learning LaTeX.

Mindmap

mindmap
  root((relaxed))
    What It Does
      Pug to PDF
      HTML to PDF
      Auto-rebuild on save
    Built-in Support
      Math via MathJax
      Charts via Vega-Lite
      Diagrams via Mermaid
    Tech Stack
      Node.js
      Puppeteer
      Chromium
    Use Cases
      Resumes
      Research papers
      Slides and posters
    Audience
      Web developers
      Document authors
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Create a professional resume or CV using HTML and CSS and export it as a print-ready PDF.

USE CASE 2

Generate a research paper with math equations and embedded charts from a single Pug source file.

USE CASE 3

Automate PDF report production with data-driven charts sourced from CSV files using Vega-Lite.

USE CASE 4

Design presentation slides or posters using familiar web layout tools and export to PDF.

Tech stack

JavaScriptNode.jsPuppeteerChromiumPugMathJaxVega-LiteMermaid

Getting it running

Difficulty · easy Time to first run · 30min

Puppeteer downloads a Chromium binary automatically during npm install, which can be slow on a first run.

In plain English

ReLaXed is a command-line tool that generates PDF documents from source files written in Pug (a shorthand HTML syntax) or plain HTML. You write your content in a text file, run the tool, and it produces a PDF by rendering the page in a headless browser and capturing the output. It was built for people who want the precision of a markup language but also want access to the full range of modern web styling and layout capabilities. The motivation behind the project is that standard Markdown is too limited for complex document layouts, while LaTeX has steep learning requirements and obscure error messages. Web technologies offer a practical alternative: CSS frameworks can handle clean typography and page structure, JavaScript libraries cover everything from math rendering to charting, and millions of people already know how these tools work. ReLaXed uses Pug as its preferred input format because it is a compact, readable way to write HTML. Once installed via npm, the tool is invoked from a terminal with the source file as the argument. It then watches the file and any files in its directory, regenerating the PDF automatically each time something changes. A one-shot mode is also available for environments where file watching is not needed. The repository includes example outputs: books, resumes, business cards, slides, research papers, and posters. Built-in support covers Markdown content blocks, math equations through MathJax, CSV files converted into HTML tables, charts through Vega-Lite and Chart.js, and diagrams through Mermaid. Any additional JavaScript or CSS library can be imported directly in the Pug file, so the feature set is not fixed to what the tool ships with. ReLaXed uses Puppeteer under the hood to control the Chromium browser, which handles the actual rendering and PDF export.

Copy-paste prompts

Prompt 1
I have a ReLaXed Pug file for a resume. Add a two-column layout using CSS Grid and a custom color scheme for headings.
Prompt 2
Using ReLaXed and Vega-Lite, write a Pug template that reads sales numbers from a CSV and renders a bar chart in a PDF report.
Prompt 3
Set up a ReLaXed research paper template with MathJax for equations, Mermaid diagrams, and a numbered table of contents.
Prompt 4
My ReLaXed PDF has page-break problems inside multi-page tables. Show me the CSS page-break rules to fix them.
Prompt 5
Convert this LaTeX resume into a ReLaXed Pug template that produces a visually equivalent PDF.
Open on GitHub → Explain another repo

← relaxedjs on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.