Source

lukeplant_python / lukeplant_me_uk / tracplugins / bible / links.py

Full commit
# -*- coding: utf-8 -*-
from trac.core import *
from trac.wiki.api import IWikiSyntaxProvider
from genshi.builder import tag
from genshi import escape

__all__ = ['BibleLinkPlugin']

def make_kiosword_link(formatter, ns, target, label):
    return tag.a(escape(target), # this is nicer than label
                 href=(u'http://net.bible.org/universal.php?s=%s' % target),
                 class_='bible')


class BibleLinkPlugin(Component):
    implements(IWikiSyntaxProvider)
    def get_wiki_syntax(self):
        return []

    def get_link_resolvers(self):
        return [('bible', make_kiosword_link)]