Skip to content

Commit

Permalink
refactor: Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Mar 28, 2024
1 parent 3aebbe1 commit 97491d3
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,34 @@ use std::path::PathBuf;

use anyhow::Result;
use tera::{Context, Tera};

/**
* File writer.
*/

pub struct Writer {
context: Context,
targets: HashMap<String, WriteTarget>,
}

/**
* Writing target context per files.
*/
pub struct WriteTarget {
/** Target filepath. */
path: PathBuf,
/** Replacement ruleset. */
rules: Vec<WriteRule>,
}

/**
* Replacement rule component.
*
* Writing proc refer 'search' and 'replace' as pair.
*/
pub struct WriteRule {
/**
* Search target.
*
* Value is rendered by Tera.
*/
/** Search target that is rendered by Tera. */
pub search: String,
/**
* Replacement content.
*
* Value is rendered by Tera.
*/
/** Replacement content that is rendered by Tera. */
pub replace: String,
}

Expand Down

0 comments on commit 97491d3

Please sign in to comment.