<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div>Thanks heaps for this :)<div>I'm getting there, but have encountered a few interesting bits. I'm using the ESV and something I just realised was that Psalm 1 only had a closing &lt;lg&gt; tag at the end of verse 6 &amp; no opening tag:</div><div>&nbsp;&lt;lg eID="w106"/&gt;&nbsp;</div><div>I couldn't find the opening one anywhere in the chapter.</div><div><br></div><div>Until I looked at Psalm 1:0</div><div>&amp; then I found it!</div><div><br></div><div>Anyway, I have it mostly working (besides for cases like the above, where you _need_ to have the Introductions switched on for the formatting to work correctly).</div><div><br></div><div>However, the tricky thing for this to then work with PS is the verse numbers, where you talk about doing some "floating block whitespace" to make it "work more nicely". I'm gonna try to look at what BPBible does in regards to that, cause I'm a novice when it comes to HTML now-a-days...</div><div><br></div><div><br></div><div>Thanks, ybic</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>nic... &nbsp;:)<br>
<br><div><div>On 02/02/2013, at 12:02 AM, Ben Morgan &lt;<a href="mailto:benpmorgan@gmail.com">benpmorgan@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">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 &lt;l&gt; 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&nbsp;</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 += '&lt;div class="indentedline width-%d" source="l"&gt;' % 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 += "&lt;br&gt;" if self.in_copy_verses_mode else "&lt;/div&gt;"</div></div><div><br></div><div>&lt;lg&gt; 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>&nbsp;* indented further. text-indent undoes the wide margin only for the first</div><div>&nbsp;* 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">&lt;<a href="mailto:niccarter@mac.com" target="_blank">niccarter@mac.com</a>&gt;</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 &lt;l&gt; poetry &amp; &lt;lb&gt; ?<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 &lt;<a href="mailto:dmsmith@crosswire.org">dmsmith@crosswire.org</a>&gt; wrote:<br>
<br>
&gt; I've noticed that OSIS modules sometimes render with a lot of vertical whitespace (blank lines).<br>
&gt;<br>
&gt; 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>
&gt;<br>
&gt; So this is a suggestion for others.<br>
&gt;<br>
&gt; 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, &lt;div&gt;, &lt;chapter&gt;, &lt;p&gt;, &lt;lb/&gt;, &lt;lg&gt;, &lt;l&gt;, &lt;title&gt;, &lt;table&gt; and &lt;row&gt; are the block elements.<br>


&gt; The key feature of a block element is that block elements that follow each other stack one on top of each other.<br>
&gt; Some block elements allow nesting, such as &lt;div&gt;.<br>
&gt;<br>
&gt; In HTML, an empty &lt;div&gt; occupies no vertical space. A nested div does not cause additional vertical space.<br>
&gt;<br>
&gt; In HTML, a &lt;p&gt; has semantics as to whether it is preceded or followed by whitespace. A &lt;p&gt; at the beginning of a document is not preceded by a blank line. Nor is a &lt;/p&gt; at the end of a document. This is also true after a heading element.<br>


&gt;<br>
&gt; I think that the SWORD renderers always cause a &lt;div&gt; to occupy vertical whitespace.<br>
&gt;<br>
&gt; The other issue with &lt;div&gt; is that we now have a "pre-verse" div, which is a great way of marking off what stands before a verse, but this &lt;div&gt; really shouldn't have any &lt;div&gt; semantic. It probably would have been better if we used &lt;milestone&gt; instead.<br>


&gt;<br>
&gt; 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>
&gt;<br>
&gt; 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>


&gt;<br>
&gt;<br>
&gt; Together in His Service,<br>
&gt; &nbsp; &nbsp; &nbsp; DM<br>
&gt; _______________________________________________<br>
&gt; sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br>
&gt; <a href="http://www.crosswire.org/mailman/listinfo/sword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
&gt; 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>
_______________________________________________<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">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>Instructions to unsubscribe/change your settings at above page</blockquote></div><br></div></body></html>