RustyDiary is a Rust utility that helps you merge dated Markdown files into a single chronological log. It's perfect for combining daily notes, journal entries, or any date-stamped Markdown files.
- 📅 Automatically detects and merges files with date-based names (YYYY-MM-DD.md)
- ⬇️ Sorts entries in reverse chronological order (newest first)
- 🔄 Preserves existing content in the output file
- ⚙️ Configurable separators between entries
- 🛡️ Robust error handling and validation
-
Ensure you have Rust installed on your system. If not, install it from rustup.rs.
-
Clone this repository:
git clone [your-repository-url]
cd rusty-diary
- Build the project:
cargo build --release
The compiled binary will be available in target/release/rusty-diary
.
Basic usage (current directory):
rusty-diary
Specify a different directory:
rusty-diary /path/to/your/files
Files should follow the pattern: YYYY-MM-DD.md
Examples:
2024-01-01.md
2024-12-31.md
The default configuration can be modified by creating a custom Config
instance:
let config = Config {
directory: PathBuf::from("your/path"),
date_pattern: String::from(r"^\d{4}-\d{2}-\d{2}(\.md)?$"),
output_filename: String::from("writing-log.md"),
separator: String::from("\n---\n"),
};
- Rust (latest stable version)
- Cargo (comes with Rust)
regex
: For pattern