1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-09 11:29:58 +00:00
TiddlyWiki5/tiddlywiki5/store/CommandLineInterface.tid

61 lines
3.9 KiB
Plaintext
Raw Normal View History

2011-12-28 16:10:57 +00:00
title: CommandLineInterface
modifier: JeremyRuston
TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on RecipeFiles, TiddlerFiles and TiddlyWikiFiles.
The command line interface for TiddlyWiki5 has been designed to support two distinct usages:
* Cooking (or building) old 2.6.x versions of classic TiddlyWiki from the constituent JavaScript components
* Cooking and serving TiddlyWiki5 itself
!!Usage
2012-01-23 16:42:23 +00:00
`
2011-12-28 16:10:57 +00:00
node tiddlywiki.js <options>
2012-01-23 16:42:23 +00:00
`
The command line options are processed sequentially from left to right. Processing pauses during long operations, like loading a [[recipe file|RecipeFiles]] and all the subrecipes and [[tiddlers|TiddlerFiles]] that it references, and then resumes with the next command line option in sequence.
The state that is carried between options is as follows:
* The set of tiddlers that are currently loaded into memory
* The recipe file last used to load tiddlers (recipe files are used primarily to manage shadow tiddlers)
* The TiddlerFileStore used to store the main content tiddlers. This is independent of the current recipe
The following options are available:
2012-01-23 16:42:23 +00:00
|`--recipe <filepath>` |Loads a specfied `.recipe` file |
|`--load <filepath>` |Load additional tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files |
|`--store <dirpath>` |Load a specified TiddlerFileStore |
|`--links none` |Determines how links will be generated by subsequent options. See below for details |
2012-01-23 16:42:23 +00:00
|`--savewiki <dirpath>` |Saves all the loaded tiddlers as a single file TiddlyWiki called `index.html` and an RSS feed called `index.xml` in a new directory of the specified name |
|`--savetiddler <title> <filename> [<type>]` |Save an individual tiddler as a specified MIME type, defaults to `text/html` |
|`--savetiddlers <outdir>` |Saves all the loaded tiddlers as `.tid` files in the specified directory |
2012-03-03 18:06:24 +00:00
|`--savehtml <outdir>` |Saves all the loaded tiddlers as static, unstyled `.html` files in the specified directory |
2012-01-23 16:42:23 +00:00
|`--servewiki <port>` |Serve the cooked TiddlyWiki over HTTP at `/` |
|`--servetiddlers <port>` |Serve individual tiddlers over HTTP at `/tiddlertitle` |
|`--wikitest <dir> [save]` |Run wikification tests against the tiddlers in the given directory. Include the `save` flag to save the test result files as the new targets |
2012-01-23 16:42:23 +00:00
|`--dumpstore` |Dump the TiddlyWiki store in JSON format |
|`--dumprecipe` |Dump the current recipe in JSON format |
|`--verbose` |verbose output, useful for debugging |
2011-12-28 16:10:57 +00:00
!! Examples
This example loads the tiddlers from a TiddlyWiki HTML file and makes them available over HTTP:
2012-01-23 16:42:23 +00:00
`
2011-12-28 16:10:57 +00:00
node tiddlywiki.js --load mywiki.html --servewiki 127.0.0.1:8000
2012-01-23 16:42:23 +00:00
`
2011-12-28 16:10:57 +00:00
This example cooks a TiddlyWiki from a recipe:
2012-01-23 16:42:23 +00:00
`
2011-12-28 16:10:57 +00:00
node tiddlywiki.js --recipe tiddlywiki.com/index.recipe --savewiki tmp/
2012-01-23 16:42:23 +00:00
`
2011-12-28 16:10:57 +00:00
This example ginsus a TiddlyWiki into its constituent tiddlers:
2012-01-23 16:42:23 +00:00
`
2011-12-28 16:10:57 +00:00
node tiddlywiki.js --load mywiki.html --savetiddlers tmp/tiddlers
2012-01-23 16:42:23 +00:00
`
2011-12-28 16:10:57 +00:00
!! Notes
The HTTP serving functionality built into TiddlyWiki5 is designed to support personal use scenarios. If you want to flexibly and robustly share tiddlers on the web for multiple users, you should use TiddlyWeb or TiddlySpace.
`--servewiki` and `--servetiddlers` are for different purposes and should not be used together. The former is for TiddlyWiki core developers who want to be able to edit the TiddlyWiki source files in a text editor and view the results in the browser by clicking refresh; it is slow because it reloads all the TiddlyWiki JavaScript files each time the page is loaded. The latter is for experimenting with the new wikification engine.
2012-01-15 11:46:20 +00:00
`--wikitest` looks for `*.tid` files in the specified folder. It then wikifies the tiddlers to both "text/plain" and "text/html" format and checks the results against the content of the `*.html` and `*.txt` files in the same directory.
`--links` controls the way that links are generated. Currently, the only option supported is:
`none`: Tiddler links are disabled