[sword-devel] Titles and other Inter-verse material

DM Smith dmsmith at crosswire.org
Mon Jul 23 13:04:37 MST 2012


On 07/23/2012 01:12 PM, Peter von Kaehne wrote:
>> Von: DM Smith
>> Mark titles with x-preverse.
> DM, this is exactly what we do at the moment - see svn/sword-tools/modules/misc_cleanup/titles_cleanup.pl (or some such path, sorry not at home) Not terribly successful, as it causes all kinds of problems with titles which are not preverse, but nevertheless. Without it titles behave totally arbitrary - some toggle, many do not.
Which SVN revision are you using. I may be able to comment further. What 
actually makes its way into the module is what matters.

The SWORD engine recognizes two kinds of pre-verse markup. The 
x-preverse on titles and the milestone div. The filter needs some change 
in handling the milestone div properly. The latter is the point of this 
thread.

If a module solely uses x-preverse titles with something other than the 
latest osis2mod, then everything (depending on which version of osis2mod 
your using) that osis2mod deems as otherwise preverse won't/mightn't be 
properly marked. And will be rendered after the verse number. This is 
the cause of the orphaned verse number.

The work around for your perl magic may be to figure where to split 
between verses and put the markup into the title, if there is one and 
remove it otherwise.

>
> I appreciate the suggestion with -d 2 and re-running the import. This is new to me and might indeed be helpful. It is endlessly frustrating to get to the bottom of the whole pre-verse debacle.
Note: you'll need to convert these from <milestone resp="v" .../> to 
<verse ...> to reimport with osis2mod. Importing with vpl2mod might have 
better success.

The suggestion is at least helpful to know what is being put into each slot.

The milestone representing the verse start is a diagnostic help. SWORD 
heading filter knows nothing about it and will ignore it if it makes its 
way into a module. Likewise for JSword. However, if you see something 
other than a title before it, realize that SWORD will pull the title 
(marked x-preverse) out of it. The rest will be treated as verse 
content. The front-end puts the verse number between what SWORD 
identifies as the title (or preverse material) and the verse content.

If the milestoned preverse div is used to wrap the entirety (as with the 
latest osis2mod in SVN), then you'll get different undesirable behavior.

If you have titles splitting a verse (as David outlined in another 
response.) Note that it will be pulled out of its position and that 
position is not remembered. It will be put into the array of pre-verse 
titles. (I hope I'm wrong about this.)

>
> As an aside, you seem to bemoan that all kinds of other material is toggled by the "title" switch. I thought this was desired and I certainly did not think this was unusual. In fact I always saw the toggle as one which switches between naked canonical text and text + "extras" - and considered the "title" name for the switch simply an anachronism.
Most BSP modules put structural markup (sections, paragraphs and poetry) 
between verses. This is commonly part of the canonical markup.

Example (-- denotes the boundary between SWORD module verses as 
determined by osis2mod):
--
<div type="section">
<title>First section title</title>
<p canonical="false">
Description of the section.
</p>
<p>
verse 5
--
verse 6
--
verse 7
</p>
--
<p>
verse 8
--
verse 9
--
verse 10
--
verse 11
</p>
</div>
--
In this case, only
<title>First section title</title>
<p canonical="false">
Description of the section.
</p>
is non-canonical markup. But everything before the verse is pre-verse.

It is the text between verses that is (other than Psalm titles) 
non-canonical. These may have their own structural markup and thus that 
would also be non-canonical.

So if all markup and content before the verses is remove, then the 
whitespace (especially vertical) can change dramatically. In the example 
the paragraph starts disappear.

Hope this makes sense.

In Him,
     DM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20120723/94a6a22c/attachment.html>


More information about the sword-devel mailing list