Skip to content

Install

EVG is two packages in one repository.

Node.js 20 or a later version is required.

Terminal window
npm install evg

The CLI writes a PDF from XML or from Storm JSON:

Terminal window
npx evg hello.xml hello.pdf
npx evg examples/storm-hello.evg.json storm.pdf

A 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.

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.

Terminal window
npm test
npm run storm:test

storm: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