From e5103c32f30a75f19a25205832db08091b7eeaa0 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 25 Feb 2014 14:50:37 +0000 Subject: [PATCH] Move command documentation into the core --- core/language/en-GB/Help/default.tid | 22 ++++++++++++++ core/language/en-GB/Help/help.tid | 10 +++++++ core/language/en-GB/Help/init.tid | 23 ++++++++++++++ core/language/en-GB/Help/load.tid | 14 +++++++++ core/language/en-GB/Help/notfound.tid | 3 ++ core/language/en-GB/Help/password.tid | 9 ++++++ core/language/en-GB/Help/rendertiddler.tid | 8 +++++ core/language/en-GB/Help/rendertiddlers.tid | 14 +++++++++ core/language/en-GB/Help/savetiddler.tid | 8 +++++ core/language/en-GB/Help/server.tid | 30 +++++++++++++++++++ core/language/en-GB/Help/verbose.tid | 8 +++++ core/language/en-GB/Help/version.tid | 8 +++++ .../tw5.com/tiddlers/commands/HelpCommand.tid | 7 +++++ .../tw5.com/tiddlers/commands/InitCommand.tid | 21 +------------ .../tw5.com/tiddlers/commands/LoadCommand.tid | 12 +------- .../tiddlers/commands/PasswordCommand.tid | 7 +---- .../commands/RenderTiddlerCommand.tid | 6 +--- .../commands/RenderTiddlersCommand.tid | 12 +------- .../tiddlers/commands/SaveTiddlerCommand.tid | 6 +--- .../tiddlers/commands/ServerCommand.tid | 28 +---------------- .../tiddlers/commands/VerboseCommand.tid | 6 +--- .../tiddlers/commands/VersionCommand.tid | 6 +--- 22 files changed, 173 insertions(+), 95 deletions(-) create mode 100644 core/language/en-GB/Help/default.tid create mode 100644 core/language/en-GB/Help/help.tid create mode 100644 core/language/en-GB/Help/init.tid create mode 100644 core/language/en-GB/Help/load.tid create mode 100644 core/language/en-GB/Help/notfound.tid create mode 100644 core/language/en-GB/Help/password.tid create mode 100644 core/language/en-GB/Help/rendertiddler.tid create mode 100644 core/language/en-GB/Help/rendertiddlers.tid create mode 100644 core/language/en-GB/Help/savetiddler.tid create mode 100644 core/language/en-GB/Help/server.tid create mode 100644 core/language/en-GB/Help/verbose.tid create mode 100644 core/language/en-GB/Help/version.tid create mode 100644 editions/tw5.com/tiddlers/commands/HelpCommand.tid diff --git a/core/language/en-GB/Help/default.tid b/core/language/en-GB/Help/default.tid new file mode 100644 index 000000000..0a8fce44c --- /dev/null +++ b/core/language/en-GB/Help/default.tid @@ -0,0 +1,22 @@ +title: $:/language/Help/default + +\define commandTitle() +$:/language/Help/$(command)$ +\end +``` +usage: tiddlywiki [] [-- [...]...] +``` + +Available commands: + +
    +<$list filter="[commands[]sort[title]]" variable="command"> +
  • <$link to=<>><$macrocall $name="command" $type="text/plain" $output="text/plain"/>: <$transclude tiddler=<> field="description"/>
  • + +
+ +To get detailed help on a command: + +``` +tiddlywiki --help +``` diff --git a/core/language/en-GB/Help/help.tid b/core/language/en-GB/Help/help.tid new file mode 100644 index 000000000..88bb38a8f --- /dev/null +++ b/core/language/en-GB/Help/help.tid @@ -0,0 +1,10 @@ +title: $:/language/Help/help +description: Display help for TiddlyWiki commands + +Displays help text for a command: + +``` +--help [] +``` + +If the command name is omitted then a list of available commands is displayed. diff --git a/core/language/en-GB/Help/init.tid b/core/language/en-GB/Help/init.tid new file mode 100644 index 000000000..71a7be224 --- /dev/null +++ b/core/language/en-GB/Help/init.tid @@ -0,0 +1,23 @@ +title: $:/language/Help/init +description: Initialise a new wiki folder + +Initialise an empty [[WikiFolder|WikiFolders]] with a copy of the specified edition. + +``` +--init [ ...] +``` + +For example: + +``` +tiddlywiki ./MyWikiFolder --init empty +``` + +Note: + +* The wiki folder directory will be created if necessary +* The "edition" defaults to ''empty'' +* The init command will fail if the wiki folder is not empty +* The init command removes any `includeWikis` definitions in the edition's `tiddlywiki.info` file +* When multiple editions are specified, editions initialised later will overwrite any files shared with earlier editions (so, the final `tiddlywiki.info` file will be copied from the last edition) +* `--help editions` returns a list of available editions diff --git a/core/language/en-GB/Help/load.tid b/core/language/en-GB/Help/load.tid new file mode 100644 index 000000000..75c2eec6f --- /dev/null +++ b/core/language/en-GB/Help/load.tid @@ -0,0 +1,14 @@ +title: $:/language/Help/load +description: Load tiddlers from a file + +Load tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files + +``` +--load +``` + +To load tiddlers from an encrypted TiddlyWiki file you should first specify the password with the PasswordCommand. For example: + +``` +tiddlywiki ./MyWiki --password pa55w0rd --load my_encrypted_wiki.html +``` diff --git a/core/language/en-GB/Help/notfound.tid b/core/language/en-GB/Help/notfound.tid new file mode 100644 index 000000000..83eca6baa --- /dev/null +++ b/core/language/en-GB/Help/notfound.tid @@ -0,0 +1,3 @@ +title: $:/language/Help/notfound + +No such help item \ No newline at end of file diff --git a/core/language/en-GB/Help/password.tid b/core/language/en-GB/Help/password.tid new file mode 100644 index 000000000..d9e87a503 --- /dev/null +++ b/core/language/en-GB/Help/password.tid @@ -0,0 +1,9 @@ +title: $:/language/Help/password +description: Set a password for subsequent crypto operations + +Set a password for subsequent crypto operations + +``` +--password +``` + diff --git a/core/language/en-GB/Help/rendertiddler.tid b/core/language/en-GB/Help/rendertiddler.tid new file mode 100644 index 000000000..c26ade841 --- /dev/null +++ b/core/language/en-GB/Help/rendertiddler.tid @@ -0,0 +1,8 @@ +title: $:/language/Help/rendertiddler +description: Render an individual tiddler as a specified ContentType + +Render an individual tiddler as a specified ContentType, defaults to `text/html` and save it to the specified filename: + +``` +--rendertiddler <filename> [<type>] +``` diff --git a/core/language/en-GB/Help/rendertiddlers.tid b/core/language/en-GB/Help/rendertiddlers.tid new file mode 100644 index 000000000..2d69bb0fd --- /dev/null +++ b/core/language/en-GB/Help/rendertiddlers.tid @@ -0,0 +1,14 @@ +title: $:/language/Help/rendertiddlers +description: Render tiddlers matching a filter to a specified ContentType + +Render a set of tiddlers matching a filter to separate files of a specified ContentType (defaults to `text/html`) and extension (defaults to `.html`). + +``` +--rendertiddlers <filter> <template> <pathname> [<type>] [<extension>] +``` + +For example: + +``` +--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html ./static text/plain +``` diff --git a/core/language/en-GB/Help/savetiddler.tid b/core/language/en-GB/Help/savetiddler.tid new file mode 100644 index 000000000..f9de07a15 --- /dev/null +++ b/core/language/en-GB/Help/savetiddler.tid @@ -0,0 +1,8 @@ +title: $:/language/Help/savetiddler +description: Saves a raw tiddler to a file + +Saves an individual tiddler in its raw text or binary format to the specified filename. + +``` +--savetiddler <title> <filename> +``` diff --git a/core/language/en-GB/Help/server.tid b/core/language/en-GB/Help/server.tid new file mode 100644 index 000000000..ef900b5bd --- /dev/null +++ b/core/language/en-GB/Help/server.tid @@ -0,0 +1,30 @@ +title: $:/language/Help/server +description: Provides an HTTP server interface to TiddlyWiki + +The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage. + +At the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for `GET`, `PUT` and `DELETE`. + +``` +--server <port> <roottiddler> <rendertype> <servetype> <username> <password> <host> +``` + +The parameters are: + +* ''port'' - port number to serve from (defaults to "8080") +* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/save/all") +* ''rendertype'' - the content type to which the root tiddler should be rendered (defaults to "text/plain") +* ''servetype'' - the content type with which the root tiddler should be served (defaults to "text/html") +* ''username'' - the default username for signing edits +* ''password'' - optional password for basic authentication +* ''host'' - optional hostname to serve from (defaults to "127.0.0.1" aka "localhost") + +If the password parameter is specified then the browser will prompt the user for the username and password. Note that the password is transmitted in plain text so this implementation isn't suitable for general use. + +For example: + +``` +--server 8080 $:/core/save/all text/plain text/html MyUserName passw0rd +``` + +To run multiple TiddlyWiki servers at the same time you'll need to put each one on a different port. diff --git a/core/language/en-GB/Help/verbose.tid b/core/language/en-GB/Help/verbose.tid new file mode 100644 index 000000000..395321a30 --- /dev/null +++ b/core/language/en-GB/Help/verbose.tid @@ -0,0 +1,8 @@ +title: $:/language/Help/verbose +description: Triggers verbose output mode + +Triggers verbose output, useful for debugging + +``` +--verbose +``` diff --git a/core/language/en-GB/Help/version.tid b/core/language/en-GB/Help/version.tid new file mode 100644 index 000000000..4d9ba0bae --- /dev/null +++ b/core/language/en-GB/Help/version.tid @@ -0,0 +1,8 @@ +title: $:/language/Help/version +description: Displays the version number of TiddlyWiki + +Displays the version number of TiddlyWiki. + +``` +--version +``` diff --git a/editions/tw5.com/tiddlers/commands/HelpCommand.tid b/editions/tw5.com/tiddlers/commands/HelpCommand.tid new file mode 100644 index 000000000..7a74824ea --- /dev/null +++ b/editions/tw5.com/tiddlers/commands/HelpCommand.tid @@ -0,0 +1,7 @@ +created: 20140225195548209 +modified: 20140225195738745 +tags: command +title: HelpCommand +type: text/vnd.tiddlywiki + +{{$:/language/Help/help}} diff --git a/editions/tw5.com/tiddlers/commands/InitCommand.tid b/editions/tw5.com/tiddlers/commands/InitCommand.tid index 41edae0f6..56919407e 100644 --- a/editions/tw5.com/tiddlers/commands/InitCommand.tid +++ b/editions/tw5.com/tiddlers/commands/InitCommand.tid @@ -4,23 +4,4 @@ tags: command title: InitCommand type: text/vnd.tiddlywiki -Initialise an empty [[WikiFolder|WikiFolders]] with a copy of the specified edition. - -``` ---init <edition> [<edition> ...] -``` - -For example: - -``` -tiddlywiki ./MyWikiFolder --init empty -``` - -Note: - -* The edition directory will be created if necessary -* The "edition" defaults to ''empty'' -* The init command will fail if the wiki folder does not exist, or is not empty -* The init command removes any `includeWikis` definitions in the edition's `tiddlywiki.info` file -* When multiple editions are specified, editions initialised later will overwrite any files shared with earlier editions (so, the final `tiddlywiki.info` file will be copied from the last edition) - +{{$:/language/Help/init}} diff --git a/editions/tw5.com/tiddlers/commands/LoadCommand.tid b/editions/tw5.com/tiddlers/commands/LoadCommand.tid index 05a093ece..f62ce9b37 100644 --- a/editions/tw5.com/tiddlers/commands/LoadCommand.tid +++ b/editions/tw5.com/tiddlers/commands/LoadCommand.tid @@ -4,14 +4,4 @@ tags: command title: LoadCommand type: text/vnd.tiddlywiki -Load tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files - -``` ---load <filepath> -``` - -To load tiddlers from an encrypted TiddlyWiki file you should first specify the password with the PasswordCommand. For example: - -``` -tiddlywiki ./MyWiki --password pa55w0rd --load my_encrypted_wiki.html -``` +{{$:/language/Help/load}} diff --git a/editions/tw5.com/tiddlers/commands/PasswordCommand.tid b/editions/tw5.com/tiddlers/commands/PasswordCommand.tid index 945cccfa3..909db11fe 100644 --- a/editions/tw5.com/tiddlers/commands/PasswordCommand.tid +++ b/editions/tw5.com/tiddlers/commands/PasswordCommand.tid @@ -1,9 +1,4 @@ title: PasswordCommand tags: command -Set a password for subsequent crypto operations - -``` ---password <password> -``` - +{{$:/language/Help/password}} diff --git a/editions/tw5.com/tiddlers/commands/RenderTiddlerCommand.tid b/editions/tw5.com/tiddlers/commands/RenderTiddlerCommand.tid index fa756786d..eea70700f 100644 --- a/editions/tw5.com/tiddlers/commands/RenderTiddlerCommand.tid +++ b/editions/tw5.com/tiddlers/commands/RenderTiddlerCommand.tid @@ -1,8 +1,4 @@ title: RenderTiddlerCommand tags: command -Render an individual tiddler as a specified ContentType, defaults to `text/html` and save it to the specified filename - -``` ---rendertiddler <title> <filename> [<type>] -``` +{{$:/language/Help/rendertiddler}} diff --git a/editions/tw5.com/tiddlers/commands/RenderTiddlersCommand.tid b/editions/tw5.com/tiddlers/commands/RenderTiddlersCommand.tid index 414bddfa7..6556d5289 100644 --- a/editions/tw5.com/tiddlers/commands/RenderTiddlersCommand.tid +++ b/editions/tw5.com/tiddlers/commands/RenderTiddlersCommand.tid @@ -1,14 +1,4 @@ title: RenderTiddlersCommand tags: command -Render a set of tiddlers matching a filter to separate files of a specified ContentType (defaults to `text/html`) and extension (defaults to `.html`). - -``` ---rendertiddlers <filter> <template> <pathname> [<type>] [<extension>] -``` - -For example: - -``` ---rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html ./static text/plain -``` +{{{$:/language/Help/rendertiddlers}}} diff --git a/editions/tw5.com/tiddlers/commands/SaveTiddlerCommand.tid b/editions/tw5.com/tiddlers/commands/SaveTiddlerCommand.tid index bc5098312..b35a8c8e9 100644 --- a/editions/tw5.com/tiddlers/commands/SaveTiddlerCommand.tid +++ b/editions/tw5.com/tiddlers/commands/SaveTiddlerCommand.tid @@ -3,8 +3,4 @@ tags: command created: 20131218121606089 modified: 20131218121606089 -Saves an individual tiddler in its raw text or binary format to the specified filename. - -``` ---savetiddler <title> <filename> -``` +{{$:/language/Help/savetiddler}} diff --git a/editions/tw5.com/tiddlers/commands/ServerCommand.tid b/editions/tw5.com/tiddlers/commands/ServerCommand.tid index 5cd232d5e..8b0659c3d 100644 --- a/editions/tw5.com/tiddlers/commands/ServerCommand.tid +++ b/editions/tw5.com/tiddlers/commands/ServerCommand.tid @@ -4,30 +4,4 @@ tags: command title: ServerCommand type: text/vnd.tiddlywiki -The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage. - -At the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for `GET`, `PUT` and `DELETE`. - -``` ---server <port> <roottiddler> <rendertype> <servetype> <username> <password> <host> -``` - -The parameters are: - -* ''port'' - port number to serve from (defaults to "8080") -* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/save/all") -* ''rendertype'' - the content type to which the root tiddler should be rendered (defaults to "text/plain") -* ''servetype'' - the content type with which the root tiddler should be served (defaults to "text/html") -* ''username'' - the default username for signing edits -* ''password'' - optional password for basic authentication -* ''host'' - optional hostname to serve from (defaults to "127.0.0.1" aka "localhost") - -If the password parameter is specified then the browser will prompt the user for the username and password. Note that the password is transmitted in plain text so this implementation isn't suitable for general use. - -For example: - -``` ---server 8080 $:/core/save/all text/plain text/html MyUserName passw0rd -``` - -To run multiple TiddlyWiki servers at the same time you'll need to put each one on a different port. +{{$:/language/Help/server}} diff --git a/editions/tw5.com/tiddlers/commands/VerboseCommand.tid b/editions/tw5.com/tiddlers/commands/VerboseCommand.tid index 54d52db56..51aa60625 100644 --- a/editions/tw5.com/tiddlers/commands/VerboseCommand.tid +++ b/editions/tw5.com/tiddlers/commands/VerboseCommand.tid @@ -1,8 +1,4 @@ title: VerboseCommand tags: command -Triggers verbose output, useful for debugging - -``` ---verbose -``` +{{$:/language/Help/verbose}} diff --git a/editions/tw5.com/tiddlers/commands/VersionCommand.tid b/editions/tw5.com/tiddlers/commands/VersionCommand.tid index f13df28a6..37efdf778 100644 --- a/editions/tw5.com/tiddlers/commands/VersionCommand.tid +++ b/editions/tw5.com/tiddlers/commands/VersionCommand.tid @@ -1,8 +1,4 @@ title: VersionCommand tags: command -Displays the version number of TiddlyWiki. - -``` ---version -``` +{{$:/language/Help/version}}