Anvil
Anvil is a modular templating system for creating user-defined scaffolding systems. It provides a composable API for file operations like generating, appending, transforming, and moving files.
Core Concepts
Anvil is built around two primary traits:
Anvil- The base trait for template rendering enginesForge- The base trait for file operations using rendered templates
Think of Anvil as the template you render, and Forge as what you do with that rendered content (create a file, append to a file, transform a file, etc.).
Design Philosophy
- Configuration is code: Your scaffolding logic is defined directly in code, enabling compile-time checking and integration with your application.
- Compile time errors are better than runtime errors: Detect issues at compile time whenever possible.
- The library provides the building blocks, not the solutions: Anvil gives you composable components to build your own custom scaffolding systems.
Example Usage
use ;
use Write;
// Simple implementation of the Anvil trait
// Using Generate for file creation