Sample library.info file: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (Replacing page with 'Here is an example <tt>library.info</tt> configuration file for a collection called <tt>Dictionary</tt>: [Library] name = "Dictionary" library_version = 1 host_version = 1...')
Line 13: Line 13:
bundle_class = "dictionary"
bundle_class = "dictionary"


== General Notes ==
==Keys and Values==
See [[library.info]] for a description of keys and values.

.info files follow a key/value pair format, similar to the [http://standards.freedesktop.org/desktop-entry-spec/latest/ fd.o desktop entry spec]

; Entries : Entries in the file are {key,value} pairs in the format: <tt>Key = Value</tt>

: Space before and after the equals sign is ignored; the <tt>=</tt> sign is the actual delimiter.

; Value Types : The value types recognized are '''string''', '''boolean''', and '''numeric'''.

:Values of type '''string''' may contain all ASCII characters except for control characters (space, newline, tab, carriage return, etc.). To include any of these characters, use the appropriate escape sequence. Strings should be delimited by double quotation marks, e.g. <tt>"This is a string"</tt>.

:Values of type '''boolean''' must either be <tt>true</tt> or <tt>false</tt>.

:Values of type '''numeric''' must be a valid floating point number, e.g. <tt>13</tt> or <tt>-2.5</tt>.

; Multiple Values : Some keys can have multiple values. In such a case, the value of the key is specified as a plural: for example, <tt>locales</tt>. The multiple values should each be separated by a semicolon. Those keys which have several values should have a semicolon as the trailing character. Semicolons in these values need to be escaped using \;.

== Keys/Values==

; <tt>[Library]</tt> ''(required)'': The <tt>library.info</tt> file must begin with <tt>[Library]</tt>, and only that, on the first line of the file.
; <tt>name</tt> ''(required)'': This entry is the name is displayed in the library navigation sidebar that refers to the collection. Visit the online version of the [http://dev.laptop.org/pub/content/library/ OLPC Library] to view the current navigation sidebar and categories.

; <tt>library_version</tt> ''(required)'': The version is a single positive integer that refers to the version of the collection. Larger numbers are considered "newer". For now, the version is 1.

; <tt>host_version</tt> ''(required)'': The host version is a single positive integer that refers to the version of Sugar which the collection is compatible with. For now, the version is 1.

; <tt>l10n</tt> ''(required)'': This entry indicates whether the bundle is "officially" localized. The value is either <tt>true</tt> or <tt>false</tt>.

:''Note: What it means to be "officially" localized hasn't been entirely worked out yet, so the value of this entry is always <tt>false</tt> for now.
; <tt>locale</tt> ''(required)'': This is the ISO code for the language of the collection, in lowercase, followed by an underscore, and then its localization information (also represented in ISO code). In this case, US-localized English is represented as en_US. UK-localized English, for example, would be represented as en_UK.

:In the case of collections that are "unofficially" localized and/or contain content in multiple languages, you can indicate multiple locales. An example would be:
locales = en_US;en_UK;es_PE;es_AR;

:Note that <tt>locales</tt> is pluralized in order to indicate multiple values. Note also that values are separated by semi-colons, and that the final value must end with a semi-colon as well.

: For a list of [[ISO 639]] language codes, see http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

: For a list of ISO country codes, see http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements

; <tt>category</tt> ''(required)'': This refers to the category classification in the OLPC Library (visible on navigation sidebar). See the category chart below for current options. As always, if you don't like what you see, you can add your own.

; <tt>category_icon</tt> ''(optional)'': This is the filename of the icon that represents the collection in the library navigation sidebar. The actual image file is stored in the <tt>library</tt> directory (see [[Creating_a_content_bundle#Configuration_Files|configuration files]]. This entry is only required if you decide to place your collection in a new top-level category in the library navigation sidebar. Otherwise, the pre-defined category icon is used.

; <tt>category_class</tt> ''(optional)'': This entry refers to the category's CSS class. This is required if you decide to place your bundle into a new top-level category. Otherwise, the default class for the category is used. See the category chart below for current categories and related classes.

; <tt>subcategory</tt> ''(optional)'' : This refers to the subcategory classification within a category (visible on the navigation sidebar). If no subcategory is provided, the collection will be placed in its own subcategory. See category chart for current options. Again, and as always, if you don't like what you see, you can add your own.

; <tt>bundle_class</tt> ''(optional)'': This entry is required if the collection is using a customized <tt>[[library.css]]</tt> file. The <tt>bundle_class</tt> value should be the same name as the collection's <tt>.xol file</tt>, except in lower case (and without the ".xol"). No whitespace or special characters are allowed. Otherwise, the category class is used.

==Category Chart==

The current category and subcategory options are:
{| border="1px;solid" cellpadding="3px"
|-
|'''Icon''' || '''Category''' || '''Category Class''' || '''Category Icon''' || '''Subcategories'''
|-
|style="background:gray" | [[Image:books.png|40px]] || Books and reference || books || books.png|| picture books, reference, stories
|-
|style="background:gray" | [[Image:science.png|40px]] || Math and science || science || science.png || biology
|-
|style="background:gray" | [[Image:images.png|40px]] || Images and maps || images || images.png || nature, atlas, historical
|-
|style="background:gray" | [[Image:music.png|40px]] || Music and video || music || music.png || media
|-
|style="background:gray" | [[Image:activities.png|40px]] || Activities || activities || activities.png || games
|-
|style="background:gray" | [[Image:links.png|40px]] || Web links || links || links.png || search the web
|-
|style="background:gray" | [[Image:uniwiki.png|40px]] || Uniwiki || uniwiki || uniwiki.png || water & environment
|}

Visit the [http://dev.laptop.org/pub/content/library/ OLPC Library] to see these categories in action.

Revision as of 17:12, 9 August 2007

Here is an example library.info configuration file for a collection called Dictionary:

[Library]
name = "Dictionary"
library_version = 1
host_version = 1
l10n = false
locale = "en_US"
category = "Books and reference"
category_icon = "library-dictionary.jpg"
category_class = books
subcategory = "reference"
bundle_class = "dictionary"

Keys and Values

See library.info for a description of keys and values.