## Please edit system and help pages ONLY in the moinmaster wiki! For more ## information, please see MoinMaster:MoinPagesEditorGroup. ##master-page:None ##master-date:None #acl MoinPagesEditorGroup:read,write,delete,revert All:read #format wiki #language en <> <
><
> <> == Macros == Macros allow the insertion of system features into normal wiki pages; the only thing that makes those pages special is that they contain macros. If you edit pages like RecentChanges or SystemInfo, you'll see what that means. For more information on the possible markup, see HelpOnEditing. === Search macros === MoinMoin now uses a new search engine, that lets your make sophisticated searches using both the interactive search box or any of the search macros. For more help, see HelpOnSearching. ||||||'''Macro''' || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> '''Description''' ||'''Example''' || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> create an advanced search dialogue on the page || See FindPage || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> create a search box on the page, which search the page titles || See FindPage || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> create a search box on the page, which search the page contents || See FindPage || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> print a list of pages whose content matches the current page title (like clicking on the page title) || See the CategoryCategory page || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> print a list of pages whose content matches the search term || || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> Works like the {{{FullSearch}}} macro but caches the results statically. Use it if you prefer speed over an up-to-date result || || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> directly go to the page you enter || See the FindPage || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> print a list of pages whose title matches the search term || See the HelpIndex || === Navigation === ||||||'''Macro''' || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> '''Description''' ||'''Example''' || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> a list of recently edited pages || See RecentChanges || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> an index of all page titles || See TitleIndex || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> an index of all words in page titles || See WordIndex || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> list links to non-existent pages || See WantedPages || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> list pages no other page links to || See OrphanedPages || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> list pages that were not edited for the longest time || See AbandonedPages || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> a link to a random page || {{{<>}}} || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> links to a number of random pages || Two random pages: {{{<>}}} || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> display a local table of contents, possibly limited to a maximal depth || See above || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> macro to insert anchors into a page || <>#here || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> macro to list all of a pages' children || See start of this page || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> quick navigation to siblings of a page || See /MailTo || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> creates a link to toggle between slide show and wiki mode, and a link to start the slide show || See HelpOnSlideShows || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> displays first/prev/next/last links || See HelpOnSlideShows || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> displays number of attachments for current page || See HelpOnActions/AttachFile || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> displays number of attachments for page || See HelpOnActions/AttachFile || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> displays list of attachments || See HelpOnActions/AttachFile || === System information === ||||||'''Macro''' || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> '''Description''' ||'''Example''' || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> a list of all known InterWiki names || InterWiki || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> info on the wiki, the python interpreter and the host system || SystemInfo || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> current page count. If {{{exists}}} is supplied as an argument, only existing pages will be shown. || {{{<> pages}}} || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> list the sizes of all pages || See PageSize || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> shows statistical charts (currently defined types: hitcounts, pagesize, useragents, languages) || See EventStats and subpages || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> Information for system administrators || You need to be superuser to call this macro <
> <> || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> A list of system pages that were modified || {{{<>}}} || === Others === ||||||'''Macro''' || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> '''Description''' ||'''Example''' || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;">links to page with valid action, optional text could be used as alias. (action names are case sensitive)|| e.g. `<>`, <>|| ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;">display system icons || See HelpOnNavigation || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> display a user preferences dialog || See UserPreferences || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> display user creation dialog || || ||||||{{{<
>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> insert a line break || 1st line<
>2nd line || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> Select a random quote from the given page, or from {{{FortuneCookies}}} if omitted || {{{<>}}} || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> include contents of another page || for details see [[/Include]] || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> Add a footnote<>, or explicitly display collected footnotes when no args are given || See below for an example. || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> display a timestamp according to system settings || <> || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> display a timestamp<> according to user settings || <> || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> loads I18N texts (mainly intended for use on Help pages) || "Edit``Text" is translated to "<>" || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> loads I18N texts (mainly intended for use on Help pages or in generated output on wiki pages) and replaces `%s` in the message by the arguments. The first character of the argument is used as the separator (in this example: a comma). You can escape the separator by using a backslash. || "`<>`" yields "<>" || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> useful for intranet developer wikis, a means to view pydoc documentation, formatted via a XSLT stylesheet || See http://twistedmatrix.com/wiki/python/TeudProject || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> protect your email address from spam bots || for details see /MailTo || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> Allow the user to create (sub-) pages easily, using the page {{{PageTemplate}}}as the template for the new page and the string {{{NameTemplate}}} as a template for the name.<> `@ME` is used if you want the page created below the users homepage. `@SELF` is used to create a subpage below the page where it is called from. || <> || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> Retrieve dictionary entries from dict pages. || If you have a page called GermanDict which contains the entry ''Test'', you should see the translation here: <> || ||||||{{{<>}}} || ||<5%><
>||<75% style="margin: 10px; vertical-align: top;"> Displays a Calendar and creates link for entries to each day on subpages || See /MonthCalendar || <> === Writing your own macro === Create a python file called {{{MacroName.py}}} located in your {{{data/plugin/macro}}} directory. Ensure it has a single method called {{{execute(macro, arguments)}}}, which is the entry-point. * ''macro'' is an instance of class Macro, and also evaluates to a string of the macroname. * ''arguments'' is an arbitrary argument string you can pass in with parameters to your macro. All `Macro` instances have a `request` member through which you can access the form parameters and other information related to user interaction. `execute()` should use the formatter to construct valid markup for the current target format. In most cases this is HTML, so writing a macro which returns HTML will work in most cases but fail when formats like XML or `text/plain` are requested. For example, your wiki page has the following line on it: {{{ <> }}} You could write a !MacroName.py file like this: {{{ #!python Dependencies = [] def execute(macro, args): return macro.formatter.text("I got these args from a macro %s: %s" % (str(macro), args)) }}} . /!\ Add an entry into `Dependencies` if the output from your macro should not be cached. This is important if the macro output could change from one moment to another, for example if your macro searches in wiki pages which may be being edited by other users, or loads information from an external database whose contents may change. Currently the value of any entry does not matter and may be considered a short description for 'why results from this macro should not be cached', but please look at the entries used in other macros for values which may be suitable. <>