Commit Graph
4 Commits
Author SHA1 Message Date
Jarvis 172a69161d 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>
2025-09-02 17:16:55 +02:00
Jarvis 99f55b7ecb feat: implement universal wrapper for proper export format variable passing
- Add universal Pandoc wrapper template to handle variable substitution
- Fix export_format variable not reaching Typst templates via -V flag
- Implement single-page/multi-page format selection functionality
- Update all templates to use conditional height parameter with spread operator
- Add pluginDir to PandocOptions for proper wrapper path resolution

Technical changes:
- Create templates/universal-wrapper.pandoc.typ for Pandoc template system
- Modify buildPandocArgs to use --template instead of -V template=
- Update page layout logic in all templates using ..if export_format == "single-page"
- Replace duplicate conditional set page() blocks with single streamlined approach
- Fix type checking issues (string -> str) for consistency

Templates updated:
- default.typ: Clean minimal style with conditional height
- article.typ: Magazine-style layout with conditional height
- report.typ: Professional business format with conditional height
- modern.typ: Renamed from single-page.typ for better naming consistency

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 11:50:16 +02:00
Jarvis 4a7831d86f refactor: remove non-functional export mode dropdown
Remove the export mode dropdown from both export modal and settings
since switching between "typography" and "style-preserving" modes
had no actual effect on PDF output.

Changes:
- Remove ExportMode enum and all references
- Remove export mode UI from modal and settings tab
- Clean up unused export_mode parameter from templates
- Remove export_mode variable passing to Pandoc
- Add "sharp" to esbuild external dependencies

This simplifies the UI and removes confusing options that didn't
work, focusing users on the functional typography settings instead.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 10:45:57 +02:00
Jarvis b9fb1a455f feat: add PDF embed support with first-page preview generation
- Implement PdfToImageConverter using pdf-to-img CLI for PDF-to-image conversion
- Add PDF embed detection and processing in MarkdownPreprocessor
- Generate first-page preview images for PDF embeds in exported documents
- Copy generated images to vault location for Typst accessibility
- Add --embed-resources flag to Pandoc for proper resource embedding
- Support both image and PDF attachments in exported documents

Fixes issue where PDF exports only contained text without attachments.
PDF embeds now show visual previews like Obsidian's native behavior.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 14:39:57 +02:00