Render Pipeline

Here, "render pipeline" means the build pipeline that turns the docs/ sources into a deployable static site. It is "generator compile + three post-processing steps", all chained by build.cmd / build.sh.

#Overview

flowchart LR
  SRC["docs/*.md + .Cdocs/{config,route,i18n,assets}"]
  EXE["Cdocs.exe<br/>(C++ generator)"]
  GEN["dist/ skeleton<br/>HTML · SEO · sitemap · robots · search data"]
  RSS[".Cdocs/tools/gen-rss.js"]
  PWA[".Cdocs/tools/gen-pwa.js"]
  OUT["final dist/<br/>+ rss.xml · feed.json · manifest · sw.js"]

  SRC --> EXE
  EXE -->|generate| GEN
  GEN --> RSS
  GEN --> PWA
  RSS -->|inject link rel=alternate| OUT
  PWA -->|inject manifest + sw.js| OUT

The build runs in four steps (labeled [0/3][3/3] in the script):

#[0/3] Compile the generator

Only compiled when Cdocs.exe is missing or any source file is newer than the exe. Key rules:

#[1/3] Generate the site

Cdocs.exe reads the data layer and produces dist/:

#[2/3] Generate RSS / JSON Feed

.Cdocs/tools/gen-rss.js (pure Node, built-in modules only) reads the generated HTML, produces RSS 2.0 and JSON Feed, and injects <link rel="alternate"> into each page's <head>. Title/description come from the already-i18n-resolved HTML; the summary is the first paragraph.

#[3/3] Generate PWA

.Cdocs/tools/gen-pwa.js copies sw.js / icon.svg, writes a per-language manifest.webmanifest, injects <link rel="manifest"> and theme-color, and bumps the Service Worker cache version (clearing stale caches) so visited pages work offline.

#Extending the build

To add a step, drop a pure-Node script (built-in modules only) into .Cdocs/tools/ and call it with node from build.cmd / build.sh. Version switchers, OG share images, and similar outputs all live on this "post-process after generation" path, decoupled from the C++ generator.

#FAQ

Opening dist/*.html directly via file:// restricts PWA, Service Worker and some fetch calls. Use Cdocs serve or any static server (e.g. python -m http.server) over http://.
Before going live, change config.json&#x27;s url to the real domain — otherwise canonical / sitemap / RSS links all point at the placeholder https://docsgen.example.com.
Last updated: 2026-08-02 20:10 · About 3 min read (585 words)