More docs updates

This commit is contained in:
Jeremy Ruston 2012-12-28 23:08:28 +00:00
parent b251a2bfa1
commit 00676c6966
2 changed files with 5 additions and 84 deletions

View File

@ -6,26 +6,18 @@ tags: docs internals
The heart of TiddlyWiki can be seen as an extensible representation transformation engine. Given the text of a tiddler and its associated ContentType, the engine can produce a rendering of the tiddler in a new ContentType. Furthermore, it can efficiently selectively update the rendering to track any changes in the tiddler or its dependents.
The most important transformations are from `text/vnd.tiddlywiki` wikitext into `text/html` or `text/plain` but the engine is used throughout the system for other transformations.
The primary use of the engine is to convert raw `text/vnd.tiddlywiki` WikiText into a `text/html` or `text/plain` representation for display. The transclusion and templating features of WikiText allow the engine to also be used to generate TiddlyWiki HTML files from raw tiddlers.
You can explore this mechanism by opening the JavaScript console in your browser. Typing this command will replace the text of the tiddler `HelloThere` with new content:
{{{
```
$tw.wiki.addTiddler({title: "HelloThere", text: "This is some new content"});
}}}
```
If the tiddler `HelloThere` is visible then you'll see it instantly change to reflect the new content. If you create a tiddler that doesn't currently exist then you'll see any displayed links to it instantly change from italicised to normal:
{{{
```
$tw.wiki.addTiddler({title: "TiddlyWiki5", text: "This tiddler now exists"});
}}}
The power of this mechanism also drives the interactive features of TiddlyWiki. For example, try typing the following into the JavaScript console:
{{{
$tw.wiki.addTiddler({title: "ViewDropDownState", text: "(50,50,200,200)"});
}}}
You should see the view dropdown appear in the middle of the screen. The underlying mechanism is that the creation of the tiddler with this title triggers the display of the popup at the specified location.
```
If you're interested in understanding more about the internal operation of TiddlyWiki, it is recommended that you review the [[Docs]] and read the code -- start with the boot kernel [[$:/core/boot.js]].

View File

@ -1,71 +0,0 @@
title: WaysToUseTiddlyWiki
tags: feature
!Introduction
TiddlyWiki5 will be deployable in a wide variety of different arrangements to suit different needs. The archetypal configurations are listed below along with a measure of how much complexity is involved in setting up each one -- once set up properly, the TiddlyWiki user experience should be consistent regardless of configuration.
|!Name |!Description |!Barriers |
|SelfContained |TiddlyWiki's familiar model of a self-contained HTML file containing application logic and application data, with the ability to save changes in most browsers |Low: you just need a browser |
|ExplodedFolder |An extension of TiddlyWiki's classic model that explodes the single file into its constituent parts as separate files |Low: you just need a browser |
|LocalHelperApp |Running TiddlyWiki5 as a node.js helper application on your PC |Medium: you need to install node.js, and run a batch file |
|PrivateServerApp |Running TiddlyWiki5 as a node.js application on a cloud server |High: you need to understand how to install and maintain software on a server |
|Component |Using TiddlyWiki5's representation transformation engine and user interface layer as components in a larger system |Very High: you need to be a reasonably experienced software developer |
|CustomBrowser |Building a custom web browser around TiddlyWiki to let it work optimally on a particular platform |Very High: you need to be a pretty experienced software developer |
!SelfContained Configuration
This is the familiar form of TiddlyWiki: a single HTML file that runs in the browser containing both the application logic and your data. On many browsers you can edit your content and save your changes without any special add-ins. Even without the ability to save changes, this configuration offers compelling advantages as a content distribution medium by allowing you distribute a fully interactive web experience with just a dumb, reliable static web server.
The SelfContained configuration performs well on the web. By packing all the required JavaScript, CSS and HTML into a single file we avoid the latency that comes from traditional websites bringing in external resources as they load in the browser.
!ExplodedFolder Configuration
This form lays out your data and the components of TiddlyWiki as separate files:
{{{
folder/
index.html
tiddlywiki.js
content/
MyTiddler1.tid
MyTiddler2.jpg
MyTiddler3.svg
}}}
You can just open the `index.html` in the browser. The content tiddlers are lazily loaded as required, with the HTML file acting as a literal index, listing the titles and other metadata about each tiddler. In some browsers you will be able to make changes to the data through the browser too.
The key advantage of this configuration is that it plays well with existing desktop PC file tools, including source code control systems like Git and Subversion.
!LocalHelperApp Configuration
This configuration uses node.js to enable TiddlyWiki5 to run as a local web server. This means that you interact with it from your browser, typically going to a URL like `127.0.0.1:8080`.
On most operating systems, installing node.js is a single step operation - see http://nodejs.org/ for details. Once installed, running TiddlyWiki requires a simple command line that you can type in the terminal or assign to a shortcut:
{{{
node tiddlywiki myfolder/index.html
}}}
In this configuration, TiddlyWiki5 can store data in either a single SelfContained file, or in the ExplodedFolder layout.
!PrivateServerApp Configuration
TiddlyWiki5 can also be run under node.js on an Internet server hosted by a cloud provider such as Amazon or Joyent. In this configuration, your data is stored on a private computer in the cloud, and you access it securely using a browser. In this way you will be able to access your data from any device, including mobile devices.
!Component Configuration
Although TiddlyWiki5 can work as an HTTP server, it is not designed for large, high traffic installations. Instead, the representation transformation engine at the heart of TiddlyWiki5 can be used as a component within more elaborate HTTP servers to enable them to offer TiddlyWiki's flexible WikiText features.
Work is underway to use TiddlyWiki5 within TiddlyWeb and TiddlySpace:
https://github.com/cdent/tw5ikifier
!CustomBrowser Configuration
Many mobile platforms lack direct support in the browser to enable TiddlyWiki to save changes locally. One way around this is to use an online flavour of TiddlyWiki. A relatively straightforward option on many platforms is to write a custom application that embeds TiddlyWiki within a web browser control. For example, see these applications that work in this way with classic TiddlyWiki on iOS and Android:
* [[AndTidWiki|https://market.android.com/details?id=de.mgsimon.android.andtidwiki]] for Android Devices
* [[TWMobile|http://itunes.apple.com/gb/app/twmobile/id381945222?mt=8]] for iPad
* [[TWEdit|http://itunes.apple.com/gb/app/twedit/id409607956?mt=8]] for iPhone, iPad and iPod Touch
* [[tiddlyNotes|http://itunes.apple.com/us/app/tiddlynotes-lite/id465933435?mt=8]] for iPhone, iPad and iPod Touch