use serde::{Deserialize, Serialize};
use std::collections::HashSet;
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
pub struct Grammar {
pub admin: bool,
pub depth: Option<u8>,
pub emphasis: bool,
pub icons: HashSet<String>,
pub links: HashSet<String>,
pub r#mod: bool,
pub quote: bool,
pub spoiler: bool,
pub strong: bool,
pub strikethrough: bool,
}
impl Grammar {
pub fn full() -> Self {
Self {
admin: true,
emphasis: true,
depth: Some(4),
icons: {
let mut icons = HashSet::new();
icons.insert(String::from("etwin"));
icons
},
links: {
let mut links = HashSet::new();
links.insert(String::from("http"));
links.insert(String::from("https"));
links
},
r#mod: true,
quote: true,
spoiler: true,
strong: true,
strikethrough: true,
}
}
}