I've found vertical whitespace can be problematic, and it's often around verse boundaries.<div><br></div><div>osis2mod often seems to put some of the whitespace in the previous verse/chapter, which I think I reported a long time ago and should be fixed. I remember we had trouble finding the right combination of when to start a verse. I have a vague feeling I had suggested some fixes which weren't ever put in - but I can't be sure, and it's possible there might have been some which caused other issues.</div>
<div><br></div><div>BPBible does some things like floating block whitespace before verse numbers etc. to make this work more nicely.</div><div><br></div><div>As for the two-level poetry layout (or 3 level - e.g. ESV 1 Tim 3:16), BPBible has done this for ages (e.g. try opening ESV in psalms). It's not particularly straightforward to implement well though. A brief overview of how it is done:</div>
<div><br></div><div>The start tag <l> gets handled something like so:</div><div><div><span class="Apple-tab-span" style="white-space:pre">                </span>mapping = {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span># usual poetry indent in ESV</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>"x-indent": 2,</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span># extra indent - 1 Tim 3:16 (ESV) for example</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>"x-indent-2": 4,</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span># declares lines - Declares the Lord, Says the Lord, etc.</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>"x-declares": 6,</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span># doxology - Amen and Amen - Psalms 41:13, 72:19, 89:52 in ESV </div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>"x-psalm-doxology": 6,</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span># usual poetry indent in WEB</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>"x-secondary": 2,</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>level = xmltag.getAttribute("level")</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>if level:</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span># the level defaults to 1 - i.e. no indent</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>indent = 2 * (int(level) - 1)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>else:</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>indent = mapping.get(xmltag.getAttribute("type"), 0)</div><div><br>
</div></div><div><div><span class="Apple-tab-span" style="white-space:pre">                </span>#if indent:</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if self.in_indent:</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>dprint(WARNING, "Nested indented l's", self.u.key.getText())</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>self.in_indent = True</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if not self.in_copy_verses_mode:</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>self.buf += '<div class="indentedline width-%d" source="l">' % indent</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>self.blocklevel_start()</div></div><div><br></div><div>and end tag like so:</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>def end_l(self, xmltag):</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>if self.in_indent:</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>self.blocklevel_end()<span class="Apple-tab-span" style="white-space:pre">                        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>self.buf += "<br>" if self.in_copy_verses_mode else "</div>"</div></div><div><br></div><div><lg> elements are also handled, turning them into blockquotes.</div>
<div><br></div><div>This is matched up with CSS like so (note, there's a lot more in it than this to handle floating verse numbers outside of poetry etc):</div><div><div>/* Poetry */</div><div>blockquote.lg</div><div>
{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>margin: 0.5em 0em 0.5em 3em;</div><div>}</div></div><div><br></div><div><div>/* We want our indented lines to behave nicely - wrapped lines should be</div>
<div> * indented further. text-indent undoes the wide margin only for the first</div><div> * line */</div><div>div.indentedline.width-2 {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>-moz-padding-start: 5em;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>text-indent: -3em;</div><div>}</div><div>div.indentedline.width-4 {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>-moz-padding-start: 5em;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>text-indent: -1em;</div><div>}</div><div>div.indentedline.width-6 {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>-moz-padding-start: 7em;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>text-indent: -1em;</div><div>}</div><div><br></div><div>div.indentedline.width-0 {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>-moz-padding-start: 5em;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>text-indent: -5em;</div><div>}</div><div><br></div><div><div>God Bless,<br>Ben<br>-------------------------------------------------------------<br>
        <div>
        <div>For I have no pleasure in the death of anyone, <br>declares the Lord <span style="font-variant:small-caps">God</span>; so turn, and live.”<br>Ezekiel 18:32 (ESV)</div>
        </div>
        
<br></div>
<br><br><div class="gmail_quote">On Fri, Feb 1, 2013 at 9:32 PM, Nic Carter <span dir="ltr"><<a href="mailto:niccarter@mac.com" target="_blank">niccarter@mac.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Is this caused by improperly formed modules that have fun with <l> poetry & <lb> ?<br>
[I think I have already emailed through what I do after the filter gives me it's result in order to try to reduce the vertical whitespace!]<br>
<br>
And while I'm on the topic of poetry, in Proverbs you often see couplets (altho are they termed that in the Bible?) where in a printed Bible the 2nd line is indented. Would we be able to do that to some degree? I don't know the OSIS tags that refer to this, but if someone were able to point me in the right direction, I may even be able to hack this together myself? I am looking around line 360 of osishtmlhref.cpp........<br>
<div class="HOEnZb"><div class="h5"><br>
On 20/01/2013, at 8:12 AM, DM Smith <<a href="mailto:dmsmith@crosswire.org">dmsmith@crosswire.org</a>> wrote:<br>
<br>
> I've noticed that OSIS modules sometimes render with a lot of vertical whitespace (blank lines).<br>
><br>
> I'd like for this to be sorted as part of the next release. I don't think it'd be too hard. I've been in the osishtmlhref filter to see if I could figure it out, but it is beyond me.<br>
><br>
> So this is a suggestion for others.<br>
><br>
> Using the HTML notion of block and inline elements, I think we can classify OSIS elements as block or inline. Off the top of my head, <div>, <chapter>, <p>, <lb/>, <lg>, <l>, <title>, <table> and <row> are the block elements.<br>
> The key feature of a block element is that block elements that follow each other stack one on top of each other.<br>
> Some block elements allow nesting, such as <div>.<br>
><br>
> In HTML, an empty <div> occupies no vertical space. A nested div does not cause additional vertical space.<br>
><br>
> In HTML, a <p> has semantics as to whether it is preceded or followed by whitespace. A <p> at the beginning of a document is not preceded by a blank line. Nor is a </p> at the end of a document. This is also true after a heading element.<br>
><br>
> I think that the SWORD renderers always cause a <div> to occupy vertical whitespace.<br>
><br>
> The other issue with <div> is that we now have a "pre-verse" div, which is a great way of marking off what stands before a verse, but this <div> really shouldn't have any <div> semantic. It probably would have been better if we used <milestone> instead.<br>
><br>
> I seem to remember that there is a "swollow" flag for whitespace (I think it might be for horizontal whitespace.) I think something like this could be used for vertical whitespace.<br>
><br>
> The other part to this is when a chapter is shown verse-per-line. If because of rendering the pre-verse content the verse already starts on a new line, I don't think more vertical whitespace should be produced.<br>
><br>
><br>
> Together in His Service,<br>
> DM<br>
> _______________________________________________<br>
> sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br>
> <a href="http://www.crosswire.org/mailman/listinfo/sword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
> Instructions to unsubscribe/change your settings at above page<br>
<br>
<br>
_______________________________________________<br>
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br>
</div></div></blockquote></div><br></div></div>