Skip to main content

yui/
render.rs

1//! Tera template rendering for `*.tera` files.
2//!
3//! Output goes to the **same directory** as the source `.tera` file (e.g.
4//! `home/.gitconfig.tera` → `home/.gitconfig`). When `manage_gitignore` is
5//! true, the rendered files are listed in a `# >>> yui rendered ... <<<`
6//! managed section of `.gitignore`.
7
8use camino::{Utf8Path, Utf8PathBuf};
9
10use crate::Result;
11use crate::config::Config;
12use crate::vars::YuiVars;
13
14#[derive(Debug, Default)]
15pub struct RenderReport {
16    pub written: Vec<Utf8PathBuf>,
17    pub skipped_when_false: Vec<Utf8PathBuf>,
18    /// Rendered counterpart already exists with diverged content (manual edit).
19    pub diverged: Vec<Utf8PathBuf>,
20}
21
22/// Render every `*.tera` under the source tree, honoring per-file
23/// `{# yui:when ... #}` headers and `[[render.rule]]` config entries.
24pub fn render_all(_source: &Utf8Path, _config: &Config, _vars: &YuiVars) -> Result<RenderReport> {
25    todo!("render::render_all")
26}