Conversion of Calvin's commentaries into OSIS format and a Sword module Important end products ---------------------- The compiled module is currently available in the Crosswire beta repository, and the complete ThML and OSIS files are here: http://lukeplant.me.uk/misc/sword/calvincommentaries.thml.bz2 http://lukeplant.me.uk/misc/sword/calvincommentaries.osis.bz2 http://lukeplant.me.uk/misc/sword/calvincommentaries.versified.osis.bz2 Requirements: ------------- On Linux and other Unix systems, most requirements should be installable via the package manager if no specific source is given. - ThML sources: calcom??.xml files, as downloaded from CCEL. For convenience, a recent version of the files can be downloaded here: http://lukeplant.me.uk/misc/sword/calcom_sources.tar.bz2 Extract this file. - thml2osis.xslt from http://crosswire.org/svn/sword-tools/trunk/thml2osis/xslt/ - xsltproc for processing the above - Python (for the script that combines calcom??.xml files) - PyXML library. This has not beeen updated for Python 2.6 yet, which means you should use Python 2.5 (Python 2.4 should also work) - Python swordutils library: http://crosswire.org/svn/sword-tools/trunk/python A checkout of this directory should be in your PYTHONPATH - Perl (for various text manipulations) - csplit Make the module --------------- First edit 'bundle_and_install', setting directories as chosen. If you don't want the module installed at the end, comment out the last line which unzips it into place. TODO: - get osis2mod to handle commentaries properly (instead of requiring them to be marked up Bibles as currently). Once this is done, most of the ugliness in 'bundle_and_install' will go away, and it gets a whole lot simpler. - Check the OSIS actually validates Explanation of steps -------------------- 1) 'Correct' some of the ThML files. In particular, change the 'scripCom' tags so that they enclose the text they refer to, rather than just coming at the beginning of it. This is done as part of combine_calcom.py 2) Combine all the ThML files into one big one, and at the same time: - modify the header information, using one of the calcom??.xml files as a template - make any corrections necessary to the ThML for the new context This is the second task of combine_calcom.py. Output: calvinscommentaries.thml 3) Convert to OSIS, using thml2osis.xslt Output: calvinscommentaries.osis 4) Convert to format required by osis2mod. This uses 'genbookOsis2Commentary.py' script. Since this script is DOM based, it uses up too much memory if all of calvinscommentaries.osis is loaded. To get round this, the OSIS file is split into lots of bits (using markers inserted earlier), then run through genbookOsis2Commentary. Also genbookOsis2Commentary gets rid of some other bits of 'non-commentary' text that otherwise ends up in the module, and probably isn't wanted. 5) Run osis2mod, create the zip file etc.