diaryx 1.4.0

Command-line interface for Diaryx journal management
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::env;
use std::fs;
use std::path::Path;

use diaryx_core::frontmatter::extract_body;

fn main() {
    println!("cargo:rerun-if-changed=README.md");

    let readme = fs::read_to_string("README.md").expect("Failed to read README.md");

    let body = extract_body(&readme);

    let out_dir = env::var("OUT_DIR").unwrap();
    fs::write(Path::new(&out_dir).join("README.md"), body).expect("Failed to write README.md");
}