1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-16 15:28:24 +00:00

Add wikitext shortcut for new-style function definitions

This commit is contained in:
jeremy@jermolene.com
2022-04-30 12:44:26 +01:00
parent 886c8620f5
commit c9bd1b5274
6 changed files with 169 additions and 5 deletions

View File

@@ -88,9 +88,19 @@ name: name of the variable
value: value of the variable
params: array of {name:, default:} for each parameter
isMacroDefinition: true if the variable is set via a \define macro pragma (and hence should have variable substitution performed)
options includes:
isFunctionDefinition: true if the variable is set via a \function pragma (and hence should not have variable substitution performed)
variableParams: array of {name:, default:} for each function parameter
*/
Widget.prototype.setVariable = function(name,value,params,isMacroDefinition) {
this.variables[name] = {value: value, params: params, isMacroDefinition: !!isMacroDefinition};
Widget.prototype.setVariable = function(name,value,params,isMacroDefinition,options) {
options = options || {};
this.variables[name] = {
value: value,
params: params,
isMacroDefinition: !!isMacroDefinition,
isFunctionDefinition: !!options.isFunctionDefinition,
variableParams: options.variableParams
};
};
/*