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>
This commit is contained in:
Jarvis committed 2025-09-01 11:50:16 +02:00
1 parent 59f98a7e0f
commit 99f55b7ecb
6 files changed
+90 -20

No files matched your search

+5 -2
View File
@@ -93,9 +93,12 @@
margin
}
// Set page layout with conditional height based on export format
set page(
paper: paper,
margin: page-margin,
..if export_format == "single-page" { (height: auto,) } else { (:) },
numbering: pagenumbering,
header: context {
if counter(page).get().first() > 1 [
@@ -106,7 +109,7 @@
// Set text properties - Sans-serif for clean look
// Use UI-configured font if available, otherwise use template default
let body-font = if font != none and type(font) == "string" {
let body-font = if font != none and type(font) == str {
(font, "Concourse OT", "Helvetica Neue", "Arial", "sans-serif")
} else {
font
@@ -131,7 +134,7 @@
// Clean heading styles
// Use UI-configured heading font and size if available
let heading-font = if heading_font != none and type(heading_font) == "string" {
let heading-font = if heading_font != none and type(heading_font) == str {
(heading_font, "SF Pro Text", "Helvetica Neue", "Arial", "sans-serif")
} else if heading_font != none {
heading_font