To use it, just type or paste template specifications into the
text field below; more documentation is given after the text field.
The output is sent back as a text document to the same window as you
are using; just select all, copy it and paste it into your text
editor. You can either give fragments to get templates--without
even an &-line--or you can make templates for an entire volume
of texts and expand them all to include their P-numbers,
designations, block structure and line numbers at one fell
swoop.

(If your list of templates is more than a few hundred lines you may
need to split it into several chunks to process it all
successfully.)

Project for texts:

Default language for texts:

Default protocol for texts:

Documentation

The input is a series of lines: lines that start with '&' are
ATF &-lines; if the line has an ID starting with P or Q, the
designation is looked up and added; if it has an ID starting with X,
or if it has no ID the template generator tries to find the P-number
for the text based on the rest of the line (if there is an X-ID, the
rest of the line following the '=' sign is used). If it can't find a
P-ID it just outputs the &-line unchanged. If multiple P-IDs
appear to match the keys in the &-line, all the matches are
output.

If a line starts with '#' it is a comment; the line is passed
through unchanged.

Otherwise, the line is parsed as a list of block and line-number
specifications. Each specification token is separated by spaces.
The rules for the tokens are simple: