Ticket #610 (closed enhancement: fixed)
enhance toolbar macro syntax to render tiddler/slice/section content inline
| Reported by: | EricShulman | Owned by: | MartinBudden |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.6.1 |
| Component: | core | Version: | |
| Severity: | low | Keywords: | |
| Cc: |
Description
Extend the <<toolbar>> macro to recognize references to tiddlernames, slices, or sections and render their content inline within the toolbar. This allows macros, options, or static text to be easily incorporated into a toolbar display.
See http://www.TiddlyTools.com/#ToolbarCommands for examples
config.macros.toolbar.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
...
if(c in config.commands)
this.createCommand(place,c,tiddler,theClass);
else { // WIKIFY TIDDLER/SLICE/SECTION
if (c.substr(0,1)=="~") c=c.substr(1); // ignore leading ~
var txt=store.getTiddlerText(c);
if (txt) {
// trim any leading/trailing newlines
txt=txt.replace(/^\n*/,"").replace(/\n*$/,"");
// trim PRE format wrapper if any
txt=txt.replace(/^{{{\n/,"").replace(/\n}}}$/,"");
wikify(txt,createTiddlyElement(place,"span"));
}
}
break;
...
Change History
Note: See
TracTickets for help on using
tickets.
