Introduction
These macros are designed for people using Moin as a CMS. For security reasons they are definitely not suitable for an open wiki!
These macros are running in this wiki. To find out what version that is visit SystemInfo.
SymLink macro
Syntax: [[SymLink(/path/to/a/server/side/filename)]]
Description: This will create a symlink to /path/to/a/server/side/filename in the containing page's attachments directory. You can then access that file from within the wiki with:
attachment:filename
(where filename has the leading directories stripped to leave just the file name).
Be aware that if a page is editable by anyway then anyway could insert calls to this macro in order make any file on your computer be an attachment to the page.
Example #1: take a look at the source of this page.
System macro
Syntax: [[System(unix-command,inclusion-mode)]]
Description: This will run unix-command on the server and include its output in the page in which it is specified formatted according to inclusion-mode, which may be one of:
raw - the output is assumed to be HTML
wiki - the output is assumed to be normal wiki markup
pre - the output is treated as normal wiki markup enclosed between '{{{' and '}}}'.
Be aware that if a page is editable by anyway then anyway could insert calls to this macro in order to run any command on your computer. Imagine if they put something like:
[[System(cat /etc/passwd,raw)]]
Example #1:
The output of man pdb, pre-formatted:
PDB2.6(1) PDB2.6(1)
NAME
pdb2.6 - the Python debugger
SYNOPSIS
pdb2.6 script [...]
DESCRIPTION
See /usr/lib/python2.6/pdb.doc for more information on the use of pdb.
When the debugger is started, help is available via the help command.
SEE ALSO
python2.6(1). Chapter 9 of the Python Library Reference (The Python
Debugger). Available in the python2.6-doc package at
/usr/share/doc/python2.6/html/lib/module-pdb.html.
PDB2.6(1)
Example #2:
An inline shell script generating wiki markup:
Thu May 17 22:49:19 CEST 2012 (Reload the page to see this change.)
Example #3:
The HTML output of w3m -dump_source http://checkip.dyndns.org/:
Example #4:
Here's a Google Maps map embedded in a wiki page:
If you look at the source for this page to see how that was done, then note that the Google Maps URL has had:
- commas changed to %2C to prevent Moin interpreting them as macro argument separators,
- double quotes have been backslash-escaped to prevent the shell from interpreting them as string delimiters.
What are its prerequisites?
Documention
See above.
Installation
See http://moinmo.in/HelpOnMacros
Downloads
Source: SymLink.py
Source: System.py
Bugs and change requests
id |
filed |
description |
response |
status |
MMM#001 |
|
|
|
|
Copyright
These macros are (C) AlexisHuxley 2007-2011 and are distributed under the terms of the GPL.
See also
Computing (other software by AlexisHuxley)
