[sword-devel] Poetry and indented lines

DM Smith dmsmith at crosswire.org
Tue Mar 10 05:19:49 MST 2009


On Mar 10, 2009, at 4:22 AM, Daniel Owens wrote:

> That sounds excellent. I hope to see it implemented soon.
>
> Daniel
>
> Peter von Kaehne wrote:
>>
>> Daniel Owens wrote:
>>> This is probably opening a low-priority can of worms, but what if  
>>> some controls on the form a module is displayed in were encoded in  
>>> the conf file? I mean, you could define how certain attributes  
>>> should be displayed to give module developers more control over  
>>> how their modules display.
>>
>> Matthew and I started experimenting a little with using more of CSS  
>> in the main display panes of xiphos. The idea being to get a) more  
>> display design going with less effort and b) making it -  
>> potentially - possible for module writers to supply along with  
>> their module a style sheet how they wished to see certain elements  
>> expressed.
>>
>> This is all experimental work and might never come to anything, but  
>> given that nearly all frontends of importance use a HTML renderer  
>> with CSS capability we thought this something we should aat least  
>> explore further.

JSword has a bug, but it has a mechanism to allow external CSS.

The path that JSword takes in converting a module to HTML bears  
repeating:

Module output is transformed into OSIS (or left as TEI) by custom  
parsers which is then transformed into HTML using xslt. JSword allows  
for the plugging in of different xslt style sheets.

The HTML that is produced is unlike that of SWORD's html renderers,  
which largely output presentation HTML. Rather it produces structural  
HTML using the class attribute to indicate what is output. These then  
are styled with CSS. (Because of the limits of Java's HTML renderer,  
the HTML has lots of hacks. Such as using <font> as if it were a  
<abbr> or <span> and <div> as if it were <caption>) Here are some  
examples:

<xsl:template match="caption">
   <div class="caption"><xsl:apply-templates/></div>
</xsl:template>

<!-- expansion is OSIS, expan is TEI -->
<xsl:template match="abbr">
   <font class="abbr">
     <xsl:if test="@expansion">
       <xsl:attribute name="title">
         <xsl:value-of select="@expansion"/>
       </xsl:attribute>
     </xsl:if>
     <xsl:if test="@expan">
       <xsl:attribute name="title">
         <xsl:value-of select="@expan"/>
       </xsl:attribute>
     </xsl:if>
     <xsl:apply-templates/>
   </font>
</xsl:template>

While JSword does not apply styles to these, they are still marked so  
that they can be styled.

In Christ,
	DM


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20090310/04b5af9d/attachment-0001.html>


More information about the sword-devel mailing list