[Moin-user] Include macro with variable interpolation
R.Bauer
rb.proj at gmail.com
Mon Jan 21 08:21:36 EST 2013
Am 20.01.2013 00:24, schrieb Gordon Messmer:
> Use case: I want to publish customized documentation to users that I
> support. The pages will be largely identical with small items such as
> hostnames that are specific to the different users. I could do this
> with templates, but I also want to avoid keeping each document in sync
> manually when I need to update the documentation.
>
> I've written two new macros and one action that build on top of the
> existing GetVal macro to accomplish this.
>
> The first macro:
> <<IncludeWithVals(template, vardict)>>
> saves the value given in "vardict" in the request object. This value
> should name a page formatted as a wiki dict to provide values which will
> be referenced in the page named by "template". If the query includes
> the key "edit" (as in /url?edit), the template will be surrounded by
> <form> tags and a submit button will be included at the end.
>
> The second macro:
> <<IncludeVal(key)>>
> is used in the template. It will load the value named by "key" from the
> wiki dict referenced in the IncludeWithVals macro that included this
> page. If the query includes the key "edit"), the values will be printed
> as form input items rather than text.
>
> The action is referenced by the form printed by <<IncludeWithVals>>. It
> will load all of the values present in the wiki dict named by "vardict",
> replace any values which are present in the form input, and save the
> results. Any content of the wiki dict which is not part of the dict
> itself will be lost.
>
> I'll publish these on the macro market shortly, but wanted to get input
> from users before I do. I'll try to fix any flaws that exist in the
> macros before I upload them.
Please use coderview.appspot.com
cheers
Reimar
>
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122912
>
>
>
> _______________________________________________
> Moin-user mailing list
> Moin-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/moin-user
>
More information about the Moin-user
mailing list