Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ obsidian-rs = { git = "https://github.com/adamisrael/obsidian-rs.git" }
# obsidian-rs = { path = "../obsidian-rs" }
rand = "0.9.1"
thiserror = "2.0.12"
thousands = "0.2.0"
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use md2ms::constants;

use clap::Parser;
use thousands::Separable;
use yaml_front_matter::Document;

use std::path::PathBuf;
Expand Down Expand Up @@ -168,7 +169,7 @@ fn compile(ctx: &mut Context) -> Result<(), Md2msError> {

// If the author wants the word count, give them the exact count, not the approximate value.
if ctx.word_count {
println!("Exact word count: {}", wc.words);
println!("Exact word count: {}", wc.words.separate_with_commas());
return Ok(());
}

Expand Down Expand Up @@ -300,7 +301,7 @@ fn compile(ctx: &mut Context) -> Result<(), Md2msError> {
Paragraph::new()
.add_run(
Run::new()
.add_text(format!("about {nwc} words"))
.add_text(format!("about {} words", nwc.separate_with_commas()))
.size(constants::FONT_SIZE),
)
.align(AlignmentType::Right),
Expand Down
Loading