From 95c32e28bfb5cdec978428dfcd0d073e85481fa0 Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Sun, 28 May 2023 21:58:39 -0500 Subject: [PATCH] updated: metaforge 0.1.1 -> 0.1.2 --- README.md | 3 +-- files/README/source/default.meta | 2 +- files/README/source/docs/flags.meta | 3 +++ files/README/source/index.meta | 6 ++--- src/options.rs | 40 ++++++++++++++--------------- tests/readme.rs | 1 + 6 files changed, 29 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 515eb5e..4614ad0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# metaforge - v0.1.1 +# metaforge - v0.1.2 a pattern driven static site generator for extensible snippet insertion. @@ -12,7 +12,6 @@ a pattern driven static site generator for extensible snippet insertion. $ cd metaforge $ cargo install --path . - ## about metaforge is a static site generator that lets you write something once, and re-use it diff --git a/files/README/source/default.meta b/files/README/source/default.meta index 3427222..3c3a9fb 100644 --- a/files/README/source/default.meta +++ b/files/README/source/default.meta @@ -1,5 +1,5 @@ ${ author = 'huck boles' - version = '0.1.1' + version = '0.1.2' home = './index.html' } diff --git a/files/README/source/docs/flags.meta b/files/README/source/docs/flags.meta index ed7f148..4a00fbf 100644 --- a/files/README/source/docs/flags.meta +++ b/files/README/source/docs/flags.meta @@ -19,6 +19,9 @@ ${ defaults to [root_dir]/pattern -f, --file builds a single file and outputs it to stdout + -l --parallel + enable parallel processing for faster build times + interleaves output from files in verbose mode -v, --verbose enable extra output. repeated flags give more info v => list source files/directories being created diff --git a/files/README/source/index.meta b/files/README/source/index.meta index 079d07b..8a2b159 100644 --- a/files/README/source/index.meta +++ b/files/README/source/index.meta @@ -4,11 +4,10 @@ ${ this is the documentation for metaforge, generated by metaforge itself. -currently it's unstyled html rendered by your browser, so it's pretty bare-bones, but -you can change that easily. +currently it's unstyled html rendered by your browser, so it's pretty bare-bones. open **files/README** in metaforge's repository and explore the source and pattern -files to get some examples. +files to get some examples of how this site works. you can change anything in the **README** directory and see how it affects the site once you rebuild it. @@ -22,4 +21,5 @@ you rebuild it. - [flags](docs/flags.html) ## versions +- 0.1.2: multithreading - 0.1.1: initial release diff --git a/src/options.rs b/src/options.rs index 5737de6..704d2cb 100644 --- a/src/options.rs +++ b/src/options.rs @@ -3,9 +3,9 @@ use eyre::Result; use std::path::PathBuf; #[derive(Parser, Debug)] -#[command(author = "Huck Boles")] -#[command(version = "0.1.1")] -#[command(about = "A customizable template driven static site generator")] +#[command(author = "huck boles")] +#[command(version = "0.1.2")] +#[command(about = "customizable template driven static site generator")] #[command(long_about = None)] pub struct Opts { /// root directory [current_dir] @@ -20,39 +20,39 @@ pub struct Opts { /// pattern directory [current_dir/pattern] #[arg(short, long, value_name = "PATTERN_DIR")] pub pattern: Option, - /// only build a single file + /// builds a single file and outputs on stdout #[arg(short, long, value_name = "FILENAME")] pub file: Option, - /// parallel processing - #[arg(long, default_value_t = false)] - pub parallel: bool, - /// create a new skeleton directory - #[arg(long, default_value_t = false)] - pub new: bool, + /// output filetype [html] + #[arg(short, long, value_name = "OUTPUT_FILETYPE")] + pub output: Option, + /// input filetype [markdown] + #[arg(short, long, value_name = "INPUT_FILETYPE")] + pub input: Option, /// enable extra output. repeated flags give more info #[arg(short, long, action = clap::ArgAction::Count)] pub verbose: u8, - /// minimal output + /// minimal output [false] #[arg(short, long, default_value_t = false)] pub quiet: bool, + /// enable parallel processing [false] + #[arg(short = 'l', long, default_value_t = false)] + pub parallel: bool, + /// create a new skeleton directory [false] + #[arg(long, default_value_t = false)] + pub new: bool, + /// clean build directory before building site [false] + #[arg(long, default_value_t = false)] + pub clean: bool, /// don't stop on file failure [false] #[arg(long, default_value_t = false)] pub force: bool, /// stop on undefined variables and arrays [false] #[arg(long, default_value_t = false)] pub undefined: bool, - /// clean build directory before building site [false] - #[arg(long, default_value_t = false)] - pub clean: bool, /// don't call pandoc on source files #[arg(long, default_value_t = false)] pub no_pandoc: bool, - /// output filetype [html] - #[arg(short, long, value_name = "OUTPUT_FILETYPE")] - pub output: Option, - /// input filetype [markdown] - #[arg(short, long, value_name = "INPUT_FILETYPE")] - pub input: Option, } #[derive(Debug, Clone, Default)] diff --git a/tests/readme.rs b/tests/readme.rs index a64228a..01279d7 100644 --- a/tests/readme.rs +++ b/tests/readme.rs @@ -13,6 +13,7 @@ fn readme() -> Result<()> { opts.build = dir.join("build"); opts.pattern = dir.join("pattern"); opts.clean = true; + opts.parallel = true; metaforge::build_site(&opts) } -- 2.45.2