Guides and Sample Code

Developer

Playground Book Format Reference

On This Page

Glossary Property List

The optional glossary property list contains key-value pairs defining the terms for the glossary of a book. The property list file is called Glossary.plist and is located in the PrivateResources folder of the book at the path:

<book name>.playgroundbook/Contents/PrivateResources/Glossary.plist

Adding a Glossary.plist file to a book adds the Glossary of Terms menu item to the Tools menu. The entry for each glossary term has three parts, as shown in Figure 13-1:

  • Term: The concept defined by the glossary entry.

  • Definition: The definition of the term.

  • First-use link: A reference to the playground page introducing the term.

Figure 13-1Glossary term image: ../Art/SP_glossary_entry_2x.png

Key List

Table 13-1 describes each top-level key in the glossary property list, its type, and whether the key is required.

Table 13-1Glossary property list keys

Key

Type

Description

Required

Terms

Dictionary

A dictionary of glossary term dictionaries. See Terms Key.

Term Name

Dictionary

The name of the concept described by the term dictionary. See Term Name Key.

Terms Key

A dictionary of dictionaries. Each dictionary in the Terms dictionary describes a glossary term. The key name for a term dictionary is the glossary term itself.

Figure 13-2 shows some of the glossary terms from Learn to Code 1, such as algorithm, arithmetic operator, and argument.

Figure 13-2Glossary term names image: ../Art/SP_glossary_term_name_2x.png

Term Name Key

A dictionary defining a glossary term. The name of the key for the dictionary is used as the display name for the term in the full glossary and in the glossary term popover. Term name keys can contain spaces. Each term dictionary contains the definition of the term and an optional dictionary defining a link to the first use of the term.

Table 13-2 describes each key for a term dictionary, its type, and whether the key is required.

Table 13-2Term dictionary keys

Key

Type

Description

Required

Definition

String

The definition for the glossary term. See Definition Key.

FirstUse

Dictionary

A dictionary defining a link to the page where the term is first used. See FirstUse Key.

  

Title

String

The title used for the glossary term. See Title Key.

  

Definition Key

The definition for the glossary term, as a string. The definition is displayed in the full glossary and in the glossary term popover.

FirstUse Key

A dictionary that defines a link and title for the first use of a glossary term.

Table 13-3 describes each key for the FirstUse dictionary, its type, and whether the key is required.

Table 13-3First use dictionary keys

Key

Type

Description

Required

PageReference

String

The path to the page where the term is first used. See PageReference Key.

Title

String

The title shown in the glossary as the first-use link. See Title Key.

PageReference Key

The path to the page that contains the first use of the glossary term.

  • chapter Name key value/page Name key value

A page reference is a two-component path specifying the location of a page in the playground book package. chapter Name key value is the value of the Name key of the Manifest.plist file for the chapter. For more information, see Name Key in Chapter Manifest. Similarly, page Name key value is the value of the Name key of the Manifest.plist file for the page. For more information, see Name Key in Playground Page Manifest.

The path follows URI rules for encoding spaces and other special characters. For more information, see "Characters" in RFC 3986.

In First-use path, the first use of the term command is in the chapter Document1.playgroundchapter on the page Exercise1.playgroundpage. Commands, the first component of the PageReference for command, is the value of the Name key of the Manifest.plist file for the chapter Document1.playgroundchapter. Issuing%20Commands, the second component of the path, is the value of the Name key of the Manifest.plist file for the page Exercise1.playgroundpage. The space character in Issuing Commands, the name of the playground page, is encoded with the string %20.

Title Key

The title displayed for the first-use link in the full glossary.

Title Key

The title used for the glossary term. If not specified, the term name key is used. Use this key to customize the display of terminology in a localized glossary.