Socket
Book a DemoInstallSign in
Socket

@penrose/automator

Package Overview
Dependencies
Maintainers
4
Versions
419
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@penrose/automator

This package is a command-line application that depends on `@penrose/core` and batch-processes multiple Penrose diagrams.

latest
npmnpm
Version
1.3.0
Version published
Weekly downloads
0
-100%
Maintainers
4
Weekly downloads
 
Created
Source

@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 in out.

Using automator for local development

  • If you are developing a module in core (e.g. Synthesizer), you can run yarn start in the project root direcory, which will continuously watch your changes in core and update your build.
  • Check the console before you run automator to make sure your changes in core are not causing any errors.
  • If the build is successful, automator will now be using the most recent version of core 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 asks automator to output metadata along with SVGs. automator render requires the output to have associated metadata.
  • Run yarn start render out browser to generate a static site.
  • Open browser/index.html to view the result.

FAQs

Package last updated on 24 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts