IncludeWithVals

Description

I wrote this macro so that I could more easily write documentation for different sets of users. Very small parts of the documentation, such as hostnames, differ between users. Rather than try to keep many copies of similar documents in sync, I use this plugin to include small bits of text from a WikiDict in a wiki formatted template.

When viewing a page which includes a template, a user with write permission may suffix the URL with "?edit" to view the page with text input fields where values are included. A "submit" button will appear inline to save the content of the text input fields to the WikiDict file.

Download & Release Notes

Download

Release Version

Moin Version

Release Notes

COPYING

1.0

1.9

License

savedict.py

1.0

1.9

Action which supports IncludeWithVals by saving input to a WikiDict

IncludeWithVals.py

1.0

1.9

IncludeVal.py

1.0

1.9

Also available on bitbucket

Usage

<<IncludeWithVals(TemplateName, DictName)>>

IncludeWithVals will include the wiki text of a page named in the first argument. The page named by the second argument will be used to provide data. Multiple pages may share a WikiDict for common data. If no WikiDict is named, the word "Dict" will be appended to the name of the page which calls IncludeWithVals. The template page may use the following macro, in turn:

<<IncludeVal(DictItem)>>

IncludeVal will insert the escaped value of DictItem from the page named by DictName above into the input. As the text is escaped, URLs can't be included as links, which is a notable limitation.

Example

A page named Example1Dict contains the following:

 * VpnHost:: vpn.example1.com

A page named Example2Dict contains the following:

 * VpnHost:: vpn.example2.com

A page named VpnTemplate contains the following:

Your VPN server is <<IncludeVal(VpnHost)>>

Example1Vpn includes the template:

<<IncludeWithVals(VpnTemplate, Example1Dict)>>

Its output would look like:

Your VPN server is vpn.example1.com

Example2Vpn includes the template:

<<IncludeWithVals(VpnTemplate, Example2Dict)>>

Its output would look like:

Your VPN server is vpn.example2.com

@copyright: 2012 by Gordon Messmer <gordon @ dragonsdawn dot net>

License

GNU GPL v3, see COPYING for details.

Bugs

Discussion

MoinMoin: MacroMarket/IncludeWithVals (last edited 2013-03-03 18:28:58 by 173-160-248-38-Washington)