mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-23 04:35:00 +00:00
feat: support creation-timestamp configuration for exporting PDF (#439)
* feat: support creation-timestamp configuration for exporting PDF * fix: respect config
This commit is contained in:
parent
25c449c2b2
commit
103e0f3b3e
11 changed files with 97 additions and 16 deletions
|
@ -143,10 +143,11 @@ mod polymorphic {
|
|||
Merged,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum ExportKind {
|
||||
#[default]
|
||||
Pdf,
|
||||
Pdf {
|
||||
creation_timestamp: Option<chrono::DateTime<chrono::Utc>>,
|
||||
},
|
||||
Svg {
|
||||
page: PageSelection,
|
||||
},
|
||||
|
@ -155,10 +156,18 @@ mod polymorphic {
|
|||
},
|
||||
}
|
||||
|
||||
impl Default for ExportKind {
|
||||
fn default() -> Self {
|
||||
Self::Pdf {
|
||||
creation_timestamp: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ExportKind {
|
||||
pub fn extension(&self) -> &str {
|
||||
match self {
|
||||
Self::Pdf => "pdf",
|
||||
Self::Pdf { .. } => "pdf",
|
||||
Self::Svg { .. } => "svg",
|
||||
Self::Png { .. } => "png",
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue