markdown-ast 0.1.1

Markdown AST representation for document construction and transformation, based on pulldown-cmark.
Documentation
use std::io::Read;

use markdown_ast::markdown_to_ast;

fn main() {
    let mut stdin = std::io::stdin().lock();

    let mut content = String::new();
    stdin.read_to_string(&mut content).unwrap();

    // If this doesn't fail with a panic, that implies that the flat
    // pulldown-cmark event stream was successfully converted into a sequence
    // of structured markdown_ast::Block's.
    let _ = markdown_to_ast(&content);

    // TODO:
    //  Test converting this back to a string and verify the orginal
    //  matches the processed output. Currently
    //  pulldown-cmark / pulldown-cmark-to-cmark do a lossy conversion.
}