Difference between revisions of "DevTools:conf Files"
m (fixed a <reference/> without a preceding <ref/>) |
(→General informatic and installer elements: updated format and text to read more easily) |
||
Line 361: | Line 361: | ||
! width="10%"|Allows | ! width="10%"|Allows | ||
|- | |- | ||
− | | Abbreviation< | + | | Abbreviation |
− | | <string><br/> | + | | |
− | A | + | '''<string>'''<br/> |
− | + | This field allows for the localization of the module name. It is meant to be short just like the module name. | |
+ | | [module name] | ||
+ | | [[DevTools:conf Files#Localization|Localization]] | ||
+ | |- | ||
+ | | About | ||
+ | | | ||
+ | '''<string>'''<br/> | ||
+ | A lengthier description and may include copyright, source, etc. information, possibly duplicating information in other elements. | ||
| | | | ||
+ | | Continuation<br/>RTF<br/>[[DevTools:conf Files#Localization|Localization]] | ||
|- | |- | ||
− | | | + | | SwordVersionDate |
− | | < | + | | |
− | + | '''<yyyy-mm-dd>''' ([http://en.wikipedia.org/wiki/ISO_8601 ISO 8601 Date])<br/> | |
+ | Indicates the date that the module was changed. | ||
+ | | | ||
| | | | ||
− | |||
|- | |- | ||
| Version | | Version | ||
− | | <version string><br/> | + | | '''<version string>'''<br/> |
Gives the module's revision number. Incrementing it when changes are made alerts users of the SWORD Installers to the presence of updated modules. Please start with version 1.0 and increment by 0.1 for minor updates and by larger values for more major updates such as a new text source. Changes to this conf file should also increment the version number. Do not use non-numbers, such as 1.4a. | Gives the module's revision number. Incrementing it when changes are made alerts users of the SWORD Installers to the presence of updated modules. Please start with version 1.0 and increment by 0.1 for minor updates and by larger values for more major updates such as a new text source. Changes to this conf file should also increment the version number. Do not use non-numbers, such as 1.4a. | ||
Line 381: | Line 390: | ||
| | | | ||
|- | |- | ||
− | | History_x.x | + | | History_x.x |
− | | <string><br/> | + | | '''<string>'''<br/> |
− | + | x.x is taken from the Version value. | |
+ | |||
+ | Indicates what has changed between different versions. Each time a version is incremented a history line with that version number should explain the change. | ||
+ | |||
+ | It is recommended that each explanation be suffixed by the corresponding SwordVersionDate value. | ||
| | | | ||
− | | Repeats | + | | Repeats<br/>[[DevTools:conf Files#Localization|Localization]] |
|- | |- | ||
| MinimumVersion | | MinimumVersion | ||
Line 394: | Line 407: | ||
|- | |- | ||
| Category | | Category | ||
− | | | + | |valign="top"| |
+ | '''Daily Devotional''' (for modules with Feature=DailyDevotion)<br/> | ||
+ | '''Glossaries''' (for modules with Feature=Glossary)<br/> | ||
+ | '''Cults / Unorthodox / Questionable Material'''<br/> | ||
+ | '''Essays''' (for essays)<br/> | ||
+ | '''Maps''' (for modules that primarily consist of maps)<br/> | ||
+ | '''Images''' (for modules that primarily consist of images)<br/> | ||
+ | '''Biblical Texts''' (for Bibles)<br/> | ||
+ | '''Commentaries'''<br/> | ||
+ | '''Lexicons / Dictionaries'''<br/> | ||
+ | '''Generic Books''' (for anything else....)<br/> | ||
This is used by installers to further categorize the modules beyond what can be figured out by the ModDrv and Feature. | This is used by installers to further categorize the modules beyond what can be figured out by the ModDrv and Feature. | ||
− | | Biblical Texts | + | | |
− | Commentaries | + | Biblical Texts<br/> |
− | Lexicons / Dictionaries | + | ''ModDrv=RawText'' or<br/> |
− | Generic Books | + | ''ModDrv=RawText4'' or<br/> |
+ | ''ModDrv=zText'' or<br/> | ||
+ | ''ModDrv=zText4''<br/> | ||
+ | Commentaries<br/> | ||
+ | ''ModDrv=HRefCom'' or<br/> | ||
+ | ''ModDrv=RawCom'' or<br/> | ||
+ | ''ModDrv=RawCom4'' or<br/> | ||
+ | ''ModDrv=RawFiles'' or<br/> | ||
+ | ''ModDrv=zCom'' or<br/> | ||
+ | ''ModDrv=zCom4''<br/> | ||
+ | Lexicons / Dictionaries<br/> | ||
+ | ''ModDrv=RawLD'' or<br/> | ||
+ | ''ModDrv=RawLD4'' or<br/> | ||
+ | ''ModDrv=zLD''<br/> | ||
+ | Daily Devotional<br/> | ||
+ | ''Feature=DailyDevotion'' and<br/> | ||
+ | ''ModDrv=RawLD'' or<br/> | ||
+ | ''ModDrv=RawLD4'' or<br/> | ||
+ | ''ModDrv=zLD''<br/> | ||
+ | Glossaries<br/> | ||
+ | ''Feature= Glossary'' and<br/> | ||
+ | ''ModDrv=RawLD'' or<br/> | ||
+ | ''ModDrv=RawLD4'' or<br/> | ||
+ | ''ModDrv=zLD''<br/> | ||
+ | Generic Books<br/> | ||
+ | ''ModDrv=RawGenBook''<br/> | ||
| | | | ||
|- | |- | ||
| LCSH | | LCSH | ||
− | | <tree/string><br/> | + | | '''<tree/string>'''<br/> |
Library of Congress Subject Heading. You may search the [http://catalog.loc.gov Library of Congress catalog] or use it as a guide for determining an appropriate LCSH for books that are not in the Library of Congress. | Library of Congress Subject Heading. You may search the [http://catalog.loc.gov Library of Congress catalog] or use it as a guide for determining an appropriate LCSH for books that are not in the Library of Congress. | ||
| | | | ||
Line 409: | Line 457: | ||
|- | |- | ||
| Lang | | Lang | ||
− | | <xml:lang identifier><br/> | + | | '''<xml:lang identifier>'''<br/> |
− | + | Identifies the '''Language''' and optionally the '''Script''', and/or '''Region'''. | |
− | + | '''Language''' ''(Regex: /[a-z]{2,3}/)'':<br/> | |
+ | This is the primary language code of the module and should include a value according to BCP 47 (i.e. [http://tools.ietf.org/html/rfc4646 RFC 4646] & [http://tools.ietf.org/html/rfc4647 RFC 4647]). When available use a 2-letter code from [http://en.wikipedia.org/wiki/ISO_639-1 ISO 639-1 codes] ([http://www.loc.gov/standards/iso639-2/php/code_list.php registrar]), (e.g. ''en'' for English). If there is none for the given language, use an [http://en.wikipedia.org/wiki/ISO_639-2 ISO 639-2/T code] (e.g. ceb for Cebuano) ([http://www.loc.gov/standards/iso639-2/php/code_list.php registrar]). Failing that, use [http://en.wikipedia.org/wiki/ISO_639-3 ISO 639-3] ([http://www.sil.org/iso639-3/codes.asp registrar]), which covers over 7000 languages, or [http://en.wikipedia.org/wiki/ISO_639-5 ISO 639-5] ([http://www.loc.gov/standards/iso639-5/id.php registrar]) for macrolanguages. | ||
− | If a text is | + | '''Script''' ''(Regex: /[A-Z][a-z]{3}/)'':<br/> |
+ | If a text is script-specific, such as a Latin vs. Cyrillic Serbian Bible or a Bible transliterated into other than its native script, include the [http://en.wikipedia.org/wiki/ISO_15924 ISO 15924 script code] ([http://unicode.org/iso15924/iso15924-codes.html registrar]) after the language code (e.g. sr-Latn for Latin script Serbian, sr-Cyrl for Cyrillic script Serbian). | ||
− | Individual subtags (language, script, and region) are always separated by a hyphen. | + | '''Region''': ''(Regex: /[A-Z]{2}/)''<br/> |
+ | If a text is region (country)-specific, such as the Anglicized NIV, include the [http://en.wikipedia.org/wiki/ISO_3166-1 ISO 3166-1 region code] ([http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html registrar]) after the script code (or language code if no country code is present) (e.g. en-GB for UK English). | ||
+ | |||
+ | '''Combinations'''''(Regex: /[a-z]{2,3}(-[A-Z][a-z]{3})?(-[A-Z]{2})?/)'':<br/> | ||
+ | Individual subtags (language, script, and region) are always separated by a hyphen. Identifiers should be as basic and succinct as possible. A script should not be specified for a language written in its expected script, unless the language has multiple common scripts (as in the case of Serbian above). A region should not be specified unless a text should be categorized separately from others texts in that language that do not specify a region. Private use extensions defined by BCP 47 (e.g. x-, qaa, and Qaaa) should be avoided wherever possible. | ||
See also [http://multitree.linguistlist.org/ MultiTree: A Digital Library of Language Relationships]. | See also [http://multitree.linguistlist.org/ MultiTree: A Digital Library of Language Relationships]. | ||
Line 422: | Line 476: | ||
| | | | ||
|- | |- | ||
− | | InstallSize | + | | InstallSize |
− | | <integer | + | | |
− | + | '''<integer>'''<br/> | |
− | + | Indicates the total byte size of the module on disk, excluding the the size of any Lucene index files. | |
− | + | ||
− | + | For modules in the CrossWire repositories, this is automatically generated and overwritten if needed. | |
− | |||
− | |||
| | | | ||
| | | | ||
|- | |- | ||
| Obsoletes | | Obsoletes | ||
− | | <name | + | | |
− | Each instance of this element | + | '''<module name>'''<br/> |
+ | Each instance of this element gives a former module name that is made obsolete by this module. | ||
| | | | ||
| Repeats | | Repeats | ||
|- | |- | ||
| OSISVersion | | OSISVersion | ||
− | | <version string> | + | | |
− | Identifies the OSIS schema version employed in the OSIS source document. | + | '''<version string>'''<br/> |
+ | Identifies the OSIS schema version employed in the OSIS source document. The current version is 2.1.1. | ||
+ | |||
+ | It is recommended that this be present for every OSIS module. | ||
| | | | ||
| | | | ||
|- | |- | ||
| Companion | | Companion | ||
− | | < | + | | |
+ | '''<module name[, module name]*>'''<br/> | ||
+ | Specifies companion module(s) that should be opened together<br/> | ||
e.g. When Bible and Commentary modules are distributed together. | e.g. When Bible and Commentary modules are distributed together. | ||
| | | | ||
| | | | ||
|} | |} | ||
− | |||
=== Copyright & Licensing related elements === | === Copyright & Licensing related elements === |
Revision as of 19:14, 15 March 2015
Creating a .conf File
module.conf File Layout
The module.conf[1] file tells the SWORD engine how to treat installed module files, etc. which kind of markup they contain, and so forth.
Below is a listing of the possible directives in that file. Each of these directives of the form key=value. Some keys can be repeated. Some can have values that span more than 1 line with '\' at the end of a line indicating that the text on the next line continues the value. Some values allow RTF and some allow HTML <a href="xxx">label</a>hypertext links. HTML is not allowed otherwise.
Note on RTF, only the following are allowed:
- \qc - for centering
- \par - for paragraph breaks
- \pard - for resetting paragraph attributes, i.e. turning off centering.
- \u{num}? - for unicode characters, where {num} is a signed, 16-bit representation of the code point and where ? is the ASCII character used in case unicode is not supported. If the {num} is less than 0 then add 65536 to it. This should only be used in modules that have an Encoding=UTF-8, but using the actual UTF-8 character is preferred.[2]
Enumerated values are shown in bold. These should be used exactly as given and no other values should be used.
The order of elements specified in a conf file is immaterial, except where specified otherwise.
Configuration elements not defined in this page are assumed to be ignored by most front-end applications.
Any line that starts with a semicolon or a hash should be ignored by front-end applications, and treated as a remark or comment line.
Notes:
- ↑ Not to be confused with a locale .conf file for a language.
- ↑ UTF-8 encoded .conf files shall omit the Byte Order Marker (BOM).
Required Elements
Element | Values (type or enumerated) | Default Value | Allows |
---|---|---|---|
[name] | Each conf file begins with [name], replacing "name" with a short well known abbreviation for the module (e.g., [KJV]). This must be first in the file. Valid characters for this abbreviation are limited to A-Z, a-z, 0-9 and _. The .conf file should be named the lowercase of this abbreviation followed by .conf. For example, [MyModule] would be mymodule.conf. |
||
Description | <string> This is a short (1 line) title of the module. |
Localization | |
DataPath | <relative system path pointing to the data files>
DataPath is the path to the module data files relative to the SWORD module library root directory. This path should start with "./modules". If the DataPath indicates a directory it should end with a '/'. Otherwise the module name is both the directory and the prefix for each file in that directory. Although DataPath can point to any folder or files under the root of the SWORD module library, the following conventions are recommended and must be used for modules wishing to be included in a CrossWire repository: Paths for a module named [mymodule], depending on the type of module (Bible text, commentary, lexcon or dictionary, general book) and the data driver used are:
|
||
ModDrv |
RawText (for uncompressed Bibles) |
Required Elements with defaults
Element | Values (type or enumerated) | Default Value | Allows |
---|---|---|---|
SourceType |
Plaintext |
Plaintext | |
Encoding |
Latin-1† (Windows Codepage 1252 (cp1252)) The preferred encoding of texts is UTF-8. Other than Hebrew, UTF-8 modules must be encoded with Normalization Form C (NFC). Hebrew requires special handling. To date no module use UTF-16 or SCSU. †Warning: "Latin-1" is an ambiguously used term. Latin-1 is regularly used as a synonym for ISO-8859-1. Here it means Windows Codepage 1252, a superset of ISO-8859-1. Front-end implementors should use "cp1252" or "windows1252" explicitly, not "Latin-1" provided by some programming language libraries. |
Latin-1 | |
CompressType |
ZIP |
LZSS | |
BlockType |
BOOK |
CHAPTER | |
BlockCount |
<integer> |
200 | |
Versification |
Catholic |
KJV | |
CipherKey | <string> Indicates that a module is enciphered and that the module is (un)locked. When the key has no value ("CipherKey=") the module is locked. When it has a value, the module is unlocked. A good key is something that is hard to guess. Typically in a format matching the pattern: /[0-9]{4}[A-Za-z]{4}[0-9]{4}[A-Za-z]{4}/. Internally the key can be any byte sequence from 1 to 255 bytes in length. But it needs to be readable, plain text, without leading or trailing spaces. |
||
KeyType |
TreeKey |
TreeKey |
Elements required for proper rendering
Element | Values (type or enumerated) | Default Value | Allows |
---|---|---|---|
GlobalOptionFilter |
GBFStrongs (For GBF texts having Strong's Numbers) |
Repeats | |
Direction |
LtoR (Left to Right) |
LtoR | |
DisplayLevel | <integer> Used for General Book module types (these are keyed with a TreeKey table of contents). Indicates the preferred level from a leaf in the tree to display for context. e.g., 1 will only show the requested entry; 2 will show the entry, surrounded by all siblings, etc. |
1 | |
Font | <string> Specify the font to be used for display of the module if it is available. Omit this line to use the default font. Do not make use of font-specific encodings in your documents, but use Unicode instead and the Private Use Area if necessary for codepoints that are not handled by Unicode. |
||
|
This attribute is deprecated in favor of the marker attribute on the q element. E.g.: <q who="Jesus" marker="">....</q>
|
true | |
Feature |
StrongsNumbers (for modules that include Strong's numbers) |
Repeats | |
GlossaryFrom | <xml:lang identifier> Glossaries map one language to another. This value indicates the language being translated from. See Lang below for a discussion of valid values. |
||
GlossaryTo | <xml:lang identifier> Glossaries map one language to another. This value indicates the language being translated to. See Lang below for a discussion of valid values. |
||
PreferredCSSXHTML | <filename> Names a file in the module's DataPath that should be referenced for the renderer as CSS display controls. Generality is advised: Use controls that are not specific to any particular rendering engine, e.g. WebKit. |
- ↑ See https://en.wikipedia.org/wiki/Cantillation
- ↑ Must precede OSISStrongs.
- ↑ Minimum SWORD version of 1.7.0 in the module .conf is required for OSISGlosses.
- ↑ Deprecated in 1.7.0. Use OSISGlosses instead.
- ↑ The Samaritan Pentateuch module SP is an example of using xlit.
- ↑ The Samaritan Pentateuch module SP is an example of using enum.
- ↑ New in SWORD 1.7.0 - This filter requires six vertical bar-delimited fields, of which the following is an example.
GlobalOptionFilter=OSISReferenceLinks|Reference Material Links|Hide or show links to study helps in the Biblical text.|x-glossary||On
Here are the different field meanings:
- "OSISReferenceLinks" = option filter class name (option class name internal to the engine). Always the same for this kind of filter.
- "Reference Material Links" = Visible name of this OSISReferenceLinks filter. This is what the user will see in the Global Options toggle lists.
- "Hide or show..." = A readable user tip explaining what the filter does.
- "x-glossary" = Tells this OSISReferenceLinks filter to filter all references with type="x-glossary".
- (empty) = Tells this OSISReferenceLinks filter to also require that subType="something" in order to filter. Empty means ALL type="x-glossary" references will be filtered regardless of subType.
- "On" = Default filter toggle value ("On" or "Off")
Optional elements to support particular features
StrongsPadding
At the heart of our lexicon/dictionary drivers, we have some old logic which tries to detect if a key value is a Strong's number, and if so, then pad it with leading zeros accordingly. To support this logic, the recognition has recently been added for an optional new .conf entry for lexicon/dictionary modules:
StrongsPadding=true|false
Notes:
- So as not to break everything, this currently defaults to true if it is not present in the lexdict module's .conf file
- It can be set to false if you are building a lexdict module which has entries which may be misconstrued as Strong's numbers.
- In a couple years, we'll probably switch the default to false, so it would be nice to add this line and set the value to true on modules which really do require the logic.
- This is only available in SWORD version 1.7 or later. JSword never had this problem.
Strip Filters
SWORD has the concept of "filtering" a module's text at different processing points for purposes other than rendering.
One of these filter-points is for searching and we call these filters Strip Filters.
Strip Filters are typically named something like OSISPlain or GBFPlain, etc. These typically take all the markup out of an entry and prepare the text to be searched, but anything can be done to the text to prepare it further for searching. We typically remove accents and vowel points from Greek and Hebrew respectively.
Any Strip Filter can be added to a module by the module author with a line in the .conf file, such as:
LocalStripFilter=GBFPlain
If diacritics need to be removed from Arabic, then we can certainly add a filter for this as well. The conf line would be:
LocalStripFilter=UTF8ArabicPoints
Our current list of filters can be found by browsing the source folder here:
http://crosswire.org/svn/sword/trunk/src/modules/filters/
They're pretty concise and don't involve much knowledge from the rest of the engine, making them easy to write if we need a new one.
This processing can replace or be complimentary to any processing done by clucene.
Since we need to strip markup, and other things clucene will likely never support (see PapyriPlain – annotations like [,],?{,}, underdot) we need this preprocessing mechanism to prepare the text before searching. We also maintain searching functionality apart from "fast indexed searching".[1]
Note:
- ↑ Currently supplied by clucene, but could be implemented by any other fast search framework that we might want to integrate in future.
General informatic and installer elements
Element | Values (type or enumerated) | Default Value | Allows |
---|---|---|---|
Abbreviation |
<string> |
[module name] | Localization |
About |
<string> |
Continuation RTF Localization | |
SwordVersionDate |
<yyyy-mm-dd> (ISO 8601 Date) |
||
Version | <version string> Gives the module's revision number. Incrementing it when changes are made alerts users of the SWORD Installers to the presence of updated modules. Please start with version 1.0 and increment by 0.1 for minor updates and by larger values for more major updates such as a new text source. Changes to this conf file should also increment the version number. Do not use non-numbers, such as 1.4a. CrossWire's standard practice is to indicate updates that only require a .conf-file update/download by incrementing the third most significant number (the revision number). For example, if module version 1.2 requires a .conf-file update. A new .conf file with version number 1.2.1 could be released. |
1.0 | |
History_x.x | <string> x.x is taken from the Version value. Indicates what has changed between different versions. Each time a version is incremented a history line with that version number should explain the change. It is recommended that each explanation be suffixed by the corresponding SwordVersionDate value. |
Repeats Localization | |
MinimumVersion | <version string> Identifies the minimum version of the SWORD library required for this module. |
1.5.1a | |
Category |
Daily Devotional (for modules with Feature=DailyDevotion) |
Biblical Texts |
|
LCSH | <tree/string> Library of Congress Subject Heading. You may search the Library of Congress catalog or use it as a guide for determining an appropriate LCSH for books that are not in the Library of Congress. |
||
Lang | <xml:lang identifier> Identifies the Language and optionally the Script, and/or Region. Language (Regex: /[a-z]{2,3}/): Script (Regex: /[A-Z][a-z]{3}/): Region: (Regex: /[A-Z]{2}/) Combinations(Regex: /[a-z]{2,3}(-[A-Z][a-z]{3})?(-[A-Z]{2})?/): See also MultiTree: A Digital Library of Language Relationships. |
en | |
InstallSize |
<integer> For modules in the CrossWire repositories, this is automatically generated and overwritten if needed. |
||
Obsoletes |
<module name> |
Repeats | |
OSISVersion |
<version string> It is recommended that this be present for every OSIS module. |
||
Companion |
<module name[, module name]*> |
Element | Values (type or enumerated) | Default Value | Allows |
---|---|---|---|
Copyright | <string> Contains the copyright notice for the work, including the year of copyright and the owner of the copyright. |
Continuation Localization | |
CopyrightHolder | <string> Contains the name of the copyright holder. |
Localization | |
CopyrightDate | <integer (indicating year)> | Localization | |
CopyrightNotes | <string> | Continuation Localization | |
CopyrightContactName | <string> Contains the name of the copyright holder. |
Continuation Localization | |
CopyrightContactNotes | <string> | Continuation Localization | |
CopyrightContactAddress | <string> Contains the mailing address of the copyright holder. |
Continuation Localization | |
CopyrightContactEmail | <string> Contains the email address of the copyright holder, preferably in the form: |
Localization | |
ShortPromo | <string> A link to the home page for the module, perhaps with an encouragement to visit the site. |
HTML Link Localization | |
ShortCopyright | <string> | Localization | |
DistributionLicense | Public Domain Copyrighted Copyrighted; Permission to distribute granted to CrossWire Copyrighted; Free non-commercial distribution Copyrighted; Freely distributable Copyrighted; Permission granted to distribute non-commercially in SWORD format GFDL GPL Creative Commons: by-nc-nd Creative Commons: by-nc-sa Creative Commons: by-nc Creative Commons: by-nd Creative Commons: by-sa Creative Commons: by Creative Commons: CC0 Use one of these strings verbatim. The actual copyright and/or license information is held in other elements. The last six licenses are Creative Commons licenses. |
||
DistributionNotes | <string> Indicates any additional notes about distribution of the module. |
Continuation Localization | |
TextSource | <string, probably a URL> Indicates, either in prose (such as "CCEL") or as a URL of the source of the text |
Continuation | |
UnlockURL | <string> Contains the URL (a bare URL, not an HTML <a> link) of a web page for unlocking instructions/payment |
URL |
Uniqueness
For comparing two versions of a module during module development, the module names and locations must be unique. For JSword based front-ends such as Bible Desktop, there is a further requirement, the Description items must be different.
Localization
Those .conf fields that are essentially text intended for presentation to the end-user may be localized by appending _locale to the field name, where locale is replaced by an appropriate locale code, according to BCP 47. See Lang above for details.
For example, to give a French description, you can have a field:
- Description_fr=....
In order to distinguish a regional form from the primary form of a language, e.g. Brazilian Portuguese vs. the Portuguese of Portugal, append the country code as in:
- Description_pt-BR=....
Script variants can be given as in:
- Description_zh-Hans=.... simplified Chinese ....
- Description_zh-Hant=.... traditional Chinese ....
In order for a .conf entry to appear in a localized form, a non-localized form of the same field must also occur within the .conf. For example, in order for a Description_en field to appear, a file must also possess a Description field. The locale of .conf entries without the locale modifier is the default and must reflect the locale/language of the module itself (as specified in Lang=) or English (if there are no localized versions of the field). In general, fields should be provided in the language of the module itself with English translations provided in parallel fields localized with _en. There is no explicit upper bound on the quantity of localized fields, but all localized and localizable fields should be unique.
Notes:
- At the present, this is only a planned feature. Module .confs can & should make use of this facility, but at the moment, there is no SWORD library or front-end support for it.
- See also Localized Language Names.