Discussion:
[sword-devel] Preverse Headings titles/divs
Troy A. Griffitts
2014-04-15 21:52:07 UTC
Permalink
Dear all SWORD frontend developers.

In the 1.7 codebase we introduced the new concept of preverse divs
instead of simply a set of preverse titles. This was discussed at
length over the years and we decided to move in this direction with
everyone' consent, hopefully.

We had an inconsistency in 1.7.[0-2] which I have just fixed and which
you probably need to worry about:


The problem:

Previous, we were including preverse titles in the entryAttributes under:

["Heading"]["Preverse"]["0" ... n] = "Some Title"

You were probably wrapping this in a nice <h2> or something and being
done with it.

In the new world of preverse divs which can contain anything-- not just
titles, this would look like this:

["Heading"]["Preverse"]["0" ... n] = "<title>Some Title</title>"

This was inconsistent. The former relied on the frontend to set this
apart as a title. The later has the <title> tag included in whatever
might be a title in the preverse material.

The problem is that most of you (and me) didn't change any of our
frontend code to handle the move to preverse div. We tried to make this
as easy of a transition as possible and thought we did, but not quite
good enough.

As it stands now, for older modules, you're probably rendering something
like:

<h3>Some Title</h3>

But for newer modules you are probably rendering something like:

<h3><h3>Some Title</h3></h3>

You were adding your own markup to highlight these always as titles, and
in the new world, the highlighting is done for you, if it is indeed a
title (the OSIS <title> tag is actually in the body of the material and
will get rendered as all other <title> elements).

A bug fix, which I've just committed and will go out in 1.7.3 shortly,
will make these consistent. When processing headings, I am looking for
old preverse title modules and I now preserve the containing "<title>"
element. This will make them act the same as the newer preverse div
modules and both will appear consistently as:

["Heading"]["Preverse"]["0" ... n] = "<title>Some Title</title>"


SUMMARY: In the new preverse div world, you should never add your own
markup around the preverse material which assumes the entire content is
a title. Simply remove your added markup and you should be good.
Karl Kleinpaste
2014-04-16 01:59:10 UTC
Permalink
In this new world, what happens with the 30% of non-OSIS Bible modules?

$ pwd
/home/karl/.sword/mods.d
$ grep -l ^DataPath.*text * | wc -l
402
$ grep -l ^DataPath.*text * | xargs grep SourceType= | tr -d '\r' | cut
-f2 -d= | sort | uniq -c
34 GBF
282 OSIS
2 Plain
1 Plaintext
45 ThML
1 VPL
$ echo $[100-28200/402]
30
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140415/c6a2985d/attachment.html>
Karl Kleinpaste
2014-04-16 13:41:41 UTC
Permalink
Post by Karl Kleinpaste
In this new world, what happens with the 30% of non-OSIS Bible modules?
FYI, Xiphos already has been updated so that the "old world" wrapping of
pre-verse elements using "<br/><b>%s</b><br/><br/>" is conditional on
non-OSIS modules. OSIS modules have the "new world" of self-rendered
standoff, non-OSIS modules get the classic treatment.

Xiphos 3.1.7 is expected to be released at the end of this week.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140416/2f2981d0/attachment.html>
Troy A. Griffitts
2014-04-16 14:43:50 UTC
Permalink
Dear Karl,

Yes, the patch I applied yesterday only took care of the OSIS markup,
but I certainly intend for all markups we support to be handled before
release. Moving the same logic to the other *headings filters should be
trivial.

I apologize for letting 1.7.x out with this bug.

Troy
Post by Karl Kleinpaste
Post by Karl Kleinpaste
In this new world, what happens with the 30% of non-OSIS Bible modules?
FYI, Xiphos already has been updated so that the "old world" wrapping
of pre-verse elements using "<br/><b>%s</b><br/><br/>" is conditional
on non-OSIS modules. OSIS modules have the "new world" of
self-rendered standoff, non-OSIS modules get the classic treatment.
Xiphos 3.1.7 is expected to be released at the end of this week.
_______________________________________________
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/20140416/550b6e51/attachment-0001.html>
Greg Hellings
2014-04-16 13:32:31 UTC
Permalink
Troy,

There seems to be an issue in the implementation of the filter for this.
I'm currently getting the following from "lookup":

[ Preverse ]

0 = <div canonical="true" sID="gen30107" subType="x-SH"
type="section"/><title>Bartimaeus Receives His Sight</title> <div
sID="gen30108" type="x-p"/>

module->renderText(heading[0]) = <h3><h3>Bartimaeus
Receives His Sight</h3>


</h3>


The engine's filter is already wrapping the render text in double-h3 tags,
so any applications doing that will end up triple-wrapping.

--Greg
Post by Troy A. Griffitts
Dear all SWORD frontend developers.
In the 1.7 codebase we introduced the new concept of preverse divs instead
of simply a set of preverse titles. This was discussed at length over the
years and we decided to move in this direction with everyone' consent,
hopefully.
We had an inconsistency in 1.7.[0-2] which I have just fixed and which you
["Heading"]["Preverse"]["0" ... n] = "Some Title"
You were probably wrapping this in a nice <h2> or something and being done
with it.
In the new world of preverse divs which can contain anything-- not just
["Heading"]["Preverse"]["0" ... n] = "<title>Some Title</title>"
This was inconsistent. The former relied on the frontend to set this
apart as a title. The later has the <title> tag included in whatever might
be a title in the preverse material.
The problem is that most of you (and me) didn't change any of our frontend
code to handle the move to preverse div. We tried to make this as easy of
a transition as possible and thought we did, but not quite good enough.
As it stands now, for older modules, you're probably rendering something
<h3>Some Title</h3>
<h3><h3>Some Title</h3></h3>
You were adding your own markup to highlight these always as titles, and
in the new world, the highlighting is done for you, if it is indeed a title
(the OSIS <title> tag is actually in the body of the material and will get
rendered as all other <title> elements).
A bug fix, which I've just committed and will go out in 1.7.3 shortly,
will make these consistent. When processing headings, I am looking for old
preverse title modules and I now preserve the containing "<title>" element.
This will make them act the same as the newer preverse div modules and
["Heading"]["Preverse"]["0" ... n] = "<title>Some Title</title>"
SUMMARY: In the new preverse div world, you should never add your own
markup around the preverse material which assumes the entire content is a
title. Simply remove your added markup and you should be good.
_______________________________________________
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/20140416/60042822/attachment.html>
Loading...