2014-09-12 15:05:37 +00:00
created: 20130825150000000
2015-02-16 17:27:49 +00:00
modified: 20150216171751154
2014-09-12 15:05:37 +00:00
tags: [[TiddlyWiki on Node.js]]
2013-08-25 20:22:11 +00:00
title: TiddlerFiles
2014-09-12 15:05:37 +00:00
type: text/vnd.tiddlywiki
2012-04-30 11:23:03 +00:00
Tiddlers can be stored in text files in several different formats. Files containing single tiddlers can also have an auxiliary `.meta` file formatted as a sequence of name:value pairs:
2012-06-04 11:25:54 +00:00
2013-03-04 18:04:26 +00:00
```
2012-04-30 11:23:03 +00:00
title: TheTitle
modifier: someone
2013-03-04 18:04:26 +00:00
```
2012-06-04 11:25:54 +00:00
2012-04-30 11:23:03 +00:00
!! ~TiddlyWeb-style .tid files
These files consist of a sequence of lines containing name:value pairs, a blank line and then the text of the tiddler. For example:
2012-06-04 11:25:54 +00:00
2013-03-04 18:04:26 +00:00
```
2012-04-30 11:23:03 +00:00
title: MyTiddler
modifier: Jeremy
This is the text of my tiddler.
2013-03-04 18:04:26 +00:00
```
2012-06-04 11:25:54 +00:00
2014-05-13 09:27:03 +00:00
Note that many text editors require that files include a terminating newline. If you want to avoid including the terminating newline in the text of the tiddler you can use this alternative syntax:
```
title: MyTiddler
modifier: Jeremy
text: This is the text of my tiddler.
```
2012-06-10 16:48:23 +00:00
//The ContentType `application/x-tiddler` is used internally for these files//
2012-06-04 11:25:54 +00:00
2012-04-30 11:23:03 +00:00
!! TiddlyWiki `<DIV>` .tiddler files
2015-02-12 12:56:26 +00:00
In TiddlyWiki 5, `*.tiddler` files look like this:
2012-06-04 11:25:54 +00:00
2013-03-04 18:04:26 +00:00
```
2012-04-30 11:23:03 +00:00
<div title="AnotherExampleStyleSheet" modifier="blaine" created="201102111106" modified="201102111310" tags="examples" creator="psd">
<pre>Note that there is an embedded <pre> tag, and line feeds are not escaped.
2014-05-13 09:27:03 +00:00
2012-04-30 11:23:03 +00:00
And, weirdly, there is no HTML encoding of the body.</pre>
</div>
2013-03-04 18:04:26 +00:00
```
2012-06-04 11:25:54 +00:00
2015-02-12 12:56:26 +00:00
These `*.tiddler` files are not exactly the same as the tiddlers inside a TiddlyWiki HTML file where they are HTML encoded.
2012-04-30 11:23:03 +00:00
Older `*.tiddler` files more closely matched the store format used by TiddlyWiki at the time:
2012-06-04 11:25:54 +00:00
2013-03-04 18:04:26 +00:00
```
2012-04-30 11:23:03 +00:00
<div tiddler="AnotherExampleStyleSheet" modifier="JeremyRuston" modified="200508181432" created="200508181432" tags="examples">This is an old-school .tiddler file, without an embedded <pre> tag.\nNote how the body is "HTML encoded" and new lines are escaped to \\n</div>
2013-03-04 18:04:26 +00:00
```
2012-06-04 11:25:54 +00:00
2012-06-10 16:48:23 +00:00
//The ContentType `application/x-tiddler-html-div` is used internally for these files//
2012-06-04 11:25:54 +00:00
2012-04-30 11:23:03 +00:00
!! ~TiddlyWeb-style JSON files
2015-02-16 17:27:49 +00:00
These files are a straightforward array of hashmaps of `name:value` properties. All field values must be specified as strings.
For example:
```
[
{
"title": "First Tiddler",
"text": "Text of first tiddler",
"tags": "one two [[t h r e e]]"
},{
"title": "Second Tiddler",
"text": "Text of second tiddler",
"modified": "20150216171751154"
}
]
```
2012-04-30 11:23:03 +00:00
2012-06-10 16:48:23 +00:00
//The ContentType `application/json` is used internally for these files//
2012-06-04 11:25:54 +00:00
2012-04-30 11:23:03 +00:00
!! TiddlyWiki HTML files
TiddlyWiki HTML files contain a collection of tiddlers encoded in `<DIV>` format.
2014-10-18 16:42:22 +00:00
2015-02-12 12:56:26 +00:00
For TiddlyWiki to import an unencrypted HTML file, it requires a `<div id="storeArea">` containing tiddler DIVs as explained above. For example:
2014-10-18 16:42:22 +00:00
```
<div id="storeArea">
<div created="20130302085406905" modified="20130302084548184" tags="Examples" title="A tiddler title">
<pre>HTML encoded text of tiddler
</pre>
</div>
<div created="20140315085406905" modified="20140321084548184" tags="One Two [[Three with Space]]" title="Another title" customfield="field value">
<pre>Text of this tiddler
</pre>
</div>
2015-02-12 12:56:26 +00:00
</div>
2014-10-18 16:42:22 +00:00
```