use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Hash)]
pub struct NoteVariant {
pub extension: String,
pub name: String,
pub show_content: bool,
}
impl NoteVariant {
pub fn new<S, T>(extension: S, name: T, show_content: bool) -> Self
where
S: Into<String>,
T: Into<String>,
{
Self {
extension: extension.into(),
name: name.into(),
show_content,
}
}
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct Configuration {
pub directory: String,
pub filename: String,
pub title_format: String,
pub issue_format: String,
pub variant: Vec<NoteVariant>,
}
impl Configuration {
pub fn new<S, T, U, V>(
directory: S,
filename: T,
title_format: U,
issue_format: V,
variants: Vec<NoteVariant>,
) -> Self
where
S: Into<String>,
T: Into<String>,
U: Into<String>,
V: Into<String>,
{
Self {
directory: directory.into(),
filename: filename.into(),
title_format: title_format.into(),
issue_format: issue_format.into(),
variant: variants,
}
}
}