Requirements

  • Templates may be RTF or plain DOCX files. The upload path accepts `.rtf` and `.docx` only.
  • DOCX means plain Word document only; `.docm`, `.dotx`, `.doc`, embedded active content, and macro-enabled documents are not accepted.
  • DOCX uploads require the server-side LibreOffice converter. The app preserves the DOCX source when the schema supports it and stores a converted RTF rendering copy internally.
  • Generated output can be RTF, DOCX, or PDF depending on the selected target and server converter availability.
  • If you edit a template outside the app, save it as RTF or plain DOCX before uploading.
  • On upload or replacement, the app warns about malformed or unmatched conditionals and iterators, invalid modifier syntax, and tokens split by embedded RTF formatting. You may cancel the upload or explicitly load the template anyway.
  • Template names are case-sensitive. Public template names may not duplicate an existing name. Different users may use the same name for private templates. Uploading the same private name again under your own account asks before replacing your existing template.
  • Deleting a template permanently removes it. Any saved-flight or user-preference reference to that template is cleared first.

DOCX Layout Limits

DOCX templates are converted to internal RTF when uploaded. Token substitution happens after that conversion, so use DOCX as an authoring convenience rather than as a guarantee that every Word layout feature will behave identically in every target app.

  • Keep each token as contiguous literal text, for example [DpWeather]. Do not split a token across runs with mixed formatting, fields, comments, or embedded objects.
  • [WBGraph] is the exception: its supported embedded RTF text-color controls select graph element colors and are accepted by upload validation.
  • Manual page breaks usually work when LibreOffice converts them to RTF page breaks. Notability has custom handling for literal RTF page breaks.
  • Paragraph settings such as “page break before,” “keep with next,” and “keep lines together” are passed through only if LibreOffice converts them into RTF controls. The app does not enforce those paragraph rules itself.
  • Multiple-column layout is not interpreted by the app. Word and PDF output may honor converted column controls, but Notability output should not be assumed to be column-aware.
  • For Notability-targeted forms, prefer the proven RTF template patterns with explicit page breaks and tab stops over complex DOCX layout features.

How Token Substitution Works

Any text in square brackets that matches a known token name is replaced during form generation. The token name must be exact.

  • [AcReg] inserts the selected aircraft registration.
  • [FlightType] inserts the flight type, such as IFR or VFR.
  • [DpId] inserts the departure airport ident.
  • [DtId] inserts the destination airport ident.
  • [DpRwy], [DtRwy], [DpGR], [DtOb], and similar tokens come from the weather/performance rows.
  • [File] and [Path] insert the template name.
  • [Source] inserts the template source format, either RTF or DocX.
  • [TemplateKey] inserts the special-character key, such as ε: estimated value; ® with runway: right traffic; © with tower frequency: CTAF used; ‡ with frequency: more than two same-type frequencies available; * with frequency: part-time facility.
  • [Target], [TargetApp], and [TargetFormat] describe the selected output target.

Token Families

Airport-family tokens use a prefix plus a suffix.

  • Prefixes: Dp = Departure, Dt = Destination, Ad = Departure Alternate, A1 = Alternate, A2 = Alternate 2.
  • Common suffixes: Id, Name, Rwy, Wx, Weather, Wind, Vis, Clouds, Temp, Dew, TZ, TPA, DA, Elev, Wgt, GR, Ob.
  • Airport Name tokens are limited to 22 characters on generated forms. A longer name is rendered as its first 21 characters followed by an ellipsis (). The Flight page continues to display the full airport name.
  • Frequency tokens such as [DpWx], [DpClnc], [DpGnd], and [DpTwr] include up to two same-type frequencies. A trailing means additional same-type frequencies are available; a trailing © on tower frequency means CTAF was used because no tower frequency exists. Use #F to append * to displayed part-time facility frequencies.
  • Runway tokens such as [DpRwy] and [DpRwys] are unannotated by default. Use #R and #C modifiers when a template needs right-traffic or calm/preferred-runway annotations.
  • Dotted names are accepted for airport and V-speed tokens. For example, [Dp.Wgt] is equivalent to [DpWgt], and [Dt.Wx#F] is equivalent to [DtWx#F].
  • Example: [DtGR] means destination ground roll. [AdWx] means departure alternate weather frequency. [DpWeather] means departure weather summary, such as 340º@16G26KT 10SM CLR 16º/M02ºC or calm – – 13ºC/–.

Token Modifiers

Runway and frequency tokens support limited modifiers separated from the token name by #. Modifiers are case-insensitive.

  • #R applies the right-traffic marker when the runway is listed as right traffic.
  • #C applies calm-wind/preferred-runway underlining when the runway is listed as calm/preferred.
  • #F applies to Wx, Clnc, Gnd, and Twr frequency tokens and marks displayed part-time facility frequencies with *.
  • #D, #L, #A, #F, #Z, and #P apply to TZ timezone tokens. Examples: [DpTZ], [DpTZ#A], and [DtTZ#z].
  • #F also applies to the [Date] token and uses the flight ETD date/time instead of the generation date/time, for example [Date#F:Mmm d, yyyy].
  • Runway modifiers may be combined, for example [DpRwy#R#C], [DpRwy#RC], or [DtRwys#c#r].
  • Unsupported modifiers are intentionally left visible in the generated output so authoring errors are easy to find.

Date Tokens

Date tokens use the same format strings in all generated output formats.

  • [Date], [Date:yyyy-mm-dd], and [Date yyyy-mm-dd] use the form-generation date/time.
  • [Date#F:Mmm d, yyyy] uses the flight ETD date/time with the requested format.
  • [mDate] and [mDate:yyyy-mm-dd hh:nn] use the template-modified date/time in the server timezone.
  • [zDate] and [zDate:yyyy-mm-dd hh:nn] use the form-generation date/time in UTC.
  • Date formats may use timezone modifiers such as Z#Z, Z#A, or z#f.

Target Tokens

Target tokens allow one source template to adjust wording for RTF, DOCX, or PDF output.

  • [Target] resolves to values such as Notability/rtf, Word/rtf, Word/docx, TextEdit/rtf, or PDF.
  • [TargetApp] resolves to Notability, Word, TextEdit, or PDF.
  • [TargetFormat] resolves to RTF, DOCX, or PDF.
  • [TargetRTF], [TargetDOCX], [TargetPDF], [TargetWord], [TargetNotability], and [TargetTextEdit] are true/blank flag tokens for conditionals.
  • Ordinary PDF generation uses the TextEdit/RTF logical target by default, then converts that RTF through LibreOffice. Select PDF (with TargetPDF tokens) if the template must see PDF-specific target tokens.

Conditionals

Conditionals use this exact syntax:

[IF:expression]text when true[ELSE]text when false[/IF]
  • A bare expression such as [IF:IFR] is true when the token is non-blank.
  • Equality tests use =, for example [IF:FlightType=VFR].
  • Inequality tests use !=, for example [IF:FlightType!=IFR].
  • Target-specific tests use the same syntax, for example [IF:Target=Word/docx] or [IF:Target!=PDF].
  • [ELSE] is optional.
  • The parser expects uppercase IF and ELSE, with a colon after IF.

Multi-Leg Stop Loops

Multi-leg templates can repeat a block for intermediate stops. Departure, destination, and alternate airports are not included in STOPS. The iterator variable is a placeholder and may be any case-insensitive alphanumeric/underscore string, such as i, stop, or leg_1.

[FOREACH:i in STOPS]
STOP [i]: [i.Id] ([i.Name]; [i.TZ#A])
Arrive Rwy [i.Rwy.arr#R#C] [i.GR.arr] / [i.Ob.arr]
Depart Rwy [i.Rwy.dep#R#C] [i.GR.dep] / [i.Ob.dep]
[/FOREACH]
  • [i] is the 1-based stop number.
  • Common stop tokens include [i.Id], [i.Name], [i.Weather], [i.Wx#F], [i.TPA], [i.Wgt], and [i.Rwys#R#C].
  • Operation-specific tokens use .arr or .dep, such as [i.Rwy.arr#R#C], [i.GR.dep], and [i.Ob.arr].
  • V-speed tokens inside the loop include [i.Vr], [i.V50], [i.Vref], [i.Vappr], [i.Va], [i.Vb], [i.Vsink], and [i.Vg].

Blank True and Blank False

  • Blank True blanks flight-, aircraft-, W&B-, airport-, and weather-derived tokens, but forces all conditionals true.
  • Blank False blanks the same token families, but forces all conditionals false.
  • Date, file/path, source, template-key, and target tokens are still filled in, so those outputs are useful for template review.

Example 1: Simple Token Substitution

This example has no conditionals. It simply inserts the aircraft registration, departure, destination, and flight type.

Aircraft: [AcReg]
From: [DpId]
To: [DtId]
Type: [FlightType]

With a loaded flight, the generated output might look like:

Aircraft: N2FR
From: KPAO
To: E16
Type: VFR

Example 2: Simple Conditional Template

This example changes the text depending on whether the flight type token is IFR or VFR.

[IF:FlightType=IFR]Clearance: [DpClnc]
[ELSE]Departure CTAF/ATIS: [DpWx][/IF]
Departure runway: [DpRwy]
Departure ground roll: [DpGR]
Destination runway: [DtRwy]
Destination obstacle clearance: [DtOb]

For an IFR flight, the first line resolves to the clearance frequency. For a VFR flight, it resolves to the departure weather frequency line instead.

Example 3: Target-Specific Output

This example changes the text depending on the selected generated-output target.

[IF:Target=Word/docx]DOCX-specific checklist text.
[ELSE]RTF/PDF checklist text.[/IF]
[IF:Target!=PDF]Editable-form instructions.
[ELSE]PDF review-copy instructions.[/IF]

Because ordinary PDF output uses TextEdit/RTF tokens by default, use the explicit PDF-token target if this example must take the PDF branch for server-generated PDF output.

Practical Advice

  • Start with a very small template and test token names incrementally.
  • Use Blank True and Blank False on the Templates page to verify your conditional structure before using the template on a real flight.
  • If a token stays visible in the output, it usually means the token name is not recognized exactly as written.
  • If you want the literal characters [ and ] to remain in the document, avoid using a recognized token name between them.
  • The repository includes Test-*.rtf templates that exercise target tokens and conditionals.