Jostraca code generation, made repeatable

How-to guides

Each guide solves one task and assumes you know the basics — the tutorial teaches those. The guides come from the generator repository, where the test suite runs every example in them or states why it does not.

Compose the output tree

Declaring folders, files, and the content that goes inside them.

Templates and fragments

Filling files from a data model, and from template files on disk.

Reusable components

Factoring a generator into pieces you call more than once.

Regenerating over existing files

Running the generator again over code a person has edited.

Files, copying and permissions

Getting existing assets into the output, and setting how they land.

Embedding Jostraca

Driving the generator from your own tool, in memory or on disk.

  • Generate in memory

    Run a generator on a virtual filesystem with mem, and read the result back from the volume.

  • Report what a run did

    Read the result arrays and the audit trail to tell a user what a generate changed.

  • Test a generator

    Assert on a generator's output without a temp directory, using in-memory generation.

  • Call Jostraca from Go

    Drive the Go port from your own program, and know where its surface differs.