markdown_ai_cite_remove/
config.rs1#[derive(Debug, Clone)]
3pub struct RemoverConfig {
4 pub remove_inline_citations: bool,
6
7 pub remove_reference_links: bool,
9
10 pub remove_reference_headers: bool,
12
13 pub remove_reference_entries: bool,
15
16 pub normalize_whitespace: bool,
18
19 pub remove_blank_lines: bool,
21
22 pub trim_lines: bool,
24}
25
26impl Default for RemoverConfig {
27 fn default() -> Self {
28 Self {
29 remove_inline_citations: true,
30 remove_reference_links: true,
31 remove_reference_headers: true,
32 remove_reference_entries: true,
33 normalize_whitespace: true,
34 remove_blank_lines: true,
35 trim_lines: true,
36 }
37 }
38}
39
40impl RemoverConfig {
41 pub fn new() -> Self {
43 Self::default()
44 }
45
46 pub fn inline_only() -> Self {
48 Self {
49 remove_inline_citations: true,
50 remove_reference_links: false,
51 remove_reference_headers: false,
52 remove_reference_entries: false,
53 normalize_whitespace: true,
54 remove_blank_lines: false,
55 trim_lines: true,
56 }
57 }
58
59 pub fn references_only() -> Self {
61 Self {
62 remove_inline_citations: false,
63 remove_reference_links: true,
64 remove_reference_headers: true,
65 remove_reference_entries: true,
66 normalize_whitespace: true,
67 remove_blank_lines: true,
68 trim_lines: true,
69 }
70 }
71}
72
73#[derive(Debug, Clone, Copy, PartialEq, Eq)]
75pub enum RemovalMode {
76 All,
78 InlineOnly,
80 ReferencesOnly,
82}