use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Section {
pub id: String,
pub title: String,
pub file: String,
pub tags: Vec<String>,
pub perl: Option<String>,
pub flags: Vec<String>,
pub body: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub line: Option<usize>,
}
impl Section {
pub fn has_tag(&self, tag: &str) -> bool {
self.tags.iter().any(|t| t == tag)
}
pub fn has_flag(&self, flag: &str) -> bool {
self.flags.iter().any(|f| f == flag)
}
}