pub(super) fn name_of(p: &str) -> &str {
p.rsplit('/').next().unwrap_or(p)
}
pub(super) fn stem_of(p: &str) -> &str {
name_of(p).trim_end_matches(".md")
}
pub(super) fn strip_number(title: &str) -> String {
let digits = title.chars().take_while(char::is_ascii_digit).count();
match title[digits..].strip_prefix('.') {
Some(rest) if digits > 0 && !rest.trim().is_empty() => rest.trim().to_string(),
_ => title.to_string(),
}
}