pub fn process_files(args: &Cli) -> Result<Vec<(String, Count)>>Expand description
Processes multiple Typst files and returns their counts.
Compiles each input file specified in the CLI arguments and collects the word and character counts for each file.
§Arguments
args- Command-line arguments containing input files and options
§Returns
A vector of tuples, each containing a file path (as a string) and its
corresponding Count, or an error if any file fails to compile.
§Errors
Returns an error if any of the input files:
- Cannot be read
- Fails to compile
- Contains syntax errors
§Examples
use typst_count::{process_files, cli::Cli};
use clap::Parser;
let args = Cli::parse();
let results = process_files(&args)?;
for (path, count) in results {
println!("{}: {} words", path, count.words);
}