ironflow_templates/lib.rs
1//! # ironflow-templates
2//!
3//! Template system for the [ironflow](https://gitlab.com/ThomasTartrau/ironflow)
4//! workflow engine, inspired by [shadcn/ui](https://ui.shadcn.com).
5//!
6//! Templates are workflow handlers hosted in external Git repositories.
7//! Instead of installing them as dependencies, `ironflow-cli template add`
8//! copies the source files directly into your project -- you own the code
9//! and can customize it freely.
10//!
11//! # Template format
12//!
13//! A template repository contains one or more template directories, each
14//! with a `template.toml` manifest and a `src/` folder:
15//!
16//! ```text
17//! my-templates/
18//! ci-pipeline/
19//! template.toml
20//! src/
21//! ci_pipeline.rs
22//! code-review/
23//! template.toml
24//! src/
25//! code_review.rs
26//! ```
27//!
28//! A repository dedicated to one template can keep `template.toml` and
29//! `src/` at its root instead:
30//!
31//! ```text
32//! gitlab-mr-review/
33//! template.toml
34//! src/
35//! mod.rs
36//! ```
37//!
38//! `template.toml` may also declare a `[requirements]` section (environment
39//! variables, workflow secrets, tools expected in the runner image, notes),
40//! printed after installation.
41//!
42//! # Quick start
43//!
44//! ```no_run
45//! use std::path::Path;
46//! use ironflow_templates::registry::discover_templates;
47//!
48//! # fn example() -> Result<(), ironflow_templates::error::TemplateError> {
49//! let templates = discover_templates(Path::new("./my-templates"))?;
50//! for (name, (manifest, _dir)) in &templates {
51//! println!("{name}: {}", manifest.template.description);
52//! }
53//! # Ok(())
54//! # }
55//! ```
56
57pub mod auto_register;
58pub mod deps;
59pub mod error;
60pub mod fetch;
61pub mod install;
62pub mod lockfile;
63pub mod manifest;
64pub mod registry;