notedown_ast 0.7.5

notedown ast and converter
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::{ast::highlighter::Highlighter, Command, CommandKind, Value};
use std::collections::HashMap;

impl From<Highlighter> for Command {
    fn from(h: Highlighter) -> Self {
        let mut kvs: HashMap<String, Value> = Default::default();
        kvs.insert("body".to_string(), Value::String(h.code.into()));
        Command { cmd: h.lang, args: vec![], kvs, kind: CommandKind::SmartLink }
    }
}