nodejs
Technical notes on web development, DevOps, and AI integration.
3 articles
- 19:39backend
The PDF Travels With Its Page, the Link Does Not Wander
A ../../../ link out of a generated docs folder is valid while the tree is whole, and dead the moment the folder is handed over. The PDF now moves with it.
TL;DR: A relative link that navigates up the directory tree breaks the moment the docs folder gets handed off as a standalone package. The fix copies PDFs next to their referencing pages so each folder becomes a self-contained unit with working internal links. Failing loudly on missing files prevents shipping broken artifacts, and a simple folder-relocation test catches any remaining dependency issues.
#nodejs#javascript#documentation - 18:06backend
Official Docs Drift, the Generator Fails Loud
When a documentation generator ingests reports it does not own, tolerant parsing ships truncated pages. Explicit markers plus a throw keep drift visible.
TL;DR: When a report team's HTML restructure broke the generator's extraction markers, the author chose fail-fast over tolerant parsing, because catching and skipping just turns failure into silence. Now missing markers or media halt the build with clear errors. Official documents also get top sidebar placement, backed by eyetracking data on above-the-fold attention.
#nodejs#documentation#generator - 00:54frontend
24 Pages, Zero Media: Paths Measured from the Wrong Directory
One generator change left 24 documentation pages empty: every media file 404'd because src paths were measured from the repo root, not the page's folder.
TL;DR: A static site generator produced 24 pages where all media 404'd, blamed first on disk-opening but actually caused by src paths written from the repo root instead of each page's folder. Relative URLs resolve against the document's own directory, not the generator's working directory. The fix computes each src via path.relative from pageDir, handling Windows separators.
#html#nodejs#documentation