[sword-devel] JavaScript & SWORD modules

DM Smith dmsmith at crosswire.org
Sun Jan 19 13:13:04 MST 2014


On Jan 19, 2014, at 2:57 PM, Greg Hellings <greg.hellings at gmail.com> wrote:

> There has been much discussion of late about accessing Sword through JavaScript, producing JavaScript bindings for Sword, or porting Sword into JavaScript. JS provides a unique challenge because it is so heavily dominated by browser-side work and most server-side solutions are either very immature or focused heavily on pure JS work that producing Sword bindings ranges from impossible (in the browser) to questionable (browser plugins) to an unexplored unknown (server-side plugins). This almost unique situation has led most of us to more or less ignore it.
> Multiple efforts have been made to allow JavaScript implementations to directly read a Sword module file format, but this can be fraught with difficulty. One commonality between every JavaScript environment I've ever worked with is its ability to handle JSON-formatted data. To that end, I have put together a demo application based on JSword and Undertow (the core library that forms the basis of the renamed JBoss-now-WildFly) that shows how simple it is to expose basic module text to the reader in JSON-formatted text. Anyone is free to see the source at https://github.com/greg-hellings/jsword-json
> The README file has basic build and run directions. I have a sample of it up and running at http://www.thehellings.com:10001/ and ws://www.thehellings.com:10002/ but I have only installed a few simple modules that are exposed in the public domain to avoid licensing problems. The method I use for listing out the contents of the module itself don't work very well with General Books, which is due to my desire to keep the source as simple as possible, which requires a break from how JSword expects GenBook contents to be accessed. This is not insurmountable but my intention was not for this first cut to be production-worthy but only for it to serve as a demonstration of how easy interfacing between Sword and JavaScript could be if one were to write a simple web service backend.
> Opinions, corrections, questions, pull requests, and general insults about my approach are welcomed.
> --Greg
> _______________________________________________
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140119/017dc52a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4145 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140119/017dc52a/attachment.p7s>

More information about the sword-devel mailing list