@beltype/specimens
v0.1.0
Published
The documents every BelType interface is shown and tested on: finished HTML documents with their assets, and the list that finds them.
Readme
specimens
The documents every BelType interface is shown and tested on. A specimen is a finished HTML document with its assets, self-contained and readable by any engine: every file it names sits in its own folder, and nothing is fetched.
import { specimens, specimen } from '@beltype/specimens';
specimen('paper').entry; // absolute path of specimens/paper/index.html
specimens.map((s) => s.name); // ['paper']| Name | Title | Exercises |
| :--- | :--- | :--- |
| paper | A scientific article (A4, invented data) | @page size and margins, @page :first, margin boxes, string-set and string(), counter(page), counters, target-counter(), hyphens: auto, orphans and widows, break-inside: avoid, a table, inline SVG, @font-face woff2 |
Adding one
- Make a folder under
specimens/holding anindex.htmland everything it names. - Add its entry to
src/index.ts: name, title, and what it exercises in CSS's own words. - Run
pnpm test. It holds the list to the folders, every reference to the folder (a remote URL, an absolute path or a../that escapes fails), and every font to a licence file.
A specimen is changed only by eye: print it and look at every page before trusting a test. The companions pin a version of this package, so a change here is followed by a pin move there.
Working on it
pnpm install
pnpm run check
pnpm test
pnpm run build