[sword-devel] Poetry and indented lines
DM Smith
dmsmith at crosswire.org
Mon Mar 9 18:03:07 MST 2009
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? 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.
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.
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&action=edit&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>
The hard part of this is that it is more complex to implement in SWORD.
Failing that, can be used. This is the easiest of all and
precisely what I was thinking when I said it could be done.
Something like (this is pseudo code):
if (!tag.isEndTag() && !tag.isEmpty()) {
int level = tag.getAttribute("level");
for (i= 1; i < level; i++) {
output(' ')
}
}
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.
In Him,
DM
>
>
> Another thing that BPBible does is puts the verse number in the lg
> margin during poetry - more like a print Bible.
This is a good thing to do.
>
>
> Beyond that the ESV and WEB should be updated to do proper
> indentation. Are there any others?
> Not that I've seen; but I haven't looked far. Anyway, it would be
> good to update these.
>
> God Bless,
> Ben
> -------------------------------------------------------------------------------------------
> 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)
> _______________________________________________
> 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/20090309/e0da74dd/attachment-0001.html>
More information about the sword-devel
mailing list