feat(md-print): add A4/A5 multi-column print layout
Add an md-print element that paginates markdown into A4 landscape sheets holding two A5 pages, each with configurable columns. The preview modal exports through the browser print dialog. Paragraphs, lists, and tables split at word, item, and row boundaries; headings are kept with following content.
This commit is contained in:
@@ -67,6 +67,28 @@ export const KNOWN_ELEMENTS: readonly ElementSpec[] = [
|
||||
':md-deck[./cards.csv]{size="63x88" grid="5x5" layers="title:1,1-5,1f8 body:1,5-5,8f3"}',
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "md-print",
|
||||
body: "markdown path, optional #section",
|
||||
attrs: [
|
||||
"columns",
|
||||
"margin",
|
||||
"gap",
|
||||
"font",
|
||||
"title",
|
||||
"pageNumbers",
|
||||
"cutMarks",
|
||||
],
|
||||
summary:
|
||||
"Paginates a markdown document into A4 landscape sheets for printing.",
|
||||
details:
|
||||
"Each sheet holds two A5 pages side by side, and each A5 page flows the markdown into `columns` columns. `margin` and `gap` are in millimetres, `font` is in points. `pageNumbers` adds an `n / total` footer and `cutMarks` draws the centre cut line. The preview modal exports through the browser's print dialog (choose A4 landscape, no margins, 100% scale).",
|
||||
refKind: "md",
|
||||
examples: [
|
||||
':md-print[./rules.md]{columns="2" margin="10" gap="5" font="9"}',
|
||||
"```yaml role=tag\ntag: md-print\nbody: ./rules.md\ncolumns: 2\nmargin: 10\ngap: 5\nfont: 9\ntitle: 规则书\n```",
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "md-link",
|
||||
body: "path, optional #section",
|
||||
|
||||
Reference in New Issue
Block a user