#[derive(Debug, Clone)]
pub struct RemoverConfig {
pub remove_inline_citations: bool,
pub remove_reference_links: bool,
pub remove_reference_headers: bool,
pub remove_reference_entries: bool,
pub normalize_whitespace: bool,
pub remove_blank_lines: bool,
pub trim_lines: bool,
}
impl Default for RemoverConfig {
fn default() -> Self {
Self {
remove_inline_citations: true,
remove_reference_links: true,
remove_reference_headers: true,
remove_reference_entries: true,
normalize_whitespace: true,
remove_blank_lines: true,
trim_lines: true,
}
}
}
impl RemoverConfig {
pub fn new() -> Self {
Self::default()
}
pub fn inline_only() -> Self {
Self {
remove_inline_citations: true,
remove_reference_links: false,
remove_reference_headers: false,
remove_reference_entries: false,
normalize_whitespace: true,
remove_blank_lines: false,
trim_lines: true,
}
}
pub fn references_only() -> Self {
Self {
remove_inline_citations: false,
remove_reference_links: true,
remove_reference_headers: true,
remove_reference_entries: true,
normalize_whitespace: true,
remove_blank_lines: true,
trim_lines: true,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RemovalMode {
All,
InlineOnly,
ReferencesOnly,
}