Sunteți pe pagina 1din 10

Last update: 11-Aug-09, ver 0.2 Main structure of the file: 1.

Bible files have the following extensions: a. .ont: for files containing both OT and NT (31102 lines) b. .nt: for files containing NT only (7957 lines) c. .ot: for files containing OT only (23145 lines) 2. From version 3, encrypted modules are also supported. Encrypted modules have an extra x at the extension (e.g. .ontx, .otx, .ntx). To encode a module you should run the theword.exe in command line specifying the encrypt parameter. 3. The file must contain exactly 31102 lines (for .ont files, respectively for others), one for each verse. Each line may be separate by char(13)+char(10) or char(10) only (standard line breaks for windows) 4. The versification (e.g. how the 31102 lines are split in books/chapters/verse) conforms to the standard KJV (include here a detailed numbering) 5. The files can either be in ansii or UTF8 encoding (for UTF8 files, a BOM is required at the beginning: most editors will add this automatically). For ansii files, an attribute must be add to the end of the file (charset=n), in order to be properly recognized. In general, ansii files are a bit faster to handle/search. If the Bible module contains a language that can be supported by a standard ansii encoding, its use is encouraged. Important: For Arabic and Hebrew modules, it is important to always add the charset attribute (for Arabic charset=178, for Hebrew charset=177) at the end, even if the file is unicode. The reason is that in Win9x RTL or Enabled systems, a trick is used for the proper right-to-left alignment to work. This can be done only if the charset attribute is there (so TW can understand that this is an Arabic or Hebrew module). 6. In the text, XML like tags (and html) are used to denote semantics. They are case sensitive. 7. At the end of the file (after the 31102 lines), a set of attributes (in the form name=value) may be present. Values supported are: a. id: the module id. This is a unique identifier among all other TW modules. It is important that this attribute is present at least for the official TW modules. There will be a way to request and get unique IDs officially (refer to the forum pls http://forum.theword.gr). If an id is not present, the program will use the filename as the ID. Notice that links that refer to this module usually use this unique ID.

b. lang ISO639-2 language id. You may also use the ISO639-1 codes, but please prefer the ISO639-2 ones (3 letters instead of 2). You can find the list here: http://www.loc.gov/standards/iso639-2/php/code_list.php c. charset=<charset> The value should be a standard windows charset (e.g. 161 for Greek). d. font=<comma separated list with fonts> If the module should use special fonts, a comma-separated list can be set here. These are proposed fonts: if one is present in the target system, it will be used e. font.size=[-10..+10] Relevant font size from -10 to +10 f. short.title=<title>: an abbreviation used to display the module in the Bible view. This is also used as an identifier for the module. This attribute is similar to the abbrev attribute of the Book modules g. title=<title of the module>, e.g. King James version. Think of this as the title of a book. h. title.english=<english title> This is an english translation of the title field that is used for the installers. PLEASE, provide and dont leave it empty if you module is a non-English one. For english modules, leave this field empty i. description=<description> This is a longer description about the module (e.g King James version of 1611 including blah blah blah) that is shown when the user moves the mouse over the tab and in other places in the program. This can be more lines. j. version.major=<number> Major version of the module k. version.minor=<number> Minor version of the module l. version.date: date of last revision of this electronic form. This date should be changed each time the version.major or version.minor is changed m. r2=1: for right-to-left modules (Arabic, Hebrew, etc) this should be added for proper display n. author: The author of the original work. Can be more than one separated by semicolon. Please, use standard naming in order to be able to search from within the program. Refer to the site to find standard names for authors. Last name should be first, followed by comma, then first name, then middle name. For example:
Darby, John N. Henry, Matthew

Calvin, John Clarke, Adam C. Kelly, William Smith, Hamilton Gill, John

o. keywords: list of keywords separated by semi colon. For Bibles, these should include basic characteristics that they include (Strongs, Parsing, Variants, Septuagint, Red Letter, Cross References). p. requires=a.b.c.d (e.g. 3.0.0.702): minimum program version required to display this module properly q. publish.date: the original date of publishing of this work. This is NOT the date that this module was created, but the date (year) that the original content was written from the original author. r. publisher Publisher of the resource (if applies or known) s. isbn if exists: the ISBN of the printed edition of this work t. creator name of the one that created this module (including emails if possible) u. contributors people that worked on it (including emails if possible) v. source the original source of this electronic form. Please, refer to original site, or other resource from which this resource was made. w. editorial.comments Comments about editorial practices: whether spelling was normalized, what was done with end-of-line hyphens, corrections that were made, tagging practices, etc. x. status Current status of texte.g. This text still needs proofreading y. nfmdid non-free module id. This is an id that uniquely identifies a non-free module. Non-free modules are only official modules, so the generation of this id is not detailed here. You should not change or remove this entry, or the module will not work properly. This value is 12-bytes in hex format, e.g. 24 16-base digits. z. about=<about> This is an html (or rtf from ver. 3) long description of the Bible module. If there is a copyright, it should go here. If in html format, pls use simple html (no css supported). To span multiple lines, use a backsplash (\) at the end of the line to continue to the next aa. tag.rule=<tag_starts_with> <tag_regex_search_pattern> <tag_replacement> Version 3 upwards. Attributes are separated by space or comma. If you need to include spaces in the attributes, enclose the whole attribute in double quotes (to use actual

double quotes, write them twice). For example: The tag.rule attribute may appear more than once: tag rules are applied in the order they appear. The tag rules apply to the tags that start with the <tag_starts_with> letters. The tag.rules are very useful when a module needs to be linked to en external resource (e.g. commentary, dictionary, etc) using the <a href=url></a> format for links bb. verse.rule=<tag_regex_search_pattern> <tag_replacement> Attribute follow the same rules as tag.rule attribute. These rules are applied to each verse (as a whole) before it is being prepared for rendering. These rules are applied BEFORE the tag.rules! e.g., Special notice: the [vref] is replaced in the verse rule with the actual verse id (e.g. bi.ci.vi). This is very useful for links that need to dynamically refer to the current verse. An example link that uses this feature would be: tw://cmt.mynotes?t=[vref].
verse.rule="(^|[^>]+)<W([GH](\d+))>" "<a href=""tw://[strong]? t=$2&popup=1"">$1</a>"

cc. notags=1 If this special attribute is present, then ALL not-known tags are treated as simple text. This is useful if a text uses a special font and the character < and > may be used for anything (there is not way to add tags there). Unfortunately, this is not a perfect implementation. If a combination of < and > (in this order) appear in a verse, the following things will NOT work properly: i. ii. Searching of the text between these 2 chars User highlighting (it will be offseted to the right).

OK, since this is a very rare attribute to use and ONLY for texts with special font (only Slavonic as of this writing), I hope it doesnt limit the functionality too much.

Formatting tags recognized by The Word in Bible module files The following html tags (with no semantic info) can be recognized): <u></u> <i></i> <b></b> <br> <p> <sup></sup>

<sub></sub> <font color=<color> size=<+/-n>></font> <span style=<color|background|border-bottom>:<color|solid|dashed|dotted|ridge> <color| #XXXXXX>></span> Use of html tags is heavily DISCOURAGED since they bring no semantic info. <color>: either a string (e.g. red, blue, etc) or in the form #xxyyzz (html format). Also one of the default TW colors can be used with the notation defclrX where X is: used. (since version 2 is using an html renderer, more html tags are supported, but ver.3 will use an rtf renderer with support for these only) The following semantically recognized tags are supported: <FI><Fi>: for added words (usually shown in italics, words added by translator) <CL>: for new line <CM>: for new paragraph. NOTICE for CL and CM tags: there must be AT LEAST one CL or CM tag at the end of one verse for other CL/CM tags that are inline to work properly. If (for any reason) the entire .ont file has CL/CM tags only inline the verses (and none at the end of at least one verse), they will not work. I consider this to be totally improbably, but it is something to be aware of. <FO><Fo>: for Old Testament quotes <FR><Fr>: for Words of Jesus (usually rendered in red color) <FU><Fu>: for underline words (no semantic here yet) <TSn><Ts>: for chapter headings. 3 levels are supported (TS1 which is equivalent to TS, TS2, TS3). This text appears as chapter headings. Chapter headings can be exchanged with other modules. 0 for text color 1 for italics 2 for word of Jesus 3 for strong indices 4 for morph indices 5 for footnotes 6 for xrefs 7 for headings 8 for OT quotes

For example: <font color=defclr5></font> can be used if you want the color of the footnotes to be

They are supported in the beginning of a verse and in the middle. No other formatting tags should be added for the chapter headings itself <WGXXX[xs]>: Greek strongs codes: they must follow the word they refer to. XXX is the strongs number <WHXXX[xs]>: Hebrew strongs Some notes on strong tags: notice that after the strong number a x or an s may appers (e.g. <WG123x> or <WG123s>). These 2 letters has special meanings: 1. The x means that this Strong number corresponds to an original word that is not translated. This means that such a strong word will not have a corresponding word in the translation and is probably be exactly after another one. Such a strong word will rendered by default in parenthesis (123). This default rendering can be changed by including a property at the end of the file named 'untranslated.strong.format'. For example, if you want to render these numbers in square brackets, you can add at the end of the file the line (without the quotes): untranslated.strong.format=[%s] (notice the %s represent the default rendering). 2. The s appears when an original word is translated in 2 words. For example: Original: He is a songwriter<STRONGWORD> Translation: He is a writer<STRONGWORD> of songs<SAME STRONGWORD> Notice that the original word strongwrite is translated in 2 words. The s will be added in the second strong word to show that this is not a separate word in the original but corresponds to the same one (useful when counting strong words). Such a strong word will rendered by default in bracker [123]. This default rendering can be changed by including a property at the end of the file named sameword.strong.format'. For example, if you want to render these numbers in parenthesis, you can add at the end of the file the line (without the quotes): sameword.strong.format=(%s) (notice the %s represent the default rendering). <WTXXX>: Morphology codes: corresponds to Robinsons Morphological codes <RF><Rf>: footnotes: they can appear anywhere in a verse. No formatting tags for text of footnotes <RX b.c.v-v [q=<quote>]> (or <Rx>): cross-references. The book/chapter/verse index follows. They can appear anywhere in a verse. A range can be defined either using a dash (-) or a plus sign (+). Dash denote ending verse, plus denotes interval. For example:

<RX 1.1.1> refers to Gen. 1:1 <RX 1.1.3-4> refers to Gen. 1:3-4 <RX 1.1.3+1> refers to Gen 1:3-4 The q attribute is optional and can be used to denote the quote character, e.g. <RX 1.1.1 q=a> <RX 1.1.3-4 q=b> If the q attribute is present, then instead of the usual numbers for the xrefs (1, 2, 3) the quote characters will appear instead (a, b, etc) <a href=url>.</a>: general type links: the url can contain the following (complete this): (pattern compiled: 'tw://((bible|cmt|dct|bk|book|map|media)\.)?([^#\?]+)(\?)?([^#]*)(#)?(.*?)') [strong]: for current strong module [morph]: for current morph module The following can be added: _IGNORE_: to denote this as non-Bible text _NOLINK_: to avoid a link popup=[0,1,2]: to specify if content should appear in popup when mouse hovers t=<topic_id>: the topic-id of the module it refers to. (Give many examples here) <NB toggle=footnotes|xrefs|cmts|strong|morph|[single-character]><Nb>: non-Bible text (ver. 3.0.0.671+). This tag is used to mark some text in the verse as NOT belonging to the Bible (like notes). This is very useful when you create custom links inline the text and you dont want the linked text (e.g. a number) to be counted as Bible text. The toggle parameter (optional) can take 6 values: footnotes, xrefs, cmts, strong, morph or a single character (e.g. NB toggle=e>). This parameter allows the text between to be toggled (shown/hidden) along with the footnotes or xrefs or commentary links. This is very usefule and the choice is up to the module-maker. I believe the footnotes is most useful, if these are links to a commentary or another resource. IMPORTANT: if the text between the NBNb tags contains links, then the |_IGNORE_ directive should be appended to the href of the link. If this is not done, highlighting will not work properly. Example of usage of NB with a verse rule:
verse.rule="<N\s+(.+?)\s*>" "<NB toggle=footnotes><a href=tw://cmt.netnotes?t=[vref]#a$1| _IGNORE_><font color=blue><sup>$1</sup></font></a><Nb>"

This allows tags in the form: <N 1> in the text that are displayed as foonotes and link to a commentary. Notice the _IGNORE_ directive within the href. Notice also the [vref] that is parsed in the verse rule. The NB tag should not be used directly within the text, but is designed to be used as a verse rule for replacing tag that contain all text within the tag (e.g. tags like <N xyz> and NOT tags like <N>xyz</N>). If you use it like that, the highlighting of search results will be incorrect. Notice that Text between NB tags is NOT searchable. Concerning the keys: since many of the keys are already used for several options in TW, its good to be careful when you use a key for the toggle parameter. At the moment of writing, unassigned keys are (not exclusively): a b e g i k v y z, r <ST toggle=footnotes|xrefs|cmts|[single-character]> <St>: Switchable text: this tag is similar to the <NB> (see above)tag and it can be used to have some text (which is considered part of the Bible text, e.g. it is searchable, it can be highlighted, etc) that can be switched on/off with a key. How to create links: examples You will need to edit manually the .ont file. These are plain text files (either ansii or utf8). You will need to just enter the links directly in the text. 1. To create a link to a web-page, just use the standard html notation: <a href=[target]></a>. For example, to add a link to the home page of The Word, just enter: <a href=http://www.theword.gr>...</a>. You can use as a link text any part of the Bible iteself, or you can use your own text, for example: <a href=http://www.theword.gr>CLICK HERE</a>. Of course, you could format your link text (for example blue superscript font), for example: <a href=http://www.theword.gr><font color=blue><sup>CLICK HERE</sup></font></a>. 2. The same technique applies if you want to make a link to a non-Bible resource (e.g. dictionary, commentary, etc). The only thing you should change is the url target. The exact pattern supported is given by the regular expression : 'tw://((bible|cmt|dct|bk|book|map|media)\.)? ([^#\?]+)(\?)?([^#]*)(#)?(.*?)'. Because this seems complicated, I will give some examples. 3. To create a link to the Websters dictionary to the topic Aaronic, the target should be: tw://webster.dct?t=Aaronic Notice that webster.dct is just the filename of the dictionary without the .twm extension. In general, each module is either identified by its filename (without the .twm extension) or by the entry id in the config table (the id takes precedence of course). The t= parameter indicates which topic you are interested in. The t parameter is the complete topic subject. There is the

possibility to use the internal id of the topic using the tid parameter (though this id is not visible from within the program: it can be found in the topics or bible_refs table). So, the full link can be written: <a href= tw://webster.dct?t=Aaronic><sup>LINK</sup></a> 4. For tw:// style links, you may use the extra parameter popup=0 (or 1 or 2). This parameter specifies whether the topic entry is displayed in a popup when the mouse hovers over it. Value: a. 0: means that no popup appears when mouse hovers over the link b. 1: means the a popup appears with the content of the subject c. 2: means that a popup appears only if CTRL is pressed when mouse hovers over. 5. You can have more than one links in the same URL (ver. 3.0.0.694+) by separating them with the | character. For example: <a href=tw://[strong]?t=G1|tw://[morph]?t=nnsf>LINKTEXT</a> 6. Its obvious that when linking to an external resource (like in our example the Webster dictionary) it is need to add every time a link like the following: <a href=tw://webster?t=[SUBJECT]&popup=1><font color=blue><sup>[LINKTEXT]</sup></font></a> It is obvious that this is not practical and a lot of text is duplicated. It would be better if there could be a new tag (e.g. <Q>) that would only include the [SUBJECT] and [LINKTEXT] that are the data that are changed each time. In order to simplify this, the verse.rule property at the end can be used! A verse rule is just a substitution (like you do a search-and-replace with your editor) that takes places for each verse as it is read from the file. By using regular expressions, it is easy to create dummy attributes that, when substituted, produce the proper <a href> attribute links. In our example we could do the following: a. Add at the end of the file, a line that says: verse.rule="<Q\s* ([^ ]+) (.+?)>" "<a href=tw://webster.dct?t=$1&popup=1><font color=blue><sup>$2</sup></font></a>" (for syntax see above about the verse.rule) b. When we wat to add links in the text, use the tag Q like this: <Q [SUBJECT] [TEXTLINK]> Doing this is much easier and less prone to errors. So, instead of writing: <a href= tw://webster.dctt=Aaronic><font color=blue><sup>a</sup></font></a> in the text, we can just write: <Q Aaronic a>

Now, its very easy to add the links in the file. This also gives the extra plus that if one wants to change some behavior (e.g. set popup=1 instead of popup=0) it only needs to be changed at one place, at the end of the file.

S-ar putea să vă placă și