diff --git a/core/language/en-GB/Help/echo.tid b/core/language/en-GB/Help/echo.tid new file mode 100644 index 000000000..5e8ac35ac --- /dev/null +++ b/core/language/en-GB/Help/echo.tid @@ -0,0 +1,8 @@ +title: $:/language/Help/echo +description: Displays all the passed arguments + +Displays all the passed arguments to a command. Useful for debugging. + +``` +--echo * +``` diff --git a/core/modules/commander.js b/core/modules/commander.js index ce7d17087..f99fe70f1 100644 --- a/core/modules/commander.js +++ b/core/modules/commander.js @@ -136,7 +136,7 @@ Commander.prototype.stringifyToken = function(index,callback) { switch(token.type) { case "filter": return callback(null,this.wiki.filterTiddlers(token.text)[0] || ""); - case "wikified": + case "wikify": return callback(null,this.wiki.renderText("text/plain","text/vnd.tiddlywiki",token.text,{ parseAsInline: false, parentWidget: $tw.rootWidget diff --git a/editions/tw5.com/tiddlers/commands/EchoCommand.tid b/editions/tw5.com/tiddlers/commands/EchoCommand.tid new file mode 100644 index 000000000..81ea698ba --- /dev/null +++ b/editions/tw5.com/tiddlers/commands/EchoCommand.tid @@ -0,0 +1,8 @@ +caption: echo +created: 20241019150907690 +modified: 20241019150907690 +tags: Commands +title: EchoCommand +type: text/vnd.tiddlywiki + +{{$:/language/Help/echo}} diff --git a/editions/tw5.com/tiddlers/nodejs/tiddlywiki.info_Files.tid b/editions/tw5.com/tiddlers/nodejs/tiddlywiki.info_Files.tid index dddcd3106..fee95b89d 100644 --- a/editions/tw5.com/tiddlers/nodejs/tiddlywiki.info_Files.tid +++ b/editions/tw5.com/tiddlers/nodejs/tiddlywiki.info_Files.tid @@ -1,17 +1,17 @@ created: 20161015114042793 -modified: 20211114101249016 +modified: 20241019145819938 tags: TiddlyWikiFolders [[TiddlyWiki on Node.js]] title: tiddlywiki.info Files type: text/vnd.tiddlywiki [[TiddlyWikiFolders]] are configured with a single `tiddlywiki.info` file in the root of the wiki folder. It should contain a JSON object comprising the following properties: -* ''plugins'' - an array of plugin names to be included in the wiki -* ''themes'' - an array of theme names to be included in the wiki -* ''languages'' - an array of language names to be included in the wiki -* ''includeWikis'' - an array of references to external wiki folders to be included in the wiki -* ''build'' - a hashmap of named build targets, each defined by an array of command tokens (see BuildCommand) -* ''config'' - an optional hashmap of configuration options (see below) +* ''plugins'' - optional array of plugin names to be included in the wiki +* ''themes'' - optional array of theme names to be included in the wiki +* ''languages'' - optional array of language names to be included in the wiki +* ''includeWikis'' - optional array of references to external wiki folders to be included in the wiki +* ''build'' - optional hashmap of named build targets, each defined by an array of command tokens (see BuildCommand) +* ''config'' - optional hashmap of configuration options (see below) !!! ''includeWikis'' @@ -22,8 +22,45 @@ The entries in the ''includeWikis'' array can be either a string specifying the !!! ''build'' +The ''build'' property contains a hashmap of named build targets. Each of the build targets is defined as an array of command tokens. + Note that the build targets of included wikis are merged if a target of that name isn't defined in the current `tiddlywiki.info` file. +Command tokens can be a simple string or a command token object with a ''type'' property. The following types are defined to allow the command token to be dynamically defined: + +* ''filter'': the value of the first result of a filter expression specified in the ''text'' property of the command token object +* ''wikify'': the result of wikifying a text string specified in the ''text'' property of the command token object +* ''prompt'': the result of prompting the user for a string. The ''prompt'' property of the command token object specifies the textual prompt to be used. The optional ''default'' property specifies a string value to be used if the user presses enter in response to the prompt + +The EchoCommand is useful for debugging complex dynamic command tokens. + +For example: + +``` +"build": { + "dynamic": [ + "--echo","testing", + "the following argument is wikified", + { + "type": "wikify", + "text": "<>-prod.html" + }, + "the following argument is a filter result", + { + "type": "filter", + "text": "[!match[5.3.6-prerelease]then[text/html]else[text/plain]]" + }, + "the following argument was provided by the user", + { + "type": "prompt", + "prompt": "Please enter some text and type enter", + "default": "Nothing" + } + ], +... +``` + + !!! ''config'' Configuration options include: diff --git a/editions/tw5.com/tiddlywiki.info b/editions/tw5.com/tiddlywiki.info index f63c440a1..f7a2b336e 100644 --- a/editions/tw5.com/tiddlywiki.info +++ b/editions/tw5.com/tiddlywiki.info @@ -26,7 +26,7 @@ "dynamic": [ "--echo","testing", { - "type": "wikified", + "type": "wikify", "text": "<>-prod.html" }, "thingy",