Paralog Template Language

Overview

The Paralog Template Language (PTL) is a simple syntax providing two parts: references, a formalism for accessing values from your logbook; and directives, a set of statements used for control and action. PTL has been intentionally kept simple and small.

References

References in the template access data. They freely mix with the template's non-PTL content. Formally defined, a reference is one of the allowed keywords embedded in '@@' characters together with any parameters. If an invalid keyword is encountered, an error message is renedered into the output file.

Here is a short template containing a simple reference mixed with non-PTL content:

This is @@USER@@'s logbook.

Here, the reference is @@USER@@. Paralog replaces @@USER@@ in the template with the name of the registered user. Assuming the registered user is 'John Doe', this example will be parsed to:

This is John Doe's logbook.

References to numbers, dates and times will be formatted according to the current locale.

Directives

Directives are PTL's other major part. Like references, they freely mix with other non-PTL content in templates and have to be embedded in '@@'.

Directives are similar to references as they get usually replaced with a value which is the result of that directive, but they are different in as they also perform additional actions, e.g. include and parse another template file or loop through the logbook.

Here is a short template containing a simple directive mixed with non-PTL content:

@@FOREACHJUMP FROM:1022 TO:1025 REVERSE@@
Jump @@JUMP NUMBER@@
@@/FOREACHJUMP@@

In a US locale, this example will be parsed to:

Jump 1,022

Jump 1,023

Jump 1,024

Jump 1,025

List of Keywords

Syntax

All keywords have to be enclosed in double ampersats (@@) together with their parameters, e.g. @@TIMESTAMP CHECK@@. Keywords enclosed in square brackets ([]) are optional, e.g. TIMESTAMP [CHECK]. When several keywords are seperated by a vertical bar (|), one must be chosen, e.g. DELIMITER CSV|MOVIEOFFSET. Keywords enclosed in angled brackets (<>) have to be replaced by their proper value, e.g. INCLUDE <value>.

The explanation states the value the keyword is replaced with. If the keyword is a directive, it's action will be given after 'Action:'.

General use

These keywords are used in a general context, e.g. to retrieve the user, logbook timestamp, units used, etc. from the logbook and to control overall actions, e.g. include and copy files.

Keyword Will be replaced with...
USER ... the name of the registered user.
CREATIONDATE ... the date when the file was generated.
CREATIONTIME ... the time when this file was generated.
UNITS HEIGHT|DISTANCE|SPEED|WINDSPEED|TIME|ANGLE ... the localised units used for heighs/distances/speeds/wind speeds/time and angles. The units reflects Paralog's settings (Imperial/Metric units, Display speed in seconds).
CHARSET [HTML] ... the file encoding used on this machine. With the optional parameter HTML, the HTML encoding used on this machine is returned.
DELIMITER CSV|MOVIEOFFSET ... the delimiter used between values of CSV files/a movie's name and it's zero offset.
INCLUDE [SUPPRESS] <file> ... with the name of file, unless the optional parameter SUPPRESS is used and parsing of the file is aborted because of [JUMP ] TIMESTAMP CHECK or [GPS]PROFILE CHECK.

Action: file will be parsed.
COPY <file/directory> ... with the name of file/directory.

Action: file/directory (which mustt reside in the template directory) will be copied to the output directory.
TIMESTAMP [CHECK] ... the last modification date/time of the logbook.

Action: When the optional parameter CHECK is used, parsing of the file which contains this command is aborted when the logbook and the template are older than the target file, i.e. the existing file will not be regenerated/overwritten.

Logbook totals

These keywords are used in the context of logbook totals, e.g. to retrieve totals and other statistical information, etc. from the logbook and to create charts from the logbook.

Keyword Will be replaced with...
TOTALS LASTJUMPDATE ... the date of the last jump.
TOTALS TOTALJUMPS [LASTYEAR|LASTMONTH] ... the number of jumps.
TOTALS TOTALDELAY ... the total freefall time.
TOTALS TOTALFREEFALLDISTANCE ... the total freefall distance. The output reflects Paralog's settings (Imperial/Metric units, Display speed in seconds).
TOTALS TOTALCANOPYDISTANCE ... the total distance under canopy. The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
TOTALS TOTALMALFUNCTIONS ... the number of malfunctions.
TOTALS TOTALRESERVES ... the number of reserve deployments.
TOTALS TOTALVIDEOJUMPS ... the number of video jumps.
TOTALS TOTALNIGHTJUMPS ... the number of night jumps.
TOTALS TOTALTEAMJUMPS ... the number of team jumps.
TOTALS TOTALAIRCRAFT ... the number of different aircraft.
TOTALS TOTALPLACES ... the number of different DZs.
TOTALS HIGHESTEXIT ... the highest exit altitude. The output reflects Paralog's settings (Imperial/Metric units).
TOTALS HIGHESTFREEFALL ... the highest freefall distance. The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
TOTALS HIGHESTDELAY ... the highest freefall delay.
TOTALS HIGHESTPOINTS ... the highest points.
TOTALS HIGHESTGROUPSIZE ... the largest group size.
TOTALS LOWESTOPEN ... the lowest opening altitude. The output reflects Paralog's settings (Imperial/Metric units).
TOTALS LOWESTFREEFALL ... the lowest freefall distance. The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
TOTALS LOWESTDELAY ... the lowest freefall delay.
TOTALS AVERAGEFREEFALL ... the average freefall distance. The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
TOTALS AVERAGEDELAY ... the average freefall delay.
TOTALS RATIOMALFUNCTIONJUMPS ... the ratio of malfunctions to jumps.
TOTALS RATIORESERVEJUMPS ... the ratio of reserve deployments to jumps.
TOTALS CHART [TYPE:"PIE"] [VALUES:"<values>"] [CATEGORIES:"<categories>"] [CREATE] [WIDTH:<width>] [HEIGHT:<height>] [DEFAULT:<value>] ... the name of the chart file (Paralog[Bar|Pie]Chart_<values>_<categories>.png).

Action: When the optional parameter CREATE is given, the graphics file Paralog[Bar|Pie]Chart_<values>_<categories>.png is generated. Optional parameters specify whether a bar or pie chart is to be generated and which values (for bar charts only) and categories are to be used for the chart. If these parameters are not specified, a bar chart of jumps per year is generated. Other optional parameters can specify width and heigth of the generated image and a file name to be used when no chart can be generated. Allowed values for <categories> and <values> are: "Aircraft", "Date [Month]", "Date [Year]", "Delay", "Exit", "Equipment", "Fall Rate", "Jump Type", "Landing", "Malfunction", "Night", "Open", "Place", "Points", "Reserve", "Size", "Signed", "Team", "Video", "Wind"; "Jumps" is allowed for values only.

Jump details

These keywords are used in the context of a jump, e.g. to retrieve jump data from the logbook and to create jump profile charts and images.

Keyword Will be replaced with...
JUMP ... with the jump number.
JUMP TIMESTAMP [CHECK] ... the last modification date/time of the jump.

Action:When the optional parameter CHECK is used, creation of the file which contains this command is aborted when the jump and the template are older than the target file.
FOREACHJUMP [FROM:<value>] [TO:<value>] [REVERSE]
<data>
/FOREACHJUMP
... the parsed result of <data> for every jump in the logbook.

Action:<data> is repeatedly evaluated in the context of every jump of the logbook. The optional parameters FROM: and TO: can define a specific range of jumps from the logbook, the optional parameter REVERSE steps through the logbook in reverse order.
JUMP NUMBER [RAW] ... with the jump number. The optional parameter RAW suppresses formatting of the number according to the current locale and returns a 'raw' integer (e.g. 1001 vs. 1,001).
JUMP DATE ... with the jump date.
JUMP TIME [INCLUDESECONDS] ... with the jump time. The optional parameter INCLUDESECONDS adds seconds to the output.
JUMP DATETIME ... with the jump date and time in ISO format.
JUMP EXIT ... with the exit height. The output reflects Paralog's settings (Imperial/Metric units).
JUMP OPEN ... with the deployment height. The output reflects Paralog's settings (Imperial/Metric units).
JUMP FREEFALL ... with the freefall distance. The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
JUMP DELAY ... with the freefall time.
JUMP DISTANCE ... the distance over ground of between exit and open (GPS profile only). The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
JUMP CANOPY ... with the time under canopy.
JUMP TOTALDELAY ... the accumulated freefall time.
JUMP PLACE ... with the DZ name.
JUMP AIRCRAFT ... with the aircraft name.
JUMP TYPE ... with the type of the jump.
JUMP FALLRATE ... with the fallrate type.
JUMP LANDING ... with the landing description.
JUMP WIND [DIRECTION] ... with the wind speed (or direction). Speed is given in knots for metric units, in mph for imperial units. (See settings)
JUMP POINTS ... with the no. of points.
JUMP GROUPSIZE ... with the group size.
JUMP TEAMNAME ... with the teamname.
JUMP VIDEOJUMP [? "<value>" [: "<value>"]] ... with whether this jump was a video jump or not. Optional parameters can specify the 'true' and 'false' values, default is 'X' and empty.
JUMP NIGHTJUMP [? "<value>" [: "<value>"]] ... with whether this jump was a night jump or not. Optional parameters can specify the 'true' and 'false' values, default is 'X' and empty.
JUMP HIGHESTSPEED ... with the maximum speed. The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
JUMP AVERAGESPEED ... with the average speed. The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
JUMP EQUIPMENT ... with the equipment description.
JUMP MALFUNCTION ... with the malfunction description.
JUMP RESERVE [? "<value>" [: "<value>"]] ... with whether the reserve was deployed on this jump or not. Optional parameters can specify the 'true' and 'false' values, default is 'X' and empty.
JUMP NOTE ... with the note field.
JUMP SIGNED ... with the name and license no. of the signer, if any.
JUMP PROFILE [CREATE] [WIDTH:<width>] [HEIGHT:"<height>] [DEFAULT:"<value>] ... the name of the the profile file for this jump (ParalogJumpProfile_<jump_number>.png).

Action: When the optional parameter CREATE is given, the graphics file ParalogJumpProfile_<jump_number>.png is generated. Optional parameters can specify width and heigth of the generated image and a file name to be used when no profile is present.
JUMP IMAGE [THUMBNAIL [WIDTH:<width>] [HEIGHT:"<height>]] | [COPY] [DEFAULT:"<value>] [FULLPATH] [RAW] ... the name of the the image file for this jump (ParalogThumbnail_<jump_number>.jpg).

Action: When the optional parameter THUMBNAIL is given, a thumbnail file ParalogThumbnail_<jump_number>thumbnail.jpg is generated. Optional parameters can specify width and heigth of the thumbnail. If one parameter is set to -1, the image will be scaled to the other dimension. DEFAULT specifies a filename to be used when no profile is present. When the optional parameter COPY is given, the image attached to the jump is copied to the file ParalogThumbnail_<jump_number>.jpg in the output directory. FULLPATH returns the full path to the image instead of the filename only. By default, the returned filename is encoded to be used in an URL, RAW durppresses this encoding.
JUMP MOVIE [COPY] [FULLPATH] [OFFSET] [RAW] ... the name of the the movie file attached to this jump. When the optional parameter COPY is given, the movie file is copied to the output directory. When the optional parameter FULLPATH is given, the full path of the movie is returned instead of the filename. When the optional parameter OFFSET is given, the zero offset of the movie is returned instead of the filename. By default, the returned filename is encoded to be used in an URL, RAW durppresses this encoding.

Jump profile

These keywords are used in the context of a jump profile, e.g. to retrieve jump profile data from the logbook.

Profile
Keyword Will be replaced with...
[GPS]PROFILE CHECK [SUPPRESS] ... the last modification date/time of the jump, unless the optional parameter SUPPRESS is used.

Action: Creation of the file which contains this command is canceled when the jump and the template are older than the target file or the jump or the jump has no [GPS] profile attached.
FOREACHPROFILEPOINT
<data>
/FOREACHPROFILEPOINT
... the parsed result of <data> for each data point of the current jump.

Action:<data> is repeatedly evaluated in the context of every data point of the jump profile.
FOREACHAIRCRAFTPROFILEPOINT
<data>
/FOREACHAIRCRAFTPROFILEPOINT
... the parsed result of <data> for each data point before exit of the current jump.

Action:<data> is repeatedly evaluated in the context of every data point before exit of the jump profile.
FOREACHFREEFALLPROFILEPOINT
<data>
/FOREACHFREEFALLPROFILEPOINT
... the parsed result of <data> for each data point in freefall of the current jump.

Action:<data> is repeatedly evaluated in the context of every data point in freefall of the jump profile.
FOREACHCANOPYPROFILEPOINT
<data>
/FOREACHCANOPYPROFILEPOINT
... the parsed result of <data> for each data point under canopy of the current jump.

Action:<data> is repeatedly evaluated in the context of every data point under canopy of the jump profile.
FOREACHGROUNDPROFILEPOINT
<data>
/FOREACHGROUNDPROFILEPOINT
... the parsed result of <data> for each data point after landing of the current jump.

Action:<data> is repeatedly evaluated in the context of every data point after landing of the jump profile.
PROFILEPOINT POINT [RELATIVE] [OFFSET:<value>] ... the number of the current profile data point. By default, counting starts at the beginning of the track, the optional parameter RELATIVE starts counting at the beginning of the outer loop (e.g. AIRCRAFT or FREEFALL). The optional parameter OFFSET: adds <value> to the result.
PROFILEPOINT TIME [OFFSET:<value>] ... the time value of the current profile data point in seconds. The optional parameter DECIMALSEPARATOR: lets you specify a character c to be used as the decimal seperator. The optional parameter OFFSET: adds <value> to the result.
PROFILEPOINT STARTTIME [DECIMALSEPARATOR:<c>] [OFFSET:<value>] ... the start time value of the current profile data point in hours:minutes:seconds. The optional parameter DECIMALSEPARATOR: lets you specify a character c to be used as the decimal seperator. The optional parameter OFFSET: adds <value> to the result.
PROFILEPOINT ENDTIME [DECIMALSEPARATOR:<c>] [OFFSET:<value>] ... the end time value of the current profile data point in hours:minutes:seconds, usually equal to the start time value of the next profile data point. The optional parameter DECIMALSEPARATOR: lets you specify a character c to be used as the decimal seperator. The optional parameter OFFSET: adds <value> to the result.
PROFILEPOINT HEIGHT [OFFSET:<value>] ... the height value (AGL) of the current profile data point. The output reflects Paralog's settings (Imperial/Metric units). The optional parameter OFFSET: adds <value> to the result.
PROFILEPOINT TAS ... the TAS value of the current profile data point. The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
PROFILEPOINT SLAS ... the SLAS value of the current profile data point. The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
PROFILEPOINT LATITUDE ... the latitude of the current profile data point (GPS profile only).
PROFILEPOINT LONGITUDE ... the longitude of the current profile data point (GPS profile only).
PROFILEPOINT ELEVATION ... the elevation (MSL) of the current profile data point (GPS profile only). The output reflects Paralog's settings (Imperial/Metric units).
PROFILEPOINT DISTANCE ... the distance over ground of the current profile data point (GPS profile only). The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
PROFILEPOINT PITCH ... the pitch of the current profile data point (GPS profile only).
PROFILEPOINT GLIDERATIO ... the glide ratio of the current profile data point (GPS profile only).
PROFILEPOINT COURSE|TRACK ... the course/track of the current profile data point (GPS profile only).
PROFILEPOINT TURNRATE ... the turn rate of the current profile data point (GPS profile only).
PROFILEPOINT GROUNDSPEED ... the ground speed of the current profile data point (GPS profile only). The output reflects Paralog's settings (Imperial/Metric units, Display speed as).
PROFILEPOINT SPEED ... the 3D speed of the current profile data point (GPS profile only). The output reflects Paralog's settings (Imperial/Metric units, Display speed as).