[sword-devel] Poetry and indented lines

Ben Morgan benpmorgan at gmail.com
Mon Mar 9 18:21:48 MST 2009

 On Tue, Mar 10, 2009 at 12:03 PM, DM Smith <dmsmith at crosswire.org> wrote:

> On Mar 9, 2009, at 6:22 PM, Ben Morgan wrote:
> On Tue, Mar 10, 2009 at 5:43 AM, DM Smith <dmsmith at crosswire.org> wrote:
> Thanks Chris. Based on that I've updated
>> http://crosswire.org/wiki/OSIS_Bibles#Marking_poetic_material.
>> I checked the SWORD and JSword renderers and they don't do indentation
>> based upon level. I think it would be simple to add. I'll do it for JSword,
>> but I don't have the time to do it for SWORD. It looks like a couple of
>> lines to osishtmlhref.cpp and osisrtf.cpp.
> It may not quite that simple... without css, I'm not sure how you can do
> indentations easily in html (blockquotes? &nbsp;s?). BPBible currently
> extends the wxHTML parser to add some new tags and then it is easy. I should
> be able to make BPBible use the level attribute very easily.
> OK. Since you have implemented it, I'll take your word that it is not
> straightforward.
At least not in wxHTML, anyway.

> For JSword, we use CSS for all styling of the generated html. That html is
> somewhat ugly in that it is very old HTML and does not recognize elements
> such as <span>, which we'd use to mark inline text for a style. Instead we
> use <font> for the same purpose in this fashion:
> <font class="line">text of line</font>.
> So now it would become something like:
> <font class="line indent2">text of line at level="2"</font>
> The CSS would probably set margin-left or padding-left to so many ems.
wxHTML doesn't support CSS (nor do some other frontend's html components)

> If we didn't do that we could use mediawikis encoding of ':' which uses
> <dl><dd> to do the indentation as in:
> <dl><dd><dl><dd><dl><dd><dl><dd>As above, subject is "Poetry and indented
> lines", date is 11/04/08. Direct link <a href="
> http://www.crosswire.org/pipermail/sword-devel/2008-November/029486.html"
> class="external free" title="
> http://www.crosswire.org/pipermail/sword-devel/2008-November/029486.html"
> rel="nofollow">
> http://www.crosswire.org/pipermail/sword-devel/2008-November/029486.html</a>
> --<a
> href="/mediawiki/index.php?title=User:Mwtalbert&amp;action=edit&amp;redlink=1"
> class="new" title="User:Mwtalbert (page does not exist)">Mwtalbert</a>
> 00:02, 9 March 2009 (UTC)
> </dd></dl>
> </dd></dl>
> </dd></dl>
> </dd></dl>
I think this is probably better (but ugly). Theoretically, though, I think
the line could end in a different verse (and I'm pretty sure it does
somewhere in the 2001 ESV, though not the 2007), which could mess this up a

> The hard part of this is that it is more complex to implement in SWORD.
> Failing that, &nbsp; can be used. This is the easiest of all and precisely
> what I was thinking when I said it could be done.
That would be simplest, but doesn't do indentation if lines wrap.

> Something like (this is pseudo code):
> if (!tag.isEndTag() && !tag.isEmpty()) {
> int level = tag.getAttribute("level");
> for (i= 1; i < level; i++) {
> output('&nbsp;&nbsp;&nbsp;&nbsp;')
> }
> }
> But SonWon's admonishing that might not be appropriate for portable devices
> should be listened to. I don't know of the osishtmlhref or osisrtf filters
> are used there.
I think this is important to display, though the size of indent might be

God Bless,
Multitudes, multitudes,
   in the valley of decision!
For the day of the LORD is near
   in the valley of decision.

Giôên 3:14 (ESV)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20090310/16ef1664/attachment.html>

More information about the sword-devel mailing list