DevTools:Misc

From CrossWire Bible Society
Revision as of 07:44, 9 January 2018 by Refdoc (talk | contribs)

Jump to: navigation, search

Some miscellaneous development tools are available in a Subversion repository available at:

http://crosswire.org/svn/sword-tools/

This contains tools, programs and libraries in various languages that are usually used for the creation of modules. It includes scripts that module authors may use in their preparation of modules. These are mainly undocumented and not intended for any public release. Documentation of some of these tools can be found below or in the READMEs in the repository.

thml2osis

This is an XSLT program that attempts to convert ThML sources (such as those on CCEL) into valid OSIS, as losslessly as possible. The OSIS can then be used for creating SWORD modules. See the README in the relevant directory for more information.

Scripts and Filters

sed scripts

To create ThML cross references out of (<Book> <Chapter>:<Verse>) type references:

sed -e 's/\(\(\([123][CJKPST]\|[AC-Z]\)[a-z]\+\.\?\)\? *[0-9]\+:[0-9]\+\
\([-,:]\( \?[0-9]\+\)\?\)*\)\([a-z]\|ff\.\)\?\([],.;:)=]\| \
[A-Za-z(=[]\)/<scripRef passage="\1">\1\6<\/scripRef>\7/g'

Swapping badly formatted references <verse>:<chapter> to <chapter>:<verse> can be done with this script.

sed -e 's/\([0-9]\+\):\([0-9]\+\)/\2:\1/g'

TextPipe filters

The Windows application TextPipe Standard (available from DataMystic) is a very useful tool for file format shifting and related tasks. This proprietary program is not free, but for the non-programmer, it may be easier to learn to use than writing perl scripts or sed scripts.

See also