Install
EVG is two packages in one repository.
TypeScript (NPM)
Section titled “TypeScript (NPM)”Node.js 20 or a later version is required.
npm install evgThe CLI writes a PDF from XML or from Storm JSON:
npx evg hello.xml hello.pdfnpx evg examples/storm-hello.evg.json storm.pdfA program uses the Thunderstruck API:
import { EVG, Storm } from "evg";
const node = new EVG(`<View> <span font-size="24" text="Hello"/></View>`);EVG.renderToFile("./out.pdf", 400, 200, node);new EVG(xml) parses the original markup. new EVG(stormJson) accepts a Storm document ({"evg":1,"root":…}) and renders it through the same PDF path.
Ranger 3.x
Section titled “Ranger 3.x”A Ranger application depends on this git repository. The package root is the storm/ directory:
{ "dependencies": { "evg": { "git": "https://github.com/terotests/evg.git", "rev": "<commit>", "subdir": "storm" } }}During development against a sibling checkout:
{ "dependencies": { "evg": { "path": "../evg/storm" } }}Then:
Import "pkg:evg/EVGElement.rgr"Import "pkg:evg/EVGStyleSheet.rgr"Import "pkg:evg/EVGLayout.rgr"Import "pkg:evg/EVGDisplayList.rgr"Run rgrc install so the compiler fetches the git dependency. A path dependency needs no fetch.
The image and zip packages sit next to storm/ and come along as path dependencies of that package.
Engine tests
Section titled “Engine tests”npm testnpm run storm:teststorm:test compiles the Ranger suites when a Ranger 3.x checkout is on RANGER_ROOT. GitHub Actions always runs those suites. See CI.
EVG 3.0.0 · commit ffce45b · Ranger language documentation