Commit Graph
8 Commits
Author SHA1 Message Date
Jarvis 034d4ffba4 fix: resolve horizontal rule YAML parsing conflicts
Fixes issue where horizontal rules (---) in markdown were causing
"Error parsing YAML metadata" when exporting to PDF via Pandoc.

Changes:
- Add HorizontalRuleProcessor to transform --- to *** before Pandoc
- Preserve YAML frontmatter by detecting and skipping frontmatter sections
- Add horizontalrule definition to all Typst templates for Pandoc compatibility
- Update universal wrapper to import horizontalrule from templates
- Clean up PandocTypstConverter formatting and remove debug output

The processor now detects YAML frontmatter patterns and only transforms
horizontal rules in content body, preventing destruction of document
frontmatter while resolving Pandoc parsing conflicts.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 22:51:10 +02:00
AlexKucera 8678e110b9 Standardizes heading font size calculation
Removes configurable heading and small font sizes, and calculates the heading font size based on the body font size to ensure consistency across templates.
2025-09-03 16:56:53 +02:00
AlexKucera fca8f8104d Simplifies font stacks in templates
Refines font configurations in article and modern templates.
Removes redundant "serif" and "sans-serif" generic families from the font stacks.
This change results in cleaner and more efficient font declarations.
2025-09-03 11:23:52 +02:00
Jarvis 305df30c85 fix: replace invalid orientation parameter with flipped in Typst templates
- Replace orientation: orientation with flipped: orientation == "landscape"
- Add conditional width: auto for single-page landscape exports
- Ensure all templates use correct Typst page() parameters
- Fix compilation errors in modern, article, report, and default templates

Resolves Typst compilation error: "unexpected argument: orientation"

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 10:49:19 +02:00
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