Friday, February 21, 2014 at 11:19 AM

Defining your own macros

You can define your own macros, with or without parameters.

Create a #macros section, it can be in your cmsPrefs.opml file, at the top level of an outline, or anywhere within an outline. Under #macros put the name of the macro and under that, put the macro definition.

Here's a screen shot of the macros section of the outline for the docs website.

Because there's a hello macro defined there, I can call it this way <%hello ()%> and it will render as the string Hello there!.

There's also a macro defined called sumArgs, which returns the sum of its arguments. I can call it this way <%sumArgs (1, 2, 3)%> which renders as 6.


Last built: Tue, Dec 9, 2014 at 3:29 PM

By Dave Winer, Friday, February 21, 2014 at 11:19 AM. Reallll soooon now...