Below is a custom macro that is called like this:
<<bookdex Mark >>
It works fine, but there's this honkin' big array in the middle that
REALLY wants to live somewhere else -- not only to make this piece of
code more manageably small, but more importantly, to let me reuse it
elsewhere.

The result won't be presented to the user, so "wikify" isn't used I
guess; so will it use the "return" command to pass back the array?
And how to I reference the function from here -- is there some kind of
"store." object involved?

(Honest, I do try to search for existing answers before posting.)

config.macros.bookdex={
   handler:
function(place,macroName,params,wikifier,paramString,tiddler) {
        var book = params[0];
        var bookdex;

        var arrBookdex = new Array();

        //////////////////////////////////////////
        //  Wants to be replaced by a call to separate macro
             arrBookdex ["John" ] = "100";
             arrBookdex ["Mark"] = "120";
             arrBookdex ["Matthew" ] = "140";
                 //         ... etc. !
        //////////////////////////////////////////

        bookdex = arrBookdex[book];
        wikify(bookdex, place);
   }
 };

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to