Switch PDF generation from Typst to WeasyPrint to match typst-templates layout.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,24 +1,5 @@
|
||||
-- Render ::: {.summary-box} as a Typst block matching HTML table chrome.
|
||||
-- ::: {.summary-box} is styled by CSS for HTML/PDF (WeasyPrint).
|
||||
-- No AST rewrite needed.
|
||||
function Div(el)
|
||||
if not el.classes:includes("summary-box") then
|
||||
return nil
|
||||
end
|
||||
if not quarto.doc.is_format("typst") then
|
||||
return nil
|
||||
end
|
||||
|
||||
local inner = pandoc.write(pandoc.Pandoc(el.content), "typst")
|
||||
inner = inner:gsub("^%s+", ""):gsub("%s+$", "")
|
||||
local typst = string.format([[
|
||||
#block(
|
||||
width: 100%%,
|
||||
inset: 12pt,
|
||||
radius: 8pt,
|
||||
stroke: 0.5pt + rgb("#d0d7de"),
|
||||
fill: rgb("#f6f8fa"),
|
||||
)[
|
||||
%s
|
||||
]
|
||||
]], inner)
|
||||
return pandoc.RawBlock("typst", typst)
|
||||
return nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user