1.1 --- a/moinformat/__init__.py Thu Jul 26 17:05:08 2018 +0200
1.2 +++ b/moinformat/__init__.py Thu Jul 26 20:09:48 2018 +0200
1.3 @@ -19,6 +19,7 @@
1.4 this program. If not, see <http://www.gnu.org/licenses/>.
1.5 """
1.6
1.7 +from moinformat.links import make_linker
1.8 from moinformat.parsers import parse, parsers as all_parsers
1.9 from moinformat.serialisers import serialise, serialisers as all_serialisers
1.10
1.11 @@ -40,4 +41,16 @@
1.12
1.13 return all_serialisers["%s.moin" % name]
1.14
1.15 +def make_serialiser(name, linker=None):
1.16 +
1.17 + """
1.18 + Return a serialiser instance for the format having the given 'name'.
1.19 +
1.20 + The optional 'linker' is used to control which linking scheme is used with
1.21 + the serialiser, with the default having the same name as the serialiser.
1.22 + """
1.23 +
1.24 + linker = linker or make_linker(name, "")
1.25 + return get_serialiser(name)(formats=all_serialisers, linker=linker)
1.26 +
1.27 # vim: tabstop=4 expandtab shiftwidth=4