[sword-devel] How to obtaining Headings, Foot notes, Cross references, etc, in Python

Anonymous junk_and_mail at yahoo.com
Tue Oct 21 16:46:37 MST 2008


Let's say i have the following Python code:

	import Sword

	markup = Sword.MarkupFilterMgr(Sword.FMT_HTMLHREF, Sword.ENC_HTML);
	markup.thisown = False;
	Sw = Sword.SWMgr(markup);
	Sw.setGlobalOption("Cross-references","On");
	Sw.setGlobalOption("Strong's Numbers","On");
	Sw.setGlobalOption("Headings","On");
	Sw.setGlobalOption("Footnotes","On");
	Sw.setGlobalOption("Words of Christ in Red","On");
	Sw.setGlobalOption("Textual Variants","On");
	mod = Sw.getModule("ESV");
	vk = Sword.VerseKey("Job 1:1");
	mod.setKey(vk);
	print mod.RenderText();

But when it prints out the verse, it doesn't show the verse heading. I know there's something i'm missing, but sadly this is about as far as my knowledge on this goes for pulling up verses with their headings, foot notes, etc... And i have no idea how to use AddRenderFilter(). After figuring out how to pull up verse headings, my next goal would be to figure out how obtain foot notes and cross references from, for example, <a href="passagestudy.jsp?action=showNote&type=x&value=2&module=ESV&passage=Job+1%3A1"><small><sup>*x</sup></small></a>—if at all possible. But hours of browsing through code, Googling, etc, hasn't helped much.

--- On Tue, 10/21/08, Manfred Bergmann <bergmannmd at web.de> wrote:

> From: Manfred Bergmann <bergmannmd at web.de>
> Subject: Re: [sword-devel] How to obtaining Headings, Foot notes, Cross references, etc, in Python
> To: "SWORD Developers' Collaboration Forum" <sword-devel at crosswire.org>
> Date: Tuesday, October 21, 2008, 7:11 AM
> Hi Anonymous.
> 
> Yes, you enable to render headings, foot notes and such
> using  
> setGlobalOption().
> The RenderText() method will get text including your
> enabled options.
> You might need to add render filters to get HTML output:
> AddRenderFilter(new sword::OSISHTMLHREF());
> 
> Remember to use the right Filter class depending on the
> source input  
> type of the module.
> 
> 
> Manfred
> 
> 
> 
> Am 21.10.2008 um 06:59 schrieb Anonymous:
> 
> > I don't understand C++ to be able figure this out
> and i've looked in  
> > the source code of BPBible and others, and i can't
> figure it out  
> > either. So if someone could explain to me how to
> simply obtain all  
> > these things, i'd really appreciate it. All i know
> concerning this  
> > is that i have to turn these options on through
> setGlobalOption()  
> > for it to be rendered.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> > _______________________________________________
> > 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
> 
> 
> _______________________________________________
> 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


      



More information about the sword-devel mailing list