Visual Design Assets
Rasterise a list of SVG designs into PNG output with Inkscape. The manifest keeps the Inkscape command configurable through a plain `inkscape` variable, alongside `foreach` and a dedicated clean action, without turning a small asset pipeline into a custom script.
Directory Structure
The example keeps the source tree readable: SVG assets stay under `design/svg/`, generated PNGs land in `build/raster/`, and the manifest carries both the conversion rule and the clean action.
Why it matters
Variable definitions are first-class. `inkscape` is a plain manifest variable set to the command name, and the rest of the graph stays explicit and reproducible.
Annotated Manifest
netsuke_version: "1.0.0"
vars:
src_dir: design/svg
out_dir: build/raster
inkscape: inkscape
designs:
- hero
- logo
rules:
- name: rasterise
command: "{{ inkscape }} --export-type=png --export-filename={{ outs }} {{ ins }}"
description: "Rasterising an SVG file"
- name: clean
command: "rm -rf {{ out_dir }}"
targets:
- name: "{{ out_dir }}"
command: "mkdir -p {{ outs }}"
- foreach: designs
name: "{{ out_dir }}/{{ item }}.png"
rule: rasterise
sources: "{{ src_dir }}/{{ item }}.svg"
order_only_deps: "{{ out_dir }}"
actions:
- name: clean
rule: clean
defaults:
- build/raster/hero.png
Tool choice is a variable
The `inkscape` variable keeps the command configurable in one place without moving the rule out of the manifest; `env('INKSCAPE_BIN')` can supply it from the environment where that variable is guaranteed to exist.
Asset fan-out stays declarative
Each design in the `designs` list becomes one PNG target. The filename rewrite happens in the templated `name` field, not in an opaque loop script.
Actions express operator tasks
Cleaning the output directory matters, but it is not a default target. Actions keep that distinction sharp.
Running the Build
$ netsuke build build/raster/hero.png
[1/2] mkdir -p build/raster
[2/2] Rasterising an SVG file
Build Flow
1. Resolve
Choose the Inkscape binary via the `inkscape` variable.
2. Enumerate
Read each entry in the `designs` list.
3. Rasterise
Write one PNG output per asset.
4. Operate
Use the `clean` action when you want to reset the build directory.