[sword-devel] Module Markup was Re: Config file for thml module

Greg Hellings greg.hellings at gmail.com
Mon Nov 29 12:16:16 MST 2010

On Monday, November 29, 2010, DM Smith <dmsmith at crosswire.org> wrote:
> On 11/29/2010 12:30 PM, Greg Hellings wrote:
> And ThML continues to be used to create Bible modules because it is the best tool for module creators who care about their presentation
> The problem I have with that part of the statement is that often presentation is presumed to be rather singular: How it looks in one application.
> Have you seen how the rich markup is stripped from The SWORD Project for Windows? How about what it looks like on a phone?

The modules I am creating are only targeting HTML based display
applications, namely Xiphos and Bibletime. If the OP cares about all
of the other SWORD applications, then he should obviously test those.

> more than some semantic dream world of markup.
> I guess you mean OSIS? Where does OSIS lack in markup that it cannot be presented well? JSword/BibleDesktop transforms ThML into OSIS and then renders that. So how is one better than the other? What does BD/JS lack in it's presentation?
> But that is besides the point. Transforming ThML into OSIS does not really add much. And my guess is that it is not lossy. But the real value come in running it through osis2mod, which will point out problems with the input and will transform it into something that SWORD and JSword can digest fairly well.

Again, my modules are very focused and targeted, so the other
applications are not even being considered. I agree that osis2mod is a
great boon to using OSIS markup, but it is not feasible for my usage.

In order for the modules I am creating to be able to render properly
out of an OSIS source, I would need to be able to link an external
stylesheet, either an XSLT or a CSS or probably both, to each module.
That allows me to set font sizes, colors, borders, margins, bold,
padding and positioning through the use of CSS.

Both Xiphos and BT will render when I use inline style attributes on
ThML elements. I have not tried other front ends because they were not
selected for the work I am doing. Neither of those allows an external
CSS, and the engine only provides individual entries, so it is the
wrong place for that incorporation (should I even mention the state of
the *2osis filters and the suggestion that XSLT be used by the SWORD
library to render its HTML from a centralized OSIS conversion? As a
brief hint, even osis2osis filters in the engine produce invalid
markup from valid input).

If I had known the difference in technologies between SWORD and JSword
back in 2005 when I started working on these modules, I probably would
have utilized JSword, since I have per-module XSL+CSS files that
render very nice HTML from my source format, but that was then, and
much work has gone into the modules since then.

> To create a ThML Bible or commentary you will need to use the imp format and then just markup within the verses with the markup you want. For example
> $$$Matthew 1:1
> The book of the genealogy of the Christ<br/><I>From</I> Abraham to the...
> $$$Matthew 1:2
> And Abraham begot Isaac<br/>And Isaac <I>begot</I> Jacob and his brothers
> $$$Matthew 1:3
> ...
> Then run imp2mod on that input and set its source as ThML and live happily ever after. The imp file probably will not form a valid ThML XML document, but that is unavoidable in this case.
> The imp file is not xml and it will not be well-formed, let alone valid XML. This is not a bad thing in and of itself, but unless the ThML fragments are otherwise valid, such a module may not work well. It might work in part. For example, at worse, JSword will strip out all the markup and present the plain text of offending text. Notes and references will be inlined.
> If your ThML file passes XML validation and your conversion to IMP format merely replaces the start verse markers with IMP markers and deletes the end verse marker, it should work well.

This is the route I took, and so far it is working brilliantly. Not
quite as well as it might if I could produce an external CSS or
per-module XSL, but by preprocessing my ThML with an XSLT that inserts
inline style tags, I am able to produce the module output I want in my
target applications.


More information about the sword-devel mailing list