[sword-devel] Interlinear text in HTML?

DM Smith dmsmith555 at yahoo.com
Fri Aug 31 04:31:53 MST 2007


Karl has a solution that is in GnomeSword in his Aug 9th post. The  
problem with that solution is that it does not scale well. Here is  
the basic idea:
The "words" that form a tuple are encoded in the following fashion:
<span>first word
<span class="greek">Greek</span>
<span class="morph">Morph</span>
</span>
Depending on what the user selects to stack, GnomeSword creates a  
fragment of CSS to position one on top of the other.

This solution depends upon span being laid out inline (every tag in  
html is either inline or block).

This inspired me to play with the scaling problem: For n choices for  
interlinear there are about  (n-1)! fragments of CSS that need to be  
computed. My goal was to have static CSS be able to show the result.
By a minor change:
<span class="word">
<span class="stack">First word</span>
<span class="stack">Greek</span>
<span class="stack">Morph</span>
</span>

The CSS for stack would declare that "display: block" which would  
cause the elements to be stacked on top of each other.
.stack { display: block }

With this one could stack any number of things.

The problem is that <span> is relatively new (in terms of browser  
support) and even FireFox stumbles on rendering it properly  
sometimes. For example, if you do a font change then the "wrapping"  
of "words" is a bit messed up. The word that has italic applied (e.g.  
for transitive change) causes that element to define a new left  
wrapping margin.

DM


On Aug 30, 2007, at 8:53 PM, Kahunapule Michael Johnson wrote:

> DM Smith wrote:
>> Different question:
>> How would one display an interlinear in HTML?
>> The key requirement is that a line of stacked text would naturally  
>> wrap,
>> responding to window resizes in an expected way.
>>
> I was hoping someone else would answer this. I couldn't think of a  
> good
> way, really, other than the obvious table of limited width (and  
> hope the
> user doesn't force you into a narrower window than your table likes to
> be in).
>
> Another option is to post a PDF file and totally disallow window
> resizing to affect word wrap.
>
> Or... make yourself a javascript application that displays interlinear
> text with resizing windows, maybe?
>
> Shalom,
> Michael
>
>
> _______________________________________________
> 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