about summary refs log tree commit diff
path: root/templates-neo/src/main.rs
blob: d374e3f0b975fe8cf2a60b6f11b3c101e4292e89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![recursion_limit = "512"]
use std::io::Write;

use kittybox_html::mf2::Entry;

fn main() {
    let mf2 = serde_json::from_reader::<_, microformats::types::Item>(std::io::stdin()).unwrap();
    let entry = Entry::try_from(mf2).unwrap();

    let mut article = html::content::Article::builder();
    entry.build(&mut article);

    let mut stdout = std::io::stdout().lock();
    stdout
        .write_all(article.build().to_string().as_bytes())
        .unwrap();
    stdout.write_all(b"\n").unwrap();
}