1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-09 03:19:56 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/concepts/DataTiddlers.tid

32 lines
815 B
Plaintext
Raw Normal View History

2013-08-29 16:49:15 +00:00
created: 201308291647
modified: 201308291647
2014-09-11 14:52:47 +00:00
tags: Concepts
2013-08-29 16:49:15 +00:00
title: DataTiddlers
2014-12-28 09:51:53 +00:00
A data tiddler is a miniature database contained within a tiddler.
2013-08-29 16:49:15 +00:00
2014-12-28 09:51:53 +00:00
There are two standard formats:
2013-08-29 16:49:15 +00:00
2014-12-28 09:51:53 +00:00
* DictionaryTiddlers
* [[JSONTiddlers]]
2013-08-29 16:49:15 +00:00
2014-12-28 09:51:53 +00:00
Other formats of tiddler can also be parsed to yield blocks of data that behave like data tiddlers.
2013-08-29 16:49:15 +00:00
2014-12-28 09:51:53 +00:00
Use a TextReference to look up a value by its name. For example, if a [[DictionaryTiddler|DictionaryTiddlers]] called `MonthDays` contains:
2013-08-29 16:49:15 +00:00
```
2014-12-28 09:51:53 +00:00
oct:31
nov:30
dec:31
2013-08-29 16:49:15 +00:00
```
2014-12-28 09:51:53 +00:00
... then `{{MonthDays##nov}}` will resolve to the value `30`.
The same is true if `MonthDays` is a [[JSONTiddler|JSONTiddlers]] with the following content:
2013-08-29 16:49:15 +00:00
```
2014-12-28 09:51:53 +00:00
{"oct":31,"nov":30,"dec":31}
2013-08-29 16:49:15 +00:00
```
2014-12-28 09:51:53 +00:00
Note: //It is currently only possible to retrieve data from the immediate properties of the root object of a JSONTiddler.//