1.1 --- a/moinformat/links/__init__.py Thu Jul 26 17:05:08 2018 +0200
1.2 +++ b/moinformat/links/__init__.py Thu Jul 26 20:09:48 2018 +0200
1.3 @@ -26,10 +26,23 @@
1.4 def get_linker(name):
1.5
1.6 """
1.7 - Return the linking scheme handler with the given 'name' or None if no such
1.8 - handler is found.
1.9 + Return the linking scheme handler class with the given 'name' or None if no
1.10 + such handler is found.
1.11 """
1.12
1.13 return linkers.get(name)
1.14
1.15 +def make_linker(name, pagename):
1.16 +
1.17 + """
1.18 + Return a linking scheme handler with the given 'name' and using the given
1.19 + 'pagename'.
1.20 + """
1.21 +
1.22 + linker_cls = get_linker(name)
1.23 + if not linker_cls:
1.24 + return None
1.25 +
1.26 + return linker_cls(pagename)
1.27 +
1.28 # vim: tabstop=4 expandtab shiftwidth=4