{"id":27962588,"url":"https://github.com/anvil-rs/anvil","last_synced_at":"2026-04-08T14:01:31.531Z","repository":{"id":258027084,"uuid":"860653534","full_name":"anvil-rs/anvil","owner":"anvil-rs","description":"Structured, type safe, templating","archived":false,"fork":false,"pushed_at":"2025-05-05T16:00:05.000Z","size":349,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-05T16:53:43.872Z","etag":null,"topics":["rust","strongly-typed","templating","templating-engine"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anvil-rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-20T21:19:52.000Z","updated_at":"2025-05-05T16:00:10.000Z","dependencies_parsed_at":"2024-11-11T23:26:27.042Z","dependency_job_id":"7949e290-40c3-4d47-b26d-58f8cb5cbf8b","html_url":"https://github.com/anvil-rs/anvil","commit_stats":null,"previous_names":["sjcobb2022/swivel","sjcobb2022/anvil","anvil-rs/anvil"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvil-rs%2Fanvil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvil-rs%2Fanvil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvil-rs%2Fanvil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anvil-rs%2Fanvil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anvil-rs","download_url":"https://codeload.github.com/anvil-rs/anvil/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252542061,"owners_count":21764907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust","strongly-typed","templating","templating-engine"],"created_at":"2025-05-07T19:24:27.880Z","updated_at":"2026-04-08T14:01:26.509Z","avatar_url":"https://github.com/anvil-rs.png","language":"Rust","readme":"# Anvil\n\nAnvil 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.\n\n## Core Concepts\n\nAnvil is built around two primary traits:\n\n* `Anvil` - The base trait for template rendering engines\n* `Forge` - The base trait for file operations using rendered templates\n\nThink 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.).\n\n## Design Philosophy\n\n- **Configuration is code**: Your scaffolding logic is defined directly in code, enabling compile-time checking and integration with your application.\n- **Compile time errors are better than runtime errors**: Detect issues at compile time whenever possible.\n- **The library provides the building blocks, not the solutions**: Anvil gives you composable components to build your own custom scaffolding systems.\n\n## Example Usage\n\n```rust\nuse anvil::{Anvil, Forge, generate::Generate};\nuse std::io::Write;\n\n// Simple implementation of the Anvil trait\nstruct SimpleTemplate {\n    content: String,\n}\n\nimpl Anvil for SimpleTemplate {\n    type Error = std::io::Error;\n\n    fn anvil(\u0026self, writer: \u0026mut (impl Write + Sized)) -\u003e Result\u003c(), Self::Error\u003e {\n        writer.write_all(self.content.as_bytes())?;\n        Ok(())\n    }\n}\n\n// Using Generate for file creation\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let template = SimpleTemplate {\n        content: \"Hello, Anvil!\".to_string(),\n    };\n    \n    // Create a file generator using our template\n    let generator = Generate::new(template);\n    \n    // Generate the file\n    generator.forge(\"./output.txt\")?;\n    \n    println!(\"File generated successfully!\");\n    Ok(())\n}\n```\n\n## Inspiration and Credits\n\n- [Laravel Artisan](https://laravel.com/docs/11.x/artisan)\n- [Rails Generators](https://guides.rubyonrails.org/generators.html)\n- [Loco.rs](https://loco.rs/docs/getting-started/tour/#adding-a-crud-api)\n- [Cargo Generate](https://github.com/cargo-generate/cargo-generate)\n- [Cookiecutter actix simple clean architecture](https://github.com/microsoft/cookiecutter-rust-actix-clean-architecture)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanvil-rs%2Fanvil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanvil-rs%2Fanvil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanvil-rs%2Fanvil/lists"}