1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 07:13:15 +00:00

Documentation cleanups

This commit is contained in:
Jeremy Ruston 2012-05-20 15:59:04 +01:00
parent 82f7a547fe
commit 3077f392a1
7 changed files with 61 additions and 98 deletions

File diff suppressed because one or more lines are too long

View File

@ -2,5 +2,5 @@ title: PageTemplate
{{navigation-panel{<<chooser>>}}}{{zoomer-panel{<<zoomer>>}}}
{{container-fluid{
<<story story:StoryTiddlers>>
<<story story:StoryTiddlers storyview:zoomin>>
}}}

View File

@ -1,41 +1,40 @@
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.
!! Examples
This example loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in HTML:
`
node tiddlywiki.js --verbose --load mywiki.html --savetiddler ReadMe ./readme.html
`
TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on tiddlers, TiddlerFiles and TiddlyWikiFiles. For example, this loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in HTML:
{{{
node core/boot.js --verbose --load mywiki.html --savetiddler ReadMe ./readme.html
}}}
!!Usage
`
Running `boot.js` from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments from left to right. The arguments are separated with spaces. The commands are identified by the prefix `--`.
{{{
node core/boot.js [--<option> [<arg>[,<arg>]]]
`
Running `boot.js` from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments. The arguments are separated with spaces. The commands are identified by the prefix `--`.
The commands are processed sequentially from left to right. Processing pauses during long operations and then resumes with the next command in sequence
}}}
!!Commands
The following commands are available.
!!! load
`--load <filepath>`
Load tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files
{{{
--load <filepath>
}}}
!!! savetiddler
`--savetiddler <title> <filename> [<type>]`
Save an individual tiddler as a specified MIME type, defaults to `text/html`
{{{
--savetiddler <title> <filename> [<type>]
}}}
!!! wikitest
`--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.
{{{
--wikitest <dir> [save]
}}}
`--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.
!!! server
`--server <port> <roottiddler> <rendertype> <servetype>`
The server is very simple. 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.
The server is very simple. 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>
}}}
For example:
{{{
--server 8080 $:/core/tiddlywiki5.template.html text/plain text/html
@ -48,29 +47,28 @@ The parameters are:
* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/tiddlywiki5.template.html")
* ''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")
!!! dump
`--dump tiddlers`
!!! dump tiddlers
Dump the titles of the tiddlers in the wiki store
!!! dump
`--dump tiddler <title>`
{{{
--dump tiddlers
}}}
!!! dump tiddler
Dump the fields of an individual tiddler
!!! dump
`--dump shadows`
{{{
--dump tiddler <title>
}}}
!!! dump shadows
Dump the titles of the shadow tiddlers in the wiki store
!!! dump
`--dump config`
{{{
--dump shadows
}}}
!!! dump config
Dump the current core configuration
{{{
--dump config
}}}
!!! verbose
`--verbose`
Triggers verbose output, useful for debugging
!!Trying it out
For trying TiddlyWiki5 out under `node.js`, two batch files are provided:
* `run.sh` boots the kernel and loads the core modules and then outputs the `$tw` global for inspection
* `bld.sh` builds the new TiddlyWiki 5 HTML file (placed in the `tmp/tw5/` directory by default)
{{{
--verbose
}}}

View File

@ -4,6 +4,4 @@ tags: Introduction
Welcome to TiddlyWiki5, a reboot of TiddlyWiki, the venerable, reusable non-linear personal web notebook first released in 2004. It is a complete interactive wiki that can run from a single HTML file in the browser or as a powerful [[node.js application|What is node.js?]].
TiddlyWiki5 is currently at version <<version>> and is under active development, which is to say that it is useful but incomplete. You can try out the prototype at http://tiddlywiki.com/tiddlywiki5, get involved in the [[development on GitHub|https://github.com/Jermolene/TiddlyWiki5]] or the discussions on [[the TiddlyWikiDev Google Group|http://groups.google.com/group/TiddlyWikiDev]].
[[Introduction]]
TiddlyWiki5 is currently at version <<version>> and is under active development, which is to say that it is useful but incomplete. You can try out the online prototype at http://tiddlywiki.com/tiddlywiki5, [[try out the command line incarnation|TryingOutTiddlyWiki]], get involved in the [[development on GitHub|https://github.com/Jermolene/TiddlyWiki5]] or join the discussions on [[the TiddlyWikiDev Google Group|http://groups.google.com/group/TiddlyWikiDev]].

View File

@ -1,46 +0,0 @@
title: RecipeFiles
modifier: JeremyRuston
{{{.recipe}}} files are text files that list the components to be assembled into a TiddlyWiki. They link to a simple template file that contains the basic structure of the TiddlyWiki document with additional markers to identify parts of the file where ingredients are inserted. Recipes determine which tiddlers should be included in the file, and put together the individual JavaScript files making up the TiddlyWiki core code.
Each line of the recipe file is either a comment starting with `#` or lists an ingredient, prefixed with a tag that describes what to do with the ingredient. Tags either identify a marker within the template file or are special tags that initiate an action.
Recipe files contain lines consisting of a marker, a colon and the pathname of an ingredient:
{{{
marker: filepath
}}}
The filepath is interpreted relative to the directory containing the recipe file. The filename can contain the `*` wildcard character, for example:
{{{
tiddler: ../content/*.tid
}}}
You can use filepaths or URLs to reference recipe files and tiddlers. For example, this recipe cooks the latest TiddlyWiki components directly from the online repositories:
{{{
# Get the recipe direct from GitHub
recipe: https://raw.github.com/TiddlyWiki/tiddlywiki/master/tiddlywikinonoscript.html.recipe
tiddler: http://tiddlywiki-com.tiddlyspace.com/bags/tiddlywiki-com-ref_public/tiddlers.json?fat=1
tiddler: http://tiddlywiki-com.tiddlyspace.com/bags/tiddlywiki-com_public/tiddlers.json?fat=1
}}}
The special marker {{{recipe}}} is used to load a sub-recipe file.
The special marker {{{template}}} is used to identify the HTML template. The HTML template contains markers in one of two alternative forms:
{{{
<!--@@marker@@-->
&lt;!--@@marker@@--&gt;
}}}
The special marker {{{title}}} is automatically filled in with a plain text rendering of the WindowTitle tiddler.
The special marker {{{tiddler}}} is used for the main content tiddlers that will be encoded in TiddlyWiki {{{<DIV>}}} format.
The special marker {{{copy}}} is used to indicate files that should be copied alongside the finished TiddlyWiki file.
Tiddler fields can be overridden by following an ingredient with a set of indented fields:
{{{
tiddler: ../js/myscript.js
title: MyScript
modifier: JoeBloggs
tiddler: ../js/myoldscript.js
title: MyOldScript
tags: [[one long one]] Short
}}}
Note that if tags are applied in this way they completely replace any previous tags on the tiddler.

View File

@ -2,7 +2,7 @@ title: SampleJavaScriptWithError
type: application/javascript
/*
This is an example JavaScript file
This is an example JavaScript program that contains an error
*/
function myFunction(param) {
if(=) { // An error

View File

@ -0,0 +1,6 @@
title: TryingOutTiddlyWiki
For trying TiddlyWiki5 out under node.js, two batch files are provided:
* `run.sh` runs the wikitests
* `bld.sh` builds the new TiddlyWiki 5 HTML file (placed in the `tmp/tw5/` directory by default)