Case · Site

Sverlo: a documentation generator in Node.js

A static documentation site generator written from scratch in Node.js with no dependencies: its own Markdown parser, code highlighting and offline search. The demo site about a fictional library, Sverlo, is built from 43 pages in two languages (RU and EN) and two versions (v1 and v2). A side project.

  • Node.js
  • JavaScript (ESM)
  • zero dependencies
  • Markdown
  • Cloudflare Pages
  • GitHub Actions

01 · How it looks

Screenshots

Screenshot of the project "Sverlo: a documentation generator in Node.js" at 1280 pixels wide
Desktop, 1280 px
Screenshot of the project "Sverlo: a documentation generator in Node.js" on a phone screen, 390 pixels wide
Phone, 390 px

02 · About

What it is and why

Sverlo (docs-engine) is a static documentation site generator in Node.js (ESM) with no dependencies, and the demo site it builds: documentation of a fictional log-analysis library. The library does not exist and the site is honestly marked as a demo; the generator is the real thing here. A side project.

Markdown is parsed by its own parser, code is highlighted by its own tokenizer, and the search index is built at build time and searched in the browser by the same file. The site reads fully without JavaScript: the script adds only search, the theme and copy buttons.

Limitations

The content about Sverlo is fictional, the performance numbers in it are marked as targets.

Markdown has no indented code blocks, reference links or raw HTML. Highlighting is a regular-expression tokenizer without a grammar: nested template strings and regex literals can be inexact.

Stemming is heuristic, with no morphology or typo correction. The two languages and versions are set by directories, translation is manual and there is no automatic completeness check.

Node.js 22+ is required (checked on 24). The browser check (search, theme, language, axe) was done by hand over CDP and is not part of CI.

What is inside

  • Markdown: headings with {#id}, nested lists and tasks, tables with alignment, code blocks, footnotes, ::: note callouts; front matter and include directives only from the site/includes directory
  • Highlighting for js/ts, json, bash, yaml, log, diff and http: tokens always join back into the source text
  • Documentation versions (v1, v2) and two languages (ru, en) with hreflang; the switchers keep the page when it has a pair
  • Client-side search with no libraries: an index built at build time, Russian and English stemming, prefixes, ranking, highlighting, works offline through a service worker
  • Navigation from the file tree, breadcrumbs, a table of contents, previous/next; dark and light themes, RSS from the changelog
  • sitemap.xml with xhtml:link, robots.txt, llms.txt, security.txt, JSON-LD TechArticle and BreadcrumbList, canonical addresses
  • 131 tests: the parser, highlighting (no lost characters), navigation, search, sanitizing (XSS payloads), golden page structure; CI checks broken links and anchors, hreflang and CSP safety
  • The live version is built with npm run build and deployed to Cloudflare Pages (direct upload of dist)

03 · How to run

Run it locally

git clone <repository on request> docs-engine
cd docs-engine
npm test
npm run build   # dist/ with the static site

04 · Code

The repository is private

The source is in a private repository. Message me on Telegram and I will open access.

Request the code