Collection of Macros used across TiddlyWiki files. It's on gist because of the need of a central place to update the macros and then copy into other tiddlyWikis.
config.macros.hero= {}; | |
config.macros.hero.handler = function (place,macroName,params,wikifier,paramString,tiddler) { | |
var heroText= params.length > 0 ? params[0] : "BLANK"; | |
wikify("__@@''"+heroText+"''@@__", place); | |
} | |
config.macros.insight= {}; | |
config.macros.insight.handler = function (place,macroName,params,wikifier,paramString,tiddler) { | |
var insightText= params.length > 0 ? params[0] : "BLANK"; | |
wikify("^^@@Insight@@ : "+insightText+"^^", place); | |
} | |
config.macros.hrLine= {}; | |
config.macros.hrLine.handler = function (place,macroName,params,wikifier,paramString,tiddler) { | |
var insightText= params.length > 0 ? params[0] : "BLANK"; | |
wikify("-------------------------------------------------------------------------------------------------", place); | |
} | |
config.macros.imgSrc= {}; | |
config.macros.imgSrc.handler = function (place,macroName,params,wikifier,paramString,tiddler) { | |
var imgSrc= params.length > 0 ? params[0] : "BLANK"; | |
var width= params.length > 1 ? params[1] : "400"; | |
var height = params.length > 2 ? params[2] : "400"; | |
var border = params.length > 3 ? params[3] : "1"; | |
wikify('<html><img border="1" width="'+width+'" height="'+height+'" src="'+imgSrc+'" /></html>', place); | |
} | |
config.macros.noNewLine= {}; | |
config.macros.noNewLine.handler = function (place,macroName,params,wikifier,paramString,tiddler) { | |
var textWithNewLines = params.length > 0 ? params[0] : "BLANK"; | |
var textWithoutNewLines = textWithNewLines.replace('\n',''); | |
textWithoutNewLines = textWithoutNewLines.replace('\r',''); | |
wikify(textWithoutNewLines, place); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment