Add global wiki variable expansion using @key@ syntax
When you save a page with @key@ you private UserName/*Dict wiki dictionary is search for the value of key and @key@ is replaced with the value. Same feature is needed globally for the wiki.
Possible use cases
- For doc roots to external locations so if external stuff moves, you only make the change in one place instead of everywhere it is linked
just a note: if for example a location can change over the years (like a link to a fileserver) then it would be better to use some interwiki stuff (if it's just a link), use the GetVal macro or write a short macro with the correct wiki or html output, so you have one location where you can change it...
- Add project name/ link to project logo image etc.
- Common terms in the wiki that many people use
Any other ugly markup   that need a shortcut like @nbsp@
How it can work
- Check user dictionaries first, then wiki global dictionaries
- First match will stop the search
- Define values for all users in one dict, while each user can override the value in his own dictionaries.
Issues
- It may be an issue even today: what if same key appear in more then one dict page?
Patch
Here is a (barely tested) patch to MoinMoin 1.8.2 which implements this feature. I called the global dictionary "WikiDict", other names are of course conceivable.
1 *** /usr/local/stow/moin-1.8.2/lib/python2.5/site-packages/MoinMoin/PageEditor.py.~1~
2 --- /usr/local/stow/moin-1.8.2/lib/python2.5/site-packages/MoinMoin/PageEditor.py
3 ***************
4 *** 787,792 ****
5 --- 787,795 ----
6 if request.dicts.has_dict(userDictPage):
7 variables.update(request.dicts.dict(userDictPage))
8
9 + if request.dicts.has_dict("WikiDict"):
10 + variables.update(request.dicts.dict("WikiDict"))
11 +
12 for name in variables:
13 text = text.replace('@%s@' % name, variables[name])
14 return text
- needs to be refactored