Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Generator Processor

Purpose

Runs a user-configured script or command as a generator, producing output files from input files. The script receives input/output path pairs on the command line.

How It Works

Discovers files matching the configured extensions, computes output paths under output_dir with the configured output_extension, and invokes the command with path pairs.

In single mode: command [args...] <input> <output>

In batch mode: command [args...] <input1> <output1> <input2> <output2> ...

Auto-detected when the configured scan directories contain matching files.

Source Files

  • Input: files matching src_extensions in src_dirs
  • Output: {output_dir}/{relative_path}.{output_extension}

Configuration

[processor.generator]
command = "scripts/convert.py"
output_dir = "out/converted"
output_extension = "html"
src_dirs = ["syllabi"]
src_extensions = [".md"]
batch = true
args = []
dep_inputs = []
KeyTypeDefaultDescription
commandstring"true"Script or command to run
output_dirstring"out/generator"Directory for output files
output_extensionstring"out"Extension for output files
batchbooltruePass all pairs in one invocation
argsstring[][]Extra arguments prepended before file pairs
dep_inputsstring[][]Extra files whose changes trigger rebuilds

Batch support

Configurable via batch = true (default). In batch mode, the script receives all input/output pairs in a single invocation. Set batch = false to invoke the script once per file.