Menu

Export_Template_Keys Log in to Edit

Christiaan Hofman Michael McCracken

Note: This document may not be regularly updated. For an up-to-date and more complete description, please refer to the Online Help accessible through the Help menu or at <http://bibdesk.sourceforge.net/manual>.

Template Tags

Template tags are similar to tags used in HTML.

Value Tags

There are template tags for simple value keys, which look like this:

<$valueKey/>

You can modify a value key using a value modifer key by connecting with a dot:

<$valueKey.modifierKey/>

You can add several modifier keys in a row. A series of keys connected with dots is called a key path.

Collection Tags

And there are template tags for collection keys, like this:

<$collectionKey>

 item template

</$collectionKey>

You can also add a template to use as separator between the items which is ignored after the last item:

<$collectionKey>

 item template

<?$collectionKey>

 separator template

</$collectionKey>

For a collection key, the modifierKey will modify the items in the collection:

<$collectionKey.modifierKey>

 item template

</$collectionKey.modifierKey>

If you want to modify the collection as a whole, for example to filter a collection, you use an @ character with a collection modifier key:

<$collectionKey.@collectionModifierKey>

 item template

</$collectionKey.@collectionModifierKey>

There are also collection value keys, which return a value for the whole collection, for instance the number of items in the collection:

<$collectionKey.@valueModifierKey/>

In a key path value modifier keys can only occur at the end. Some collection modifiers also can only occur at the end of a key path. However, some collection modifier keys require more keys to the right ( the unionOfObjects and unionOfArrays keys).

In a key path value modifier keys can only occur at the end. Some collection modifiers also can only occur at the end of a key path. However, some collection modifier keys require more keys to the right (the unionOfObjects and unionOfArrays keys).

Spaces before a collection tag up to the start of a line and after a collection tag up to and including the end of a line are ignored. However spaces are not ignored when between the collection tag and other content on the same line. For example, in the following any spaces before and after the collection tag including the newline are ignored:

<$collectionKey>  
text...

while in the following, spaces are not ignored:

text  <$collectionKey>  text...

It is possible to use a collection tag with a value key. This will be interpreted as a collection containing a single element. This can be useful to use several subproperties of a value.

Condition Tags

And there are template tags for condition keys, which include part of a template only when the condition is non empty, like this:

<$conditionKey?>

 template for non empty condition

</$conditionKey?>

You can also provide a template for when the condition is empty:

<$conditionKey?>

 template for non empty condition

<?$conditionKey?>

 template for empty condition

</$conditionKey?>

You can also condition on some fixed values for the condition:

<$conditionKey=firstValue?>

 template for match to firstValue

<?$conditionKey=secondValue?>

 template for match to secondValue

<?$conditionKey?>

 template for no match

</$conditionKey?>

The alternate conditions (starting with "<?$") are optional, and any number of alternate values may appear.

Or you can match match on a substring:

<$conditionKey~firstValue?>

 template for substring match

</$conditionKey?>

Again, you may add alternate conditions similar to the above.

You can also use comparisons "<" and "<=", for smaller and smaller-or-equal.

When the value starts with a $, the remainder is interpreted as a value key.

Similar to collection tags, spaces before and after a condition tag up to the beginning or end of a line and a newline after a condition tag are ignored.

Counters

In the item template inside a collection tag you can use the special key "#" to get a counter for the items.

<$#/>

You can modify the counter with value modifier keys for a number.

Template Keys

Value Keys

document

fileName
fileURL
publicationsUsingTemplate
currentDate
AnyDocumentInfoKey

publication

pubType
citeKey
title
container
pubAuthorsForDisplay
pubDate
dateAdded
dateModified
itemIndex
fileOrder
fields.AnyFieldName
urls.AnyFieldName
localUrlPath         deprecated
localURL             deprecated
remoteURL            deprecated

field

name
value
bibTeXString

author

name
normalizedName
abbreviatedName
abbreviatedNormalizedName
unpunctuatedAbbreviatedNormalizedName
lastName
firstName
vonPart
jrPart

macro

name
value
bibTeXString

local file, remote URL

URL
path

Collection Keys

document

publications
macros

publication

requiredFields
optionalFields
defaultFields
allFields
persons.AnyPersonFieldName
authors
editors
fieldComponents.FieldName
keywords
authorsOrEditors
localFiles
existingLocalFiles
remoteURLs
usedMacros
usedLocalMacros

author

firstNames

Value Modifier Keys

Casing

capitalizedString
lowercaseString
uppercaseString
uppercaseFirst
lowercaseFirst
titleCapitalizedString

Component

firstLetter

Cleaning

htmlString
xmlString
csvString
tsvString
stringByRemovingTeX
stringByRemovingCurlyBraces
stringByRemovingSurroundingWhitespace
stringByCollapsingWhitespaceAndRemovingSurroundingWhitespace
stringByRemovingWhitespace
stringByRemovingReturns
stringByUppercasingAndUnderscoringCaseChanges
stringByTeXifyingString
stringByDeTeXifyingString

Appending

stringBySurroundingWithSpacesIfNotEmpty
stringByAppendingSpaceIfNotEmpty
stringBySurroundingWithSpacesIfNotEmpty
stringByAppendingDoubleSpaceIfNotEmpty
stringByPrependingSpaceIfNotEmpty
stringByAppendingCommaAndSpaceIfNotEmpty
stringByAppendingFullStopAndSpaceIfNotEmpty
stringByAppendingCommaIfNotEmpty
stringByAppendingFullStopIfNotEmpty
stringByPrependingCommaAndSpaceIfNotEmpty
stringByPrependingFullStopAndSpaceIfNotEmpty
parenthesizedStringIfNotEmpty

File Paths

lastPathComponent
stringByDeletingLastPathComponent
pathExtension
stringByAbbreviatingWithTildeInPath
stringByExpandingTildeInPath
stringByDeletingPathExtension
stringByResolvingSymlinksInPath
stringByStandardizingPath
stringByNormalizingPath

URLs

linkedText
icon
smallIcon
linkedIcon
linkedSmallIcon
textSkimNotes
richTextSkimNotes
absoluteString

Dates

description
dateDescription
shortDateDescription
rssDescription

Number

romanNumeralValue
alphaCounterValue
greekCounterValue
numberByAddingOne
numberBySubstractingOne

Collection Modifier Keys

General

@unionOfObjects            (not at end of key path)
@distinctUnionOfObjects    (not at end of key path)
@unionOfArrays             (not at end of key path)
@distinctUnionOfArrays     (not at end of key path)
@arrayDroppingFirstObject  (not at end of key path)
@arrayDroppingLastObject
@firstOneObjects
@firstTwoObjects
@firstThreeObjects
@firstFourObjects
@firstFiveObjects
@lastOneObjects

Field collection

@nonEmpty

Collection Value Keys

General

@firstObject
@secondObject
@thirdObject
@fourthObject
@fifthObject
@sixthObject
@seventhObject
@eighthObject
@ninthObject
@tenthObject
@lastObject
@count
@componentsJoinedByComma
@componentsJoinedByCommaAndAnd
@componentsJoinedByCommaAndOnlyAnd
@componentsJoinedByCommaAndAmpersand
@componentsJoinedByForwardSlash
@componentsJoinedBySemicolon
@componentsJoinedByDefaultJoinString
@componentsWithEtAlAfterOne
@componentsJoinedByAndWithSingleEtAlAfterTwo
@componentsJoinedByCommaAndAndWithSingleEtAlAfterThree
@componentsJoinedByCommaAndOnlyAndWithSingleEtAlAfterThree
@componentsJoinedByAndWithEtAlAfterTwo
@componentsJoinedByCommaAndAndWithEtAlAfterThree
@componentsJoinedByCommaAndOnlyAndWithEtAlAfterThree
@arraySortedByAuthor
@arraySortedByAuthorOrEditor
@arraySortedByTitle
@componentsJoinedByCommaAndAmpersandWithSingleEtAlAfterFive
@componentsJoinedByCommaAndAmpersandWithEtAlAfterSix