@penrose/automator
: a headless renderer for Penrose
This package is a command-line application that depends on @penrose/core
and batch-processes multiple Penrose diagrams.
Usage:
Penrose Automator.
Usage:
automator batch LIB OUTFOLDER [--folders] [--src-prefix=PREFIX] [--repeat=TIMES] [--render=OUTFOLDER]
automator render ARTIFACTSFOLDER OUTFOLDER
Options:
-o, --outFile PATH Path to either an SVG file or a folder, depending on the value of --folders. [default: output.svg]
--folders Include metadata about each output diagram. If enabled, outFile has to be a path to a folder.
--src-prefix PREFIX the prefix to SUBSTANCE, STYLE, and DOMAIN, or the library equivalent in batch mode. No trailing "/" required. [default: .]
--repeat TIMES the number of instances
Getting started
- Follow the instruction in the wiki page to install Penrose.
- Run
yarn start batch registry.json out/ --src-prefix=../../examples
in this directory. The output SVGs will appear inout
.
automator
for local development
Using - If you are developing a module in
core
(e.g.Synthesizer
), you can runyarn start
in the project root direcory, which will continuously watch your changes incore
and update your build. - Check the console before you run
automator
to make sure your changes incore
are not causing any errors. - If the build is successful,
automator
will now be using the most recent version ofcore
when batch-processing Penrose programs.
Static site generation
In addition to batch-processing Penrose programs, you can also use automator
to generate a static site for viewing the diagrams and metadata (e.g. performance statistics). Here's an example:
- Run
yarn start batch registry.json out/ --src-prefix=../../examples --folders
in this directory.- Different from the example above, the
--folders
option asksautomator
to output metadata along with SVGs.automator render
requires the output to have associated metadata.
- Different from the example above, the
- Run
yarn start render out browser
to generate a static site. - Open
browser/index.html
to view the result.