Document automation

Medical equipment catalog as code — Markdown to PDF

📅2026
1 week
👥1 developer
31-uzd-a650.md1---2title: УЗД-система A6503brand: MedTech4category: ultrasound5photo: a650.jpg6specs:7 - Монітор 21.5" LCD8 - 4 порти датчиків9 - Елегантна панель10---11Опис системи для12експертної діагностики…$ npm run build✓ 78 products → 52 pages PDF (48s)УЗД-СИСТЕМИРозділ 05 · стор. 31УЗД-система A650MedTech— 31 —1 позиція = 1 Markdown-файл
78
products in catalog
52
A4 pages
1
build command

Challenge

A medical equipment distributor's catalog lived as a designer-made PDF: every new product or price change went through a layout designer — slow and expensive. The product range keeps growing from manufacturer brochures, and the catalog chronically lagged behind the real price list.

What was built

The catalog was turned into a source of truth in code: every product is a Markdown file with YAML front matter, sections are a YAML config, the design is an HTML/CSS template, and Chromium prints the final PDF from it. Adding a product boils down to “file + photo → one build command”.

1

One product = one Markdown file with YAML front matter (specs, brand, price); sections with accent colors are described in categories.yml.

2

HTML→PDF via Playwright/Chromium: precise typography, A4 landscape, automatic table of contents, footers and page numbering.

3

Content extraction from the old PDF and manufacturer brochures with PyMuPDF scripts

texts and photos were pulled automatically, no manual retyping.

4

Photo pipeline: product photos on black backgrounds are automatically converted to white with an edge flood-fill algorithm (numpy BFS).

5

Auto-gallery: extra photos are picked up by filename suffixes; undersized images are filtered out automatically.

6

Two template palettes

vivid v1 and restrained v2; brand logos are substituted automatically from a map.

7

Update workflow: raw PDF/DOCX/photos go into an _inbox, get parsed into product cards

and the catalog rebuilds with a single command.

Result

The catalog grew from 41 to 78 products across 13 sections — without a single hour of a layout designer. A new product is now a Markdown file and a photo; the full 52-page PDF rebuilds with one command in about a minute and always matches the current product range.

Tech stack

Node.jsNunjucksPlaywright (Chromium)PythonPyMuPDFnumpy

Have a similar challenge?

Discuss a project

Next case

System development

TMS platform for a freight company