mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-28 00:40:01 +00:00
Documentation
This commit is contained in:
parent
4a6501778a
commit
5233d72642
8
core/language/en-GB/Help/echo.tid
Normal file
8
core/language/en-GB/Help/echo.tid
Normal file
@ -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 <text> *
|
||||||
|
```
|
@ -136,7 +136,7 @@ Commander.prototype.stringifyToken = function(index,callback) {
|
|||||||
switch(token.type) {
|
switch(token.type) {
|
||||||
case "filter":
|
case "filter":
|
||||||
return callback(null,this.wiki.filterTiddlers(token.text)[0] || "");
|
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,{
|
return callback(null,this.wiki.renderText("text/plain","text/vnd.tiddlywiki",token.text,{
|
||||||
parseAsInline: false,
|
parseAsInline: false,
|
||||||
parentWidget: $tw.rootWidget
|
parentWidget: $tw.rootWidget
|
||||||
|
8
editions/tw5.com/tiddlers/commands/EchoCommand.tid
Normal file
8
editions/tw5.com/tiddlers/commands/EchoCommand.tid
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
caption: echo
|
||||||
|
created: 20241019150907690
|
||||||
|
modified: 20241019150907690
|
||||||
|
tags: Commands
|
||||||
|
title: EchoCommand
|
||||||
|
type: text/vnd.tiddlywiki
|
||||||
|
|
||||||
|
{{$:/language/Help/echo}}
|
@ -1,17 +1,17 @@
|
|||||||
created: 20161015114042793
|
created: 20161015114042793
|
||||||
modified: 20211114101249016
|
modified: 20241019145819938
|
||||||
tags: TiddlyWikiFolders [[TiddlyWiki on Node.js]]
|
tags: TiddlyWikiFolders [[TiddlyWiki on Node.js]]
|
||||||
title: tiddlywiki.info Files
|
title: tiddlywiki.info Files
|
||||||
type: text/vnd.tiddlywiki
|
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:
|
[[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
|
* ''plugins'' - optional array of plugin names to be included in the wiki
|
||||||
* ''themes'' - an array of theme names to be included in the wiki
|
* ''themes'' - optional array of theme names to be included in the wiki
|
||||||
* ''languages'' - an array of language names to be included in the wiki
|
* ''languages'' - optional 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
|
* ''includeWikis'' - optional 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)
|
* ''build'' - optional hashmap of named build targets, each defined by an array of command tokens (see BuildCommand)
|
||||||
* ''config'' - an optional hashmap of configuration options (see below)
|
* ''config'' - optional hashmap of configuration options (see below)
|
||||||
|
|
||||||
!!! ''includeWikis''
|
!!! ''includeWikis''
|
||||||
|
|
||||||
@ -22,8 +22,45 @@ The entries in the ''includeWikis'' array can be either a string specifying the
|
|||||||
|
|
||||||
!!! ''build''
|
!!! ''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.
|
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": "<<version>>-prod.html"
|
||||||
|
},
|
||||||
|
"the following argument is a filter result",
|
||||||
|
{
|
||||||
|
"type": "filter",
|
||||||
|
"text": "[<version>!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''
|
!!! ''config''
|
||||||
|
|
||||||
Configuration options include:
|
Configuration options include:
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
"dynamic": [
|
"dynamic": [
|
||||||
"--echo","testing",
|
"--echo","testing",
|
||||||
{
|
{
|
||||||
"type": "wikified",
|
"type": "wikify",
|
||||||
"text": "<<version>>-prod.html"
|
"text": "<<version>>-prod.html"
|
||||||
},
|
},
|
||||||
"thingy",
|
"thingy",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user