Settings

1. The letter

Markdown for the shape of it, {{field}} for anything that changes from one letter to the next.

One conditional: a line that starts {{#if field}} and ends {{/if}} is dropped when that field is empty.

2. The list

A CSV whose first line is the header row, as a spreadsheet exports it.

Drop a CSV here, or

3. The check Not ready

Which placeholders have no column, which columns go unused, and which rows would leave a hole.

4. Read one

5. The address block

Labels and envelopes are printed from this, not from the letter. One line here is one line on the label.

6. Paper

The label sheet

Set it to the sheet you actually have, in millimetres.

7. Produce

Nothing here will run while the check above is unhappy.

One PDF

Every letter in one file, each starting on its own page. For the printer.

A zip of text files

One .txt per row, named after the row. For sending, or for feeding to something else.

Label sheets

The address block on the grid set above, sheet after sheet.

Envelopes

One envelope per row at the size chosen above, with your return address in the corner.

Questions people ask about MERGE

Does the list get uploaded?

No. The file is read by this tab with the browser’s own file reader, the rows are held in memory, and the letters are written here. There is no server side to this page, and a Content Security Policy on this site forbids it talking to any other origin. Turn the network off and it still works.

What happens if a row has an empty cell?

If the letter uses that field on an ordinary line, the check lists the row and refuses to produce anything until it is filled or the line is made conditional. If the field is used only inside an {{#if}} line, the line is dropped for that row and nothing else changes.

Which bits of markdown does it understand?

Headings with one to three #, paragraphs, bullet lists with - or *, numbered lists with 1., bold with **stars** and italic with *one star* or _underscores_. Every line break in the template is a line break in the letter, which is not standard markdown but is what an address block needs.

Can I use it for labels on a sheet I already have?

Yes, that is why the grid is a set of numbers rather than a list of brand names. Measure the sheet: how many across, how many down, the margin at the top and at the side, and the gap between labels. The label size follows from those. Print one sheet on plain paper and hold it up to the light against a real one.

Why only one kind of conditional?

Because the second one is never the last. A merge template is read by whoever inherits the letter, often a year later and often not a programmer, and a language with nesting and expressions in it stops being readable at about the third feature. A line that is there when the field has something in it covers the case that actually comes up, which is the second address line.

My list has names that are not in the Latin alphabet. What happens?

In the three PDF outputs, each character those fonts cannot draw comes out as a question mark, and the page says how many did after it writes the file. That is a limit of the fourteen fonts built into the PDF format, not a decision made here. The zip of text files is UTF-8 and carries every name exactly, so for a list in Greek, Cyrillic, Arabic, Hebrew or a CJK script, produce the text files and set them in something that has the fonts.

Where did the letter go after I closed the tab?

The template, address block and settings are still there, saved on this device. The list is not, by design. Keep the CSV where you got it and open it again.

What does the check look for before it produces anything?

Three things: placeholders in the letter that have no column in the list, columns in the list that the letter never uses, and rows whose value for a needed field is empty, which would leave a hole in a letter. Nothing is produced while the check is unhappy.

How is the address block different from the letter?

Labels and envelopes are printed from the address block, not from the letter. It takes the same placeholders and the same {{#if field}} conditional, but no markdown: one line in the block is one line on the label. Every line break in the letter template is a line break in the letter too, so an address block written there stays an address block.

Doing this often? In a law practice, OBSCURA Practice assembles letters for each matter from templates, with the client's details filled in. Everything is US$5 a month or US$48 a year.