code wiki / _hdl_build / nx_mailmerge.nx
nx_mailmerge.nx
buildroot/runtime/_hdl_build/nx_mailmerge.nx
about
nx_mailmerge.nx -- SOVEREIGN mail merge for the Nishi Office suite (the lawyer workflow): one TEMPLATE .docx
carrying {{field}} placeholders + a tab-separated DATA source (header row of field names, then one record per
row) -> one personalized .docx per record. Composes directly on nx_docx (docx_read_part reads the template's
raw word/document.xml; docx_write_document_xml frames each merged result as a valid OPC package). Placeholder
values are XML-escaped, so '&'/'<' in data are safe. Unknown placeholders are left literally (never silently
dropped). Use case: generate per-heir bequest letters / probate notices from the estate inventory.
nx_mailmerge <template.docx> <data.tsv> <out_prefix>
-> writes <out_prefix>1.docx .. <out_prefix>N.docx (one per data row)
HONEST LIMITATION: substitutes at the document.xml byte level, so a placeholder must live within a single
<w:t> run (true for templates we author; a real Word template that splits {{x}} across runs is a follow-on).
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_docx.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const K_MAGIC_1048592: i64 = 1048592 |
| 14 | const K_MAGIC_1048576: i64 = 1048576 |
functions
| 17 | func mm_slice_eq(a: *u8, aoff: i64, alen: i64, b: *u8, boff: i64, blen: i64) -> i64 called by 1: mm_merge_one |
| 22 | func mm_int_to(buf: *u8, off: i64, v: i64) -> i64 called by 1: main |
| 29 | func mm_escape_region(out: *u8, o: i64, src: *u8, soff: i64, slen: i64) -> i64 |
| 40 | func mm_parse_line(buf: *u8, start: i64, n: i64, off: *i64, len: *i64, nextp: *i64) -> i64 called by 1: main |
| 60 | func mm_merge_one(tmpl: *u8, tlen: i64, tsv: *u8, hoff: *i64, hlen: *i64, nfields: i64, voff: *i64, vlen: *i64, nvals: i64, out: *u8) -> i64 |
| 82 | func main(argc: i64, argv: *i64) -> i64 |