[sword-devel] Html filter questions

Ben Morgan benpmorgan at gmail.com
Sun Feb 18 19:05:29 MST 2007


I have some questions with the FMT_HTMLHREF filter. Let's say I do the
following in python:
from Sword import *
mgr = SWMgr(MarkupFilterMgr(FMT_HTMLHREF, ENC_HTML))
mgr.setGlobalOption("Footnotes", "On")
mod.RenderText(VerseKey("John 3:1"))

What I get out is this (breaking it up for legibility):

Now there was a man of the Pharisees named
> <a href="passagestudy.jsp?action=showNote&type=x&value=1&module=ESV&passage=John+3%3A1"><small><sup>*x</sup></small></a>
> Nicodemus,
> <a href="passagestudy.jsp
> ?action=showNote&type=x&value=2&module=ESV&passage=John+3%3A1"><small><sup>*x</sup></small></a>
>  a ruler of the Jews.'

Is there any way to get the third cross reference so that instead of:
<a href="passagestudy.jsp?action=showNote&type=x&value=1&module=ESV&passage=John+3%3A16"><small><sup>*x</sup></small></a>

we have something like:
<a href="passagestudy.jsp?action=openRef&module=ESV&passage=John+7%3A50"><small><sup>John
<a href="passagestudy.jsp?action=openRef&module=ESV&passage=John+19%3A39"><small><sup>John

I do not want a solution where I manually look up the entry attributes to
get each one, as this will add lots of overhead.

Also, look at John 3:2 and the first note.
Its entry attributes are the following
('body', 'Greek <hi type="i">him</hi>'),
('n', '1'),
('osisID', 'John.3.2.note_1'),
('type', 'explanation')

For a start, shouldn't it be <i>him</i>?
Also, I would like to have the note number displayed, maybe, instead of
"*n". Is this possible?

Without more flexibility, I do not particularly think one html filter is a
good idea. What I would really like is to have a callback or virtual
function that will be called everytime a certain thing comes up - but this
cannot be done at the moment. Then you could have predefined classes - an
rtf one, an html one, etc, but still override the particular bits you
need/want to.

God Bless,
Be wretched and mourn and weep. Let your laughter be turned to mourning and
your joy to gloom.
James 4:9 (ESV)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.crosswire.org/pipermail/sword-devel/attachments/20070219/f5132f3a/attachment.html 

More information about the sword-devel mailing list