32 lines
982 B
Plaintext
32 lines
982 B
Plaintext
# This is a jq module to be included
|
|
|
|
# TODO: since jq I/O sucks, try either using pyyaml or writing a writeto script
|
|
# that only writes to a file if the new contents are different
|
|
|
|
# Pass a specific card and it produces a string with its latex
|
|
def card2tex(deck; rarity):
|
|
. as $card
|
|
| (.costs // {}) as $costs
|
|
| (.effects | join("\\quad ")) as $effect
|
|
| [
|
|
"\\documentclass{iditacard}",
|
|
"",
|
|
"\\cardtype{\(.type)}",
|
|
"\\rarity{\(rarity)}",
|
|
"\\deck{\(deck)}",
|
|
"",
|
|
"\\begin{document}",
|
|
"\\begin{card}",
|
|
" \\art{\(.image)}",
|
|
($costs.energy // empty | " \\energy{\(.)}"),
|
|
($costs.health // empty | " \\health{\(.)}"),
|
|
($costs.risk // empty | " \\risk{\(.)}"),
|
|
" \\name{\(.name)}",
|
|
" \\text{\($effect)}",
|
|
" \\flava{\(.flavour)}",
|
|
" \\type{\(.type)}",
|
|
"\\end{card}",
|
|
"\\end{document}"
|
|
] | join("\n")
|
|
;
|