feat: refactor export system and improve PDF/email handling
Major improvements to PDF export functionality and code organization: - BREAKING: Refactor main.ts from 4224 to 994 lines by extracting modular components - Replace broken PDF links with proper Typst pdf.embed() attachments - Filter out unnecessary "Open:" links and Mail.app links from exports - Fix duplicate title issue by replacing frontmatter title with filename - Move temp file processing from system temp to plugin folder - Clean up temp-images and temp-pandoc directories after export - Remove timestamp from export filenames to match note names exactly - Handle Unicode line separators (0x2028, 0x2029) in email content - Improve markdown preprocessing with better frontmatter handling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
20 files changed
+7166
-3936
No files matched your search
+17
-18
@@ -90,25 +90,16 @@
|
||||
} else {
|
||||
margin
|
||||
}
|
||||
|
||||
|
||||
// Set page layout with conditional height based on export format
|
||||
if export_format == "single-page" {
|
||||
set page(
|
||||
paper: paper,
|
||||
margin: page-margin,
|
||||
height: auto, // Auto height for continuous single page
|
||||
numbering: pagenumbering,
|
||||
fill: rgb("#fafafa")
|
||||
)
|
||||
} else {
|
||||
set page(
|
||||
paper: paper,
|
||||
margin: page-margin,
|
||||
// No height specified = uses default paper size height
|
||||
numbering: pagenumbering,
|
||||
fill: rgb("#fafafa")
|
||||
)
|
||||
}
|
||||
set page(
|
||||
paper: paper,
|
||||
orientation: orientation,
|
||||
margin: (top: 2.5cm, right: 1.5cm, bottom: 2cm, left: 2.5cm),
|
||||
..if export_format == "single-page" { (height: auto,) } else { (:) },
|
||||
numbering: pagenumbering,
|
||||
fill: rgb("#fafafa")
|
||||
)
|
||||
|
||||
// Modern sans-serif fonts
|
||||
// Use UI-configured font if available, otherwise use template default
|
||||
@@ -179,6 +170,14 @@
|
||||
#it.body
|
||||
]
|
||||
|
||||
// Apply monospace font to code blocks and inline code
|
||||
let code-font = if monospace_font != none and type(monospace_font) == str {
|
||||
(monospace_font, "Courier New", "Monaco")
|
||||
} else {
|
||||
("Courier New", "Monaco")
|
||||
}
|
||||
|
||||
show raw: set text(font: code-font)
|
||||
|
||||
// Modern title header with sidebar design
|
||||
if title != none and title != "" [
|
||||
|
||||
Reference in new issue
Block a user