[sword-devel] Poetry group not starting on new line in module
dmsmith at crosswire.org
Mon Nov 9 07:12:13 MST 2009
Based on the output John sent me, I see what the BibleDesktop problem
is. Our stylesheet is ignoring <lg sID="xx"/> and also <lg eID="xx"/>.
It is a relatively simple fix. I just need to get them to output a <br/>
when generating HTML.
Actually, in the sID case, if the former sibling element is not a block
element then give a <br/>. If it is the first child, then there is
nothing to do.
And in the case of an eID, it needs to look forward in the document. If
the following sibling element is a block element then we emit a <br/>.
If it is the last child, then there is nothing to do.
To not look behind or ahead will cause extra blank lines at various
points. But even that is better than what you got.
On 11/09/2009 07:01 AM, DM Smith wrote:
> On Nov 9, 2009, at 5:48 AM, <johnduffy at cgcf.net> wrote:
>> I've got some poetry groups that start in the middle of verses.
>> when a module is displayed, the first line of the poetry group is
>> shown as a
>> continuation of the paragraph text while the second line and
>> following of
>> the poetry group start with a new line. This occurs in Xiphos,
>> and BibleCS. Below is an example
>> <verse sID="Hab.2.18" osisID="Hab.2.18"/>
>> Cén tairbhe é íomhá ghreanta
>> <l level="1">le go ndealbhódh a déantóír í chor ar bith?</l>
>> <l level="1">nó dealbh teilgthe, oracal bréagach,</l>
>> <l level="1">le go gcuirfeadh a déantóir a mhuinín inti</l>
>> <l level="1">agus gan ach dealbha balbha á ndéanamh aige?</l>
>> <verse eID="Hab.2.18"/>
> This looks like it should (though stylistically, I'd swap the <verse
> eID="Hab.2.18"/> and </lg>).
>> 18Cén tairbhe é íomhá ghreanta le go ndealbhódh a déantóír í chor ar
>> nó dealbh teilgthe, oracal bréagach,
>> le go gcuirfeadh a déantóir a mhuinín inti
>> agus gan ach dealbha balbha á ndéanamh aige?
> It should work the way you want. JSword and SWORD should be changed to
> In BibleDesktop, it should already do that. I'm confused as to why it
> would not.
> We use xslt to transform the OSIS into HTML. We change the <lg> into a
> <div>. In HTML, a div is a block element and should start on a new line.
> Can you turn on "View Source" in your BD properties. It will require a
> manual edit of desktop.properties. Change the line:
> Note, if it is not there, add it.
> The next time you start BD, you'll see "View Source" on the View menu.
> It will have 3 tabs, one for the raw text as coming from the module,
> one for OSIS and one for the generated HTML.
> You'll quickly find that it is easiest to look at a single verse.
> If you'd go to this verse and do a ViewSource, what do you get for
> these three views? (send it to me directly) I'm curious as to whether
> osis2mod created something that BD's xslt does not handle. I have an
> idea as to what might be happening.
>> Is there any way to get the first line of the poetry group to start
>> on a new
>> line in the module?
> As a hack, insert a <lb/> before each <lg>. This should only be a
> short term hack.
> Someone could change the osis2htmlhref.cpp filter to output a <div>
> when encountering an <lg>. The last line in a line group probably
> shouldn't output a <br/>. That would produce extra spacing. A similar
> change should be done in the other osis filters.
More information about the sword-devel