Skip to main content

Module utils

Module utils 

Source

Functionsยง

color_discourse_label
ensure_dir
Ensure a directory exists.
normalize_baseurl
Trim trailing slashes from a base URL.
parse_relative_duration
Parse a relative duration like 7d, 24h, 1w, 1m, 90s, 1y.
parse_since_cutoff
Parse a --since-style value. Accepts either a relative duration (7d, 24h, 30m, 1w, 90s) or an ISO-8601 absolute timestamp (2026-04-01, 2026-04-01T12:00:00Z). Returns the resulting cutoff instant (now - duration, or the ISO value itself).
read_markdown
Read a Markdown file.
resolve_topic_path
Resolve a topic path from a user-provided path and a topic title.
slugify
Create a URL-safe slug from arbitrary input.
write_markdown
Write a Markdown file, creating parent directories if needed.