This allows you to generate a single random link with a custom link
text.
-def macro_RandomPage(macro, links=1):
+# Generate links random pagelinks. If links is 1, linktext can be used to
+# override the link text.
+def macro_RandomPage(macro, links=1, linktext=None):
request = macro.request
links = max(links, 1) # at least 1 link
request = macro.request
links = max(links, 1) # at least 1 link
if links == 1:
name = pages[0]
return (f.pagelink(1, name, generated=1) +
if links == 1:
name = pages[0]
return (f.pagelink(1, name, generated=1) +
+ f.text(linktext or name) +
f.pagelink(0, name))
# return a list of page links
f.pagelink(0, name))
# return a list of page links