diff options
author | Daniel Schadt <kingdread@gmx.de> | 2021-08-20 22:04:44 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2021-08-20 22:04:44 +0200 |
commit | a9a7c6c77f3b6078e317d455b696ce76272b88cb (patch) | |
tree | 4d7649a3efe54378141e5fba6778281d2da4b8b4 /wikimini/templates/mainlinks.py | |
parent | 469353899ae6d7d0c0b7b105c24baaa4841c6328 (diff) | |
parent | a114ad49db792ec190a5cb6c96acc47669ac4b03 (diff) | |
download | wikimini-a9a7c6c77f3b6078e317d455b696ce76272b88cb.tar.gz wikimini-a9a7c6c77f3b6078e317d455b696ce76272b88cb.tar.bz2 wikimini-a9a7c6c77f3b6078e317d455b696ce76272b88cb.zip |
Merge branch 'document-repr'
Diffstat (limited to 'wikimini/templates/mainlinks.py')
-rw-r--r-- | wikimini/templates/mainlinks.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wikimini/templates/mainlinks.py b/wikimini/templates/mainlinks.py index ffcbc5e..3d945ed 100644 --- a/wikimini/templates/mainlinks.py +++ b/wikimini/templates/mainlinks.py @@ -1,14 +1,16 @@ """Renders templates that link to further articles.""" from . import registry +from ..document import Paragraph, Plain, BlockLink + def tmpl_main(wikimini, obj): """Renders the ``{{main|...}}`` template.""" links = [ - "=> {} {}".format(wikimini.page_url(str(t.value)), t.value) + BlockLink(wikimini.page_url(str(t.value)), t.value.strip_code()) for t in obj.params ] - return "Main articles:\n{}\n".format("\n".join(links)) + return [Paragraph([Plain("Main articles:")])] + links registry.insert("main", tmpl_main) |