Wiki Macros
inyoka.wiki.macros
Macros for the wiki.
- copyright:
2012-2024 by the Inyoka Team, see AUTHORS for more details.
- license:
BSD, see LICENSE for more details.
- class inyoka.wiki.macros.Attachment(*args, **orig_kw)
This macro displays a download link for an attachment.
- allowed_context = ['wiki']
The render context this macro is allowed in. Restrictive by default
- arguments = (('attachment', <class 'str'>, ''), ('text', <class 'str'>, ''))
the arguments this macro expects
- build_node(context, format)
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- names = ('Attachment', 'Anhang')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.
- class inyoka.wiki.macros.AttachmentList(*args, **orig_kw)
Return a list of attachments or attachments below a given page.
- allowed_context = ['wiki']
The render context this macro is allowed in. Restrictive by default
- arguments = (('page', <class 'str'>, ''), ('shorten_title', <class 'bool'>, False))
the arguments this macro expects
- build_node(context, format)
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- is_block_tag = True
true if this macro returns a block level node in dynamic rendering. This does not affect static rendering.
- names = ('AttachmentList', 'Anhänge')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.
- class inyoka.wiki.macros.FilterByMetaData(*args, **orig_kw)
Filter pages by their metadata
- allowed_context = ['wiki']
The render context this macro is allowed in. Restrictive by default
- arguments = (('filters', <class 'str'>, ''),)
the arguments this macro expects
- build_node(context, format)
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- is_block_tag = True
true if this macro returns a block level node in dynamic rendering. This does not affect static rendering.
- names = ('FilterByMetaData', 'MetaFilter')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.
- class inyoka.wiki.macros.OrphanedPages(*args, **orig_kw)
Return a list of orphaned pages.
- allowed_context = ['wiki']
The render context this macro is allowed in. Restrictive by default
- build_node(context, format)
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- is_block_tag = True
true if this macro returns a block level node in dynamic rendering. This does not affect static rendering.
- names = ('OrphanedPages', 'VerwaisteSeiten')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.
- class inyoka.wiki.macros.PageCount(*args, **orig_kw)
Return the number of existing pages.
- allowed_context = ['wiki']
The render context this macro is allowed in. Restrictive by default
- build_node(context, format)
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- names = ('PageCount', 'Seitenzahl')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.
- class inyoka.wiki.macros.PageList(*args, **orig_kw)
Return a list of pages.
- allowed_context = ['wiki']
The render context this macro is allowed in. Restrictive by default
- arguments = (('pattern', <class 'str'>, ''), ('case_sensitive', <class 'bool'>, True), ('shorten_title', <class 'bool'>, False))
the arguments this macro expects
- build_node(context, format)
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- is_block_tag = True
true if this macro returns a block level node in dynamic rendering. This does not affect static rendering.
- names = ('PageList', 'Seitenliste')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.
- class inyoka.wiki.macros.PageName(*args, **orig_kw)
Return the name of the current page if the render context knows about that. This is only useful when rendered from a wiki page.
- allowed_context = ['wiki']
The render context this macro is allowed in. Restrictive by default
- build_node(context, format)
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- names = ('PageName', 'Seitenname')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.
- class inyoka.wiki.macros.Picture(*args, **orig_kw)
This macro can display external images and attachments as images. It also takes care about thumbnail generation. For any internal (attachment) image included that way an
X-Attach
metadata is emitted.Like for any link only absolute targets are allowed. This might be surprising behavior if you’re used to the MoinMoin syntax but caused by the fact that the parser does not know at parse time on which page it is operating.
- allowed_context = ['ikhaya', 'wiki']
The render context this macro is allowed in. Restrictive by default
- arguments = (('picture', <class 'str'>, ''), ('size', <class 'str'>, ''), ('align', <class 'str'>, ''), ('alt', <class 'str'>, None), ('title', <class 'str'>, None))
the arguments this macro expects
- build_node(context, format)
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- names = ('Picture', 'Bild')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.
- class inyoka.wiki.macros.RedirectPages(*args, **orig_kw)
Return a list of pages that redirect to somewhere.
- allowed_context = ['wiki']
The render context this macro is allowed in. Restrictive by default
- build_node(context, format)
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- is_block_tag = True
true if this macro returns a block level node in dynamic rendering. This does not affect static rendering.
- names = ('RedirectPages', 'Weiterleitungen')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.
- class inyoka.wiki.macros.SimilarPages(*args, **orig_kw)
Show a list of pages similar to the page name given or the page from the render context.
- allowed_context = ['wiki']
The render context this macro is allowed in. Restrictive by default
- arguments = (('page', <class 'str'>, ''),)
the arguments this macro expects
- build_node(context, format)
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- is_block_tag = True
true if this macro returns a block level node in dynamic rendering. This does not affect static rendering.
- names = ('SimilarPages', 'ÄhnlicheSeiten')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.
- class inyoka.wiki.macros.TagList(*args, **orig_kw)
Show a taglist.
- allowed_context = ['wiki']
The render context this macro is allowed in. Restrictive by default
- arguments = (('tag', <class 'str'>, ''),)
the arguments this macro expects
- build_node(context, format)
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- is_block_tag = True
true if this macro returns a block level node in dynamic rendering. This does not affect static rendering.
- names = ('TagList', 'TagListe')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.
- class inyoka.wiki.macros.Template(args, kwargs)
Include a page as template and expand it.
- allowed_context = ['forum', 'ikhaya', 'wiki']
The render context this macro is allowed in. Restrictive by default
- build_node()
If this is a static macro this method has to return a node. If it’s a runtime node a context and format parameter is passed.
A static macro has to return a node, runtime macros can either have a look at the passed format and return a string for that format or return a normal node which is then rendered into that format.
- has_argument_parser = True
set this to True if you want to do the argument parsing yourself.
- is_static = True
if a macro is static this has to be true.
- names = ('Template', 'Vorlage')
The canonical names for this macro. A macro may have multiple aliases e.g to support multiple languages.