summaryrefslogtreecommitdiff
path: root/wikimini/templates
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2021-08-21 22:27:41 +0200
committerDaniel Schadt <kingdread@gmx.de>2021-08-21 22:27:41 +0200
commit4fc3802d8f1455d5156ef5b185a70353752c461f (patch)
tree76064acdb9ab5d0ff93fedfa525c453bb8e0ee64 /wikimini/templates
parent662fcdc06012efacad53125ee4a449b632fad187 (diff)
downloadwikimini-4fc3802d8f1455d5156ef5b185a70353752c461f.tar.gz
wikimini-4fc3802d8f1455d5156ef5b185a70353752c461f.tar.bz2
wikimini-4fc3802d8f1455d5156ef5b185a70353752c461f.zip
Type fixes in templates.Template
Since we switched to our internal document representation, the templates don't return the plain nodes anymore.
Diffstat (limited to 'wikimini/templates')
-rw-r--r--wikimini/templates/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/wikimini/templates/__init__.py b/wikimini/templates/__init__.py
index ebe3bbc..533ba5e 100644
--- a/wikimini/templates/__init__.py
+++ b/wikimini/templates/__init__.py
@@ -7,15 +7,19 @@ and the :class:`~mwparserfromhell.nodes.template.Template` node to convert, and
returns a string with the template output (see :const:`Template`).
"""
import copy
-from typing import Callable, Optional
+from typing import Callable, Optional, Union, Sequence
import mwparserfromhell as mwp
from .. import Wikimini
+from ..document import Block, Node
#: The type of a template render function.
-Template = Callable[[Wikimini, mwp.nodes.template.Template], str]
+Template = Callable[
+ [Wikimini, mwp.nodes.template.Template],
+ Union[Sequence[Block], Sequence[Node]]
+]
class Registry: