- filetype = **STRING** - change the filetype of the output file
- equal_arrays = **BOOL** - if true, panics if arrays in the same pattern have different sizes
- pandoc = **BOOL** - toggles if pandoc is ran on this file to convert between filetypes, defaults to *true* in **source** dir, and *false* in **pattern** dir.
+- minify = **BOOL** - toggles html minification
### source
file.merge(&self.global);
match file.construct() {
Ok(str) => {
- fs::write(file.dest()?, minify(str.as_bytes(), &HTML_CFG))?;
+ if file.header.minify && self.opts.minify {
+ fs::write(file.dest()?, minify(str.as_bytes(), &HTML_CFG))?;
+ } else {
+ fs::write(file.dest()?, str)?;
+ }
}
Err(e) => {
// print a line to stderr about failure but continue with other files
pub pandoc: Option<bool>,
pub ignore: bool,
pub copy_only: bool,
+ pub minify: bool,
}
impl Header {
pandoc: None,
ignore: false,
copy_only: false,
+ minify: true,
}
}
}
"source" => header.source = val.to_string(),
"ignore" => header.ignore = val == "true",
"copy_only" => header.copy_only = val == "true",
+ "minify" => header.copy_only = val == "true",
_ => continue,
}
}
/// don't call pandoc on source files
#[arg(long, default_value_t = false)]
pub no_pandoc: bool,
+ /// don't minify resulting html
+ #[arg(long, default_value_t = false)]
+ pub no_minify: bool,
}
#[derive(Debug, Clone, Default)]
pub clean: bool,
pub no_pandoc: bool,
pub new: bool,
+ pub minify: bool,
}
impl Options {
clean: false,
no_pandoc: false,
new: false,
+ minify: true,
}
}
}
opts.no_pandoc = value.no_pandoc;
opts.new = value.new;
opts.parallel = value.parallel;
+ opts.minify = !value.no_minify;
opts.root = if let Some(root) = value.root.as_deref() {
PathBuf::from(root).canonicalize()