cosy 0.1.1

A parser for Cosense/Scrapbox markup syntax that produces a typed AST
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! A basic example of parsing cosense syntax using the `cosy`.
//!
//! This example shows how to use the default `parse` function to process
//! a string containing consense-style markup and links.

fn main() {
    let input = "[* ある日の暮方]の事である。一人の[下人]が、[羅生門 https://ja.wikipedia.org/wiki/%E7%BE%85%E7%94%9F%E9%96%80_(%E5%B0%8F%E8%AA%AC)]の下で雨やみを待っていた。";

    let result = cosy::parse(input, &());

    match result {
        Ok(nodes) => println!("{:#?}", nodes),
        Err(e) => println!("Error: {}", e),
    }
}