orgize 0.9.0

A Rust library for parsing orgmode files.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use orgize::Org;
use serde_json::to_string;
use std::env::args;
use std::fs;
use std::io::Result;

fn main() -> Result<()> {
    let args: Vec<_> = args().collect();

    if args.len() < 2 {
        eprintln!("Usage: {} <org-file>", args[0]);
    } else {
        let contents = String::from_utf8(fs::read(&args[1])?).unwrap();
        println!("{}", to_string(&Org::parse(&contents)).unwrap());
    }
    Ok(())
}