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>
This commit is contained in:
6 files changed
+816
-206
No files matched your search
+171
-36
@@ -1,3 +1,57 @@
|
||||
// Email block styling function
|
||||
#let email-block(from: none, to: none, subject: none, date: none, body) = {
|
||||
block(
|
||||
width: 100%,
|
||||
inset: 8pt,
|
||||
fill: rgb("#f1f5f9"),
|
||||
stroke: 1pt + rgb("#cbd5e1"),
|
||||
radius: 6pt,
|
||||
breakable: true
|
||||
)[
|
||||
#grid(
|
||||
columns: (auto, 1fr),
|
||||
row-gutter: 4pt,
|
||||
column-gutter: 12pt,
|
||||
if from != none [
|
||||
#text(style: "italic", size: 0.85em, fill: rgb("#64748b"))[From:]
|
||||
] else [],
|
||||
if from != none [
|
||||
#text(size: 0.9em, weight: "medium")[#from]
|
||||
] else [],
|
||||
if to != none [
|
||||
#text(style: "italic", size: 0.85em, fill: rgb("#64748b"))[To:]
|
||||
] else [],
|
||||
if to != none [
|
||||
#text(size: 0.9em, weight: "medium")[#to]
|
||||
] else [],
|
||||
if subject != none [
|
||||
#text(style: "italic", size: 0.85em, fill: rgb("#64748b"))[Subject:]
|
||||
] else [],
|
||||
if subject != none [
|
||||
#text(size: 0.9em, weight: "semibold")[#subject]
|
||||
] else [],
|
||||
if date != none [
|
||||
#text(style: "italic", size: 0.85em, fill: rgb("#64748b"))[Date:]
|
||||
] else [],
|
||||
if date != none [
|
||||
#text(size: 0.9em)[#date]
|
||||
] else [],
|
||||
)
|
||||
#if body != none [
|
||||
#v(6pt)
|
||||
#block(
|
||||
width: 100%,
|
||||
inset: (left: 8pt, top: 8pt, bottom: 4pt),
|
||||
stroke: (left: 3pt + rgb("#3b82f6")),
|
||||
fill: white,
|
||||
radius: (right: 4pt),
|
||||
)[
|
||||
#body
|
||||
]
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
#let conf(
|
||||
title: none,
|
||||
authors: (),
|
||||
@@ -5,85 +59,166 @@
|
||||
lang: "en",
|
||||
region: "US",
|
||||
paper: "a4",
|
||||
margin: (x: 2.5cm, y: 2cm),
|
||||
cols: 1,
|
||||
font: ("Times New Roman"),
|
||||
margin: (x: 2cm, y: 2.5cm),
|
||||
cols: 2,
|
||||
font: ("Concourse OT", "Georgia", "Times New Roman", "serif"),
|
||||
fontsize: 11pt,
|
||||
sectionnumbering: "1.",
|
||||
sectionnumbering: none,
|
||||
pagenumbering: "1",
|
||||
// Support for UI-configurable options
|
||||
heading_font: none,
|
||||
monospace_font: none,
|
||||
heading_fontsize: none,
|
||||
small_fontsize: none,
|
||||
margin_top: none,
|
||||
margin_right: none,
|
||||
margin_bottom: none,
|
||||
margin_left: none,
|
||||
orientation: "portrait",
|
||||
export_format: none,
|
||||
doc,
|
||||
) = {
|
||||
// Set document properties
|
||||
set document(
|
||||
title: title
|
||||
// Skip author in document metadata to avoid type issues
|
||||
)
|
||||
|
||||
// Set page layout
|
||||
// Magazine-style layout with header
|
||||
// Use UI-configured margins if available, otherwise fall back to template defaults
|
||||
let page-margin = if margin_top != none {
|
||||
(
|
||||
top: if margin_top != none { margin_top } else { 2.5cm },
|
||||
right: if margin_right != none { margin_right } else { 2cm },
|
||||
bottom: if margin_bottom != none { margin_bottom } else { 2.5cm },
|
||||
left: if margin_left != none { margin_left } else { 2cm },
|
||||
)
|
||||
} else {
|
||||
margin
|
||||
}
|
||||
|
||||
set page(
|
||||
paper: paper,
|
||||
margin: margin,
|
||||
numbering: pagenumbering
|
||||
margin: page-margin,
|
||||
numbering: pagenumbering,
|
||||
header: context {
|
||||
if counter(page).get().first() > 1 [
|
||||
#line(length: 100%, stroke: 0.5pt + rgb("#2563eb"))
|
||||
#v(-0.5em)
|
||||
#grid(
|
||||
columns: (1fr, auto, 1fr),
|
||||
[],
|
||||
text(9pt, fill: rgb("#2563eb"), style: "italic")[#title],
|
||||
align(right)[#text(9pt)[#counter(page).display("1")]]
|
||||
)
|
||||
#v(0.5em)
|
||||
#line(length: 100%, stroke: 0.5pt + rgb("#2563eb"))
|
||||
]
|
||||
}
|
||||
)
|
||||
|
||||
// Set text properties
|
||||
// Mixed fonts - serif body, sans-serif headings
|
||||
// Use UI-configured font if available, otherwise use template default
|
||||
let body-font = if font != none and type(font) == "string" {
|
||||
(font, "Concourse OT", "Georgia", "Times New Roman", "serif")
|
||||
} else {
|
||||
font
|
||||
}
|
||||
|
||||
let body-fontsize = fontsize
|
||||
|
||||
set text(
|
||||
font: font,
|
||||
size: fontsize,
|
||||
font: body-font,
|
||||
size: body-fontsize,
|
||||
lang: lang,
|
||||
region: region
|
||||
)
|
||||
|
||||
// Set paragraph properties
|
||||
set par(justify: true, leading: 0.65em, first-line-indent: 1.2em)
|
||||
// Magazine-style paragraphs
|
||||
set par(justify: true, leading: 0.7em, first-line-indent: 0.8em)
|
||||
|
||||
// Set heading numbering
|
||||
// No heading numbering for magazine style
|
||||
if sectionnumbering != none {
|
||||
set heading(numbering: sectionnumbering)
|
||||
}
|
||||
|
||||
// Custom heading styles for article
|
||||
// Magazine-style heading styles
|
||||
// Use UI-configured heading font and size if available
|
||||
let heading-font = if heading_font != none and type(heading_font) == "string" {
|
||||
(heading_font, "SF Pro Text", "Helvetica Neue", "Arial", "sans-serif")
|
||||
} else if heading_font != none {
|
||||
heading_font
|
||||
} else {
|
||||
("SF Pro Text", "Helvetica Neue", "Arial", "sans-serif")
|
||||
}
|
||||
|
||||
let heading-fontsize = if heading_fontsize != none { heading_fontsize } else { 15pt }
|
||||
|
||||
show heading.where(level: 1): it => block(
|
||||
width: 100%,
|
||||
below: 1.5em,
|
||||
above: 2em,
|
||||
below: 1.2em,
|
||||
above: 1.8em,
|
||||
fill: rgb("#f8fafc"),
|
||||
inset: 8pt,
|
||||
radius: 4pt,
|
||||
stroke: 1pt + rgb("#e2e8f0"),
|
||||
)[
|
||||
#set align(center)
|
||||
#set text(16pt, weight: "bold")
|
||||
#it.body
|
||||
#set align(left)
|
||||
#set text(font: heading-font, size: heading-fontsize, weight: "bold", fill: rgb("#1e40af"))
|
||||
#block(
|
||||
width: 100%,
|
||||
inset: (bottom: 4pt),
|
||||
stroke: (bottom: 2pt + rgb("#3b82f6")),
|
||||
)[#it.body]
|
||||
]
|
||||
|
||||
show heading.where(level: 2): it => block(
|
||||
width: 100%,
|
||||
below: 1em,
|
||||
above: 1.5em,
|
||||
below: 0.8em,
|
||||
above: 1.2em,
|
||||
)[
|
||||
#set text(13pt, weight: "bold")
|
||||
#it
|
||||
#set text(font: heading-font, size: heading-fontsize * 0.87, weight: "semibold", fill: rgb("#1e40af"))
|
||||
#it.body #h(0.5em) #line(length: 3cm, stroke: 1pt + rgb("#93c5fd"))
|
||||
]
|
||||
|
||||
// Title block
|
||||
|
||||
// Decorative title block with background
|
||||
if title != none and title != "" [
|
||||
#align(center, text(20pt, weight: "bold")[#title])
|
||||
#v(1em)
|
||||
#block(
|
||||
width: 100%,
|
||||
fill: gradient.linear(rgb("#1e40af"), rgb("#3b82f6")),
|
||||
inset: 16pt,
|
||||
radius: 8pt,
|
||||
)[
|
||||
#align(center, text(22pt, weight: "bold", fill: white)[#title])
|
||||
]
|
||||
#v(1.2em)
|
||||
]
|
||||
|
||||
// Authors (handle Pandoc author structure)
|
||||
// Authors in magazine style
|
||||
if authors != () and authors != none [
|
||||
#align(center, text(14pt)[
|
||||
#for author in authors [
|
||||
#align(center, text(
|
||||
font: ("SF Pro Text", "Helvetica Neue", "Arial", "sans-serif"),
|
||||
13pt,
|
||||
style: "italic",
|
||||
fill: rgb("#64748b")
|
||||
)[
|
||||
By #for author in authors [
|
||||
#if author.name != none and author.name != "" [#author.name]
|
||||
]
|
||||
])
|
||||
#v(0.5em)
|
||||
#v(0.6em)
|
||||
]
|
||||
|
||||
// Date
|
||||
// Date with styling
|
||||
if date != none [
|
||||
#align(center, text(12pt)[#date])
|
||||
#v(2em)
|
||||
#align(center, text(
|
||||
10pt,
|
||||
style: "italic",
|
||||
fill: rgb("#64748b")
|
||||
)[#date])
|
||||
#v(1.8em)
|
||||
]
|
||||
|
||||
// Document content
|
||||
doc
|
||||
// Two-column layout for content
|
||||
columns(cols, gutter: 1.2em)[#doc]
|
||||
}
|
||||
Reference in new issue
Block a user