[sword-devel] compiling modules

Greg Hellings greg.hellings at gmail.com
Mon Nov 5 15:32:57 MST 2007

Welcome, Beth,

On 11/5/07, Beth Bryson <newsfrombeth at yahoo.com> wrote:
> I'm brand new to SWORD and this list.  I'm trying to compile some
> modules for a friend to use in MacSWORD, and I have run into some questions.
> 1. Is there a way to use vpl2mod or imp2vs on a machine that isn't a
> Windows machine?  I see the Win32 executables, but I would like to run
> them in the terminal on my Mac.  Are there Perl versions of those?

If you pull the actual Sword source (from the part of the download
section that claims to be for Linux) and compile it from the command
line after the standard
sudo make install

then you can run the importing tools, etc, from the command-line.  You
will have to be sure, though, that you have all of the prerequisite
libraries, including things like cURL.  I find that either Darwin
Ports or Fink have everything I need for those.

> 2. For vpl2mod, does "prepended verse refs" mean that my text includes
> the prepended verse info, or that I want to tool to prepend them?  My
> text looks like this:
> Matthew 1:1: This is the first verse.
> Matthew 1:2: This is the second verse.
> but it doesn't seem to use that verse information to decide where to put
> the content, regardless of whether I choose 0 or 1 for that argument.  I
> get better results with "1", but I still get a screen full of lines that
> say "problem", with no indication of what the problem is or what line
> the problem occurs on.  (I think it must occur on *all* the lines--there
> are that many lines of it.)

I don't know what the information about "prepending verse information"
means, but I do know that vpl2mod specifically requires that your
module have EXACTLY the same versing scheme that the original KJV had.
 And all the text on the line is placed into the verse text.  Thus the
source of your problem in 3, where the importer thinks that the string
"Matthew 1:1" is part of the verse.  Thus, if you're using vpl2mod, do
not include anything other than the exact text itself.

> 3. My verse references seem to be ending up in the text.  In MacSWORD, I
> see this:
> Matthew
> 17
> 1 Matthew 17:1: This is the first verse
> 2 Matthew 17:2: This is the second verse
> Is there a way to *not* have the "Matthew 17:1:" appear?  Does this have
> to do with how I built my module?  Is it not parsing my verse refs?  (I
> have tried it both with and without that final colon, and same results
> both ways.)

See above explanation.

> 4. The text I'm working with has some verses missing; do I need to put
> placeholder text there?  For instance, if Mt. 2:21 is missing, then the
> contents of Mt. 2:22 end up in Mt. 2:21, etc.

If you are using vpl2mod, I think you are fine if you just leave a
blank line for the "missing" verses.  Better yet, use a different
format than vpl

> 5. It seems to be expecting me to have :0 references for all the
> chapters except chapter 1; if I don't, the content is off by one verse
> per chapter (Mt. 2:2 ends up in Mt. 2:1, Mt. 2:3 in 2:2; Mt. 3:3 ends up
> in Mt. 3:1, etc.)  Do I need to be sure there are 2:0, 3:0, etc. references?

Every chapter has a :0 verse which is used to hold header information
(which, depending on the translator/editor may be canonical, as in the
case of the information at the beginning of many of the Psalms or may
not be).  However, I believe that the vpl format's default is to look
for a :0 verse.  Thus you need to have at least something here (even a
blank line, I believe, would work).

> 6. It seemed like even if I used a 2:0 reference, the contents of that
> didn't show up in MacSWORD.  This is a non-English text, and it would be
> nice to at least have the title of the book appear in the same language
> as the text.  I need to experiment more, but wondered if someone could
> tell me what to expect.

I haven't used MacSWORD in forever, but the last time that I did so,
I'm not sure if it had support for the :0 reference.  Try using a
different platform (Linux with GnomeSword or BibleTime, Windows with
BibleCS) or try using BibleDesktop to see if the text is properly in

> 7. I also tried using imp format instead of vpl.  Some things worked
> better, but I still ended up with the references in the text, and
> content offset if there were missing verses.  In this case my input
> looked like this:
> $$$Matthew 1:1
> This is the first verse.
> $$$Matthew 1:2
> This is the second verse.
> Even though I built the imp file in the terminal on my Mac (using my own
> Perl script to convert from USFM), I changed the line endings from Unix
> ones to DOS ones before moving the file over to my Windows virtual
> machine to run imp2vs.exe on it.

I'd suggest building the latest versions of the importers from either
1.5.10 sources (if those are finally released) or the 1.5.9 at the
earliest.  Then try the importing again from your Mac.  If there are
problems with it, this is beyond my ken, as I've not really looked at
the code for the importers for a long time.

> 8. The text I'm working with starts out in USFM, and it uses \s markers
> for section headers.  Is there any way to make use of section headers in
> a SWORD module, or are they just tossed?  Do I need to use OSIS format
> or something else if I want to keep them?  Is MacSWORD able to display
> those?  (I also have cross-references and footnotes, but I haven't
> started thinking about whether those could also display.)

IIRC, MacSWORD hasn't been updated for quite a while and very likely
could be missing support for some of these.  Most of the front-ends,
as I recall, support at least footnotes and possibly cross-references
(though I recall these being a hot topic as people debated exactly how
to deal with alternate versions, versification schemes and the like,
and I don't know where that discussion ended up), depending on which
front-end you're using.

> Thanks for any pointers you can give me.  Even if you can point me to
> more documentation on the vpl or imp formats (such as what headers are
> allowed and how to specify them), that would be appreciated too.
> -Beth

I hope my responses were more help and less confusion.  Other people
might offer correction, clarification, denial or other help around
mine as well.  Welcome to the Sword family, and we hope you enjoy your
journey with us.


> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

More information about the sword-devel mailing list