Add postcard and postcard small templates
This commit is contained in:
parent
b4ec250ce1
commit
1d1c0d6139
12
cards_lettersheet.typ
Normal file
12
cards_lettersheet.typ
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#{
|
||||||
|
set page("us-letter", margin: 0em)
|
||||||
|
|
||||||
|
import "common.typ"
|
||||||
|
|
||||||
|
let options = json("options.json")
|
||||||
|
let cards = options.cards
|
||||||
|
let args = options.args
|
||||||
|
|
||||||
|
common.card_sheets(6in, 4in, 1in/16, args, cards)
|
||||||
|
|
||||||
|
}
|
12
cards_small_lettersheet.typ
Normal file
12
cards_small_lettersheet.typ
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#{
|
||||||
|
set page("us-letter", margin: 0em)
|
||||||
|
|
||||||
|
import "common.typ"
|
||||||
|
|
||||||
|
let options = json("options.json")
|
||||||
|
let cards = options.cards
|
||||||
|
let args = options.args
|
||||||
|
|
||||||
|
common.card_sheets(149mm, 99mm, 1in/16, args, cards)
|
||||||
|
|
||||||
|
}
|
40
common.typ
40
common.typ
|
@ -70,8 +70,8 @@
|
||||||
dx: 1in/8,
|
dx: 1in/8,
|
||||||
dy: 1in/8,
|
dy: 1in/8,
|
||||||
block(
|
block(
|
||||||
width - 2.75in,
|
width: width - 2in - 7in/8,
|
||||||
height - 0.25in,
|
height: height - 0.25in,
|
||||||
breakable: false,
|
breakable: false,
|
||||||
content_fn(card)
|
content_fn(card)
|
||||||
)
|
)
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
// Stamp placement guide
|
// Stamp placement guide
|
||||||
place(
|
place(
|
||||||
top + right,
|
top + right,
|
||||||
dx: -0.75in,
|
dx: -0.25in,
|
||||||
dy: 0.25in,
|
dy: 0.25in,
|
||||||
image("nixowos.png", width: 0.5in)
|
image("nixowos.png", width: 0.5in)
|
||||||
)
|
)
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
// Address block
|
// Address block
|
||||||
place(
|
place(
|
||||||
horizon + right,
|
horizon + right,
|
||||||
dx: -2in - 5in/8,
|
dx: -1in/8,
|
||||||
address_block(2.5in, 1in, card)
|
address_block(2.5in, 1in, card)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -101,3 +101,35 @@
|
||||||
postcard_content(width, height, content_fn, card)
|
postcard_content(width, height, content_fn, card)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#let postcard_square(width, height, margin, content_fn, card) = {
|
||||||
|
rect(
|
||||||
|
width: width + margin * 2,
|
||||||
|
height: height + margin * 2,
|
||||||
|
inset: margin,
|
||||||
|
postcard_block(width, height, content_fn, card)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
#let card_sheets(width, height, margin, args, cards) = {
|
||||||
|
let content_fn = if args.no_content {
|
||||||
|
_ => []
|
||||||
|
} else {
|
||||||
|
import "content/content.typ"
|
||||||
|
content.content
|
||||||
|
}
|
||||||
|
|
||||||
|
for (idx, card) in cards.enumerate() {
|
||||||
|
let row = calc.rem(idx + args.skip, 2)
|
||||||
|
if idx != 0 and row == 0 {
|
||||||
|
pagebreak()
|
||||||
|
}
|
||||||
|
|
||||||
|
place(
|
||||||
|
top + left,
|
||||||
|
dx: 50% - width / 2 - margin,
|
||||||
|
dy: 25% - height / 2 - margin + 50% * row,
|
||||||
|
postcard_square(width, height, margin, content_fn, card)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -107,6 +107,13 @@ parser.add_argument(
|
||||||
help="CSV file containing addresses",
|
help="CSV file containing addresses",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"-n",
|
||||||
|
"--no-content",
|
||||||
|
action="store_true",
|
||||||
|
help="Skip content, e.g. to make postcard back labels"
|
||||||
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
root = ET.parse(
|
root = ET.parse(
|
||||||
|
|
Loading…
Reference in a new issue