Table of Contents
A "braced text template" refers to a piece of text with embedded placeholders like:
TextTextText-{BASENAME}.pdf
For page label and file name templates, the values of the placeholders are determined by the names of the processed files and the name of the directory or archive file being worked on.
The substitutions allow some sort of filtering or padding, detailed
further below. The substitution backend can be found in the traits class
UtilTrait::replaceBracedPlaceholders()
.
It is possible to use localized placeholders if they have already been
provided by the translation teams. The translations can be found in the
subdirectory ../l10n/
.
It is possible to do some post-processing on the substituted values. This is in particular important when generating filenames in order to get rid of path separators.
The general syntax of a replacement is
{[C[N]|]KEY[|M[D]][@FILTER]}
where anything in square brackets is optional. The particular parts have the following meaning:
- 'C' is any character used for optional padding to the left.
- 'N' is the padding length. If ommitted, the value of 1 is assumed.
- '|' is a literal '|'
- 'KEY' is the replacement key
- '|' is a literal '|'
- 'M' is a number of "path" components to include from the right from the
expansion of KEY with path-delimiter 'D' (default: "/"). E.g.
{KEY|2}
for the valuefoo/bar/foobar
would result inbar/foobar
. - '@' is a literal '@'
- 'FILTER' can be either
- a single character which is used to replace occurences of '/' in the replacement for KEY
- two characters, in which case the first character is used as replacement for the second character in the replacement value of KEY
- the hash-algo passed to the PHP hash($algo, $data) in which case the replacement value is the hash w.r.t. FILTER of the replacement data
THIS SECTION IS INCOMPLETE.
{DIR_BASENAME} {0|DIR_PAGE_NUMBER}/{DIR_TOTAL_PAGES}
PATH
BASENAME
FILENAME
EXTENSION
DIRNAME
DIR_BASEAME
DIR_PAGE_NUMBER
DIR_TOTAL_PAGES
FILE_PAGE_NUMBER
FILE_TOTAL_PAGES
The substitutions are provided by FileSystemWalker::getPdfFileName()
.
TO BE CONTINUED.