pubmed_formatter/pmc/markdown/
config.rs1#[derive(Debug, Clone)]
3pub struct MetadataOptions {
4 pub include_metadata: bool,
6 pub use_yaml_frontmatter: bool,
8 pub include_orcid_links: bool,
10 pub include_identifier_links: bool,
12}
13
14impl Default for MetadataOptions {
15 fn default() -> Self {
16 Self {
17 include_metadata: true,
18 use_yaml_frontmatter: false,
19 include_orcid_links: true,
20 include_identifier_links: true,
21 }
22 }
23}
24
25#[derive(Debug, Clone)]
27pub struct FigureOptions {
28 pub include_figure_captions: bool,
30 pub include_local_figures: bool,
32}
33
34impl Default for FigureOptions {
35 fn default() -> Self {
36 Self {
37 include_figure_captions: true,
38 include_local_figures: false,
39 }
40 }
41}
42
43#[derive(Debug, Clone)]
45pub struct MarkdownConfig {
46 pub metadata: MetadataOptions,
48 pub figures: FigureOptions,
50 pub include_toc: bool,
52 pub heading_style: HeadingStyle,
54 pub reference_style: ReferenceStyle,
56 pub max_heading_level: u8,
58}
59
60#[derive(Debug, Clone, PartialEq)]
62pub enum HeadingStyle {
63 ATX,
65 Setext,
67}
68
69#[derive(Debug, Clone, PartialEq)]
71pub enum ReferenceStyle {
72 Numbered,
74 AuthorYear,
76 FullCitation,
78}
79
80impl Default for MarkdownConfig {
81 fn default() -> Self {
82 Self {
83 metadata: MetadataOptions::default(),
84 figures: FigureOptions::default(),
85 include_toc: false,
86 heading_style: HeadingStyle::ATX,
87 reference_style: ReferenceStyle::Numbered,
88 max_heading_level: 6,
89 }
90 }
91}