Ordinary Human Language

by Brian Crane

Format the Output

Up to this point, creating an export template has been pretty simple.

You’ve written a sample and then turned it into a form letter by replacing it’s specific information with a single bit of export code. That code creates a blank space in your text that Tinderbox fills using information found in an attribute you’ve named as part of the code.

Yes, entering this code involved typing a strange character. But if you are like me, after an initial panic, you found the key on your keyboard and after you got used to it you started to feel kinda fancy typing it as part of your “code.” (Yeah! I’m not old! I code! Take that Millennials!)

Adjusting a template to format the output is not any harder, but like that character, it can be unsettling at first because formatting in templates is done using HTML.

The HTML You Need

First off: you don’t need to know HTML to format Tinderbox output. You need to know three basic things: how to create paragraphs, how to italicize, and how to bold text. All of them are very easy, especially if you’ve ever used any version of Markdown in a text editor.

Create a Paragraph

In word processors, you create a paragraph by hitting RETURN (maybe twice) and possibly TAB. This doesn’t work in Tinderbox (or HTML).

To create a paragraph, you place <p> at its beginning and </p> at its end.

Italicize Text

When you make text italics in a note, Tinderbox will italicize it for you in the output. But if you are exporting information from an attribute that can’t hold italicized text (e.g. $BookTitle), then you have to tell Tinderbox to italicize the information when it exports.

To italicize text in your template, you place <em> at its beginning and </em> at its end.

Make Text Bold

Tinderbox treats bold text in your notes exactly as it does italicized text.

In cases where you need to tell Tinderbox to make text in your template bold, you place <strong> at its beginning and </strong> at its end.

Formatting the Letter Template

In order to correctly format my letter, I need to make two changes to my template: I need to identify the paragraphs and the title of the book I’ve read needs to be italicized. Once I’ve added the necessary tags, the template looks like this:

No, that doesn’t really look like English, and yes, it’s intimidating at first glance. But if you have started with the written sample letter, then you can see how that source text has been converted to a template by replacing specific information with export instructions and then by adding two-pieces of formatting information.

And the pay-off? When this work is done the export produces tailor-made letters for each of my three author notes. They look like this:

All the Rest…

This letter example is purposefully simple, but using the three HTML tags I’ve mentioned above, it is possible to create a wide variety of more useful outputs. So oftentimes, these tags are all we’ll need.

Here’s the good news though: Tinderbox speaks HTML. Which means that as you pick up additional tags, you can use them to create greater variety in your output.

Or, if you’re great at Nisus, you can stick to the export basics, copy-paste and get fancy there. It’s up to you.

For other export examples, go here.

Posted July 8, 2017