Skip to content

print.rk ​

Rangka print format

Lives in modules/<module>/print/<name>.rk or <site>/print/<name>.rk · Schema print.json (source) · first line: # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json

Properties ​

PropertyTypeMeaning
name requiredstring
pattern ^[a-z][a-z0-9_]*$
model requiredstring
pattern ^[a-z][a-z0-9_]*$
labelmap of string
paperA4 · A5 · 80mm
template requiredstring
pattern \.(html|xml)$
outputhtml · xmlhtml: a printed page (contract 0008); xml: a downloaded XML file (contract 0029)
default "html"
defaultboolean
relatedmap of or

Example ​

From rangka-apps/modules/invoicing/print/sales_invoice.rk (first 60 lines):

yaml
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/print.json
name: sales_invoice
model: sales_invoice
label: {id: Faktur, en: Invoice}
paper: A4
template: sales_invoice.html
default: true
# "Cara bayar" copied when the invoice was submitted (payment_instruction); empty for an older invoice or one
# submitted without a default account, which then shows the letterhead's bank accounts.
related:
  cara_bayar:
    model: payment_instruction
    match: {sales_invoice: name}
    limit: 1

Generated from the schema by website/scripts/gen-reference.mjs. Edit the schema, not this page.

Rangka OS is source-available under the Elastic License 2.0 (ELv2). Free to self-host.