#[macro_use] extern crate lazy_static; mod walker; use pathdiff::diff_paths; use percent_encoding::{utf8_percent_encode, AsciiSet, CONTROLS}; use pulldown_cmark::{CodeBlockKind, CowStr, Event, Options, Parser, Tag}; use pulldown_cmark_to_cmark::{self, cmark_with_options}; use rayon::prelude::*; use regex::Regex; use snafu::{ResultExt, Snafu}; use std::ffi::OsString; use std::fs::{self, File}; use std::io::prelude::*; use std::io::ErrorKind; use std::path::{Path, PathBuf}; use std::str; use walker::{vault_contents, WalkOptions}; type Result = std::result::Result; type MarkdownTree<'a> = Vec>; lazy_static! { static ref OBSIDIAN_NOTE_LINK_RE: Regex = Regex::new(r"^(?P[^#|]+)(#(?P.+?))??(\|(?P