1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00
This commit is contained in:
Mario Pietsch 2014-09-26 09:04:10 +02:00
commit a4b9032d9c
13 changed files with 91 additions and 9 deletions

View File

@ -467,6 +467,8 @@ Syncer.prototype.dispatchTask = function(task,callback) {
}; };
// Invoke the callback // Invoke the callback
callback(null); callback(null);
},{
tiddlerInfo: self.tiddlerInfo[task.title]
}); });
} else { } else {
this.logger.log(" Not Dispatching 'save' task:",task.title,"tiddler does not exist"); this.logger.log(" Not Dispatching 'save' task:",task.title,"tiddler does not exist");
@ -493,6 +495,7 @@ Syncer.prototype.dispatchTask = function(task,callback) {
if(err) { if(err) {
return callback(err); return callback(err);
} }
delete self.tiddlerInfo[task.title];
// Invoke the callback // Invoke the callback
callback(null); callback(null);
},{ },{

View File

@ -39,7 +39,7 @@ exports.httpRequest = function(options) {
// Set up the state change handler // Set up the state change handler
request.onreadystatechange = function() { request.onreadystatechange = function() {
if(this.readyState === 4) { if(this.readyState === 4) {
if(this.status === 200 || this.status === 204) { if(this.status === 200 || this.status === 201 || this.status === 204) {
// Success! // Success!
options.callback(null,this.responseText,this); options.callback(null,this.responseText,this);
return; return;

View File

@ -65,7 +65,11 @@ TranscludeWidget.prototype.execute = function() {
// Check for recursion // Check for recursion
if(parser) { if(parser) {
if(this.parentWidget && this.parentWidget.hasVariable("transclusion",recursionMarker)) { if(this.parentWidget && this.parentWidget.hasVariable("transclusion",recursionMarker)) {
parseTreeNodes = [{type: "text", text: "Recursive transclusion error in transclude widget"}]; parseTreeNodes = [{type: "element", tag: "span", attributes: {
"class": {type: "string", value: "tc-error"}
}, children: [
{type: "text", text: "Recursive transclusion error in transclude widget"}
]}];
} }
} }
// Construct the child widgets // Construct the child widgets

View File

@ -79,13 +79,14 @@ This method is optional. If an adaptor doesn't implement it then synchronisation
|!Parameter |!Description | |!Parameter |!Description |
|callback |Callback function invoked with parameter `err,tiddlers`, where `tiddlers` is an array of tiddler field objects | |callback |Callback function invoked with parameter `err,tiddlers`, where `tiddlers` is an array of tiddler field objects |
!! `saveTiddler(tiddler,callback)` !! `saveTiddler(tiddler,callback,tiddlerInfo)`
Saves a tiddler to the server. Saves a tiddler to the server.
|!Parameter |!Description | |!Parameter |!Description |
|tiddler |Tiddler to be saved | |tiddler |Tiddler to be saved |
|callback |Callback function invoked with parameter `err,adaptorInfo,revision` | |callback |Callback function invoked with parameter `err,adaptorInfo,revision` |
|tiddlerInfo |The tiddlerInfo maintained by the syncer for this tiddler |
!! `loadTiddler(title,callback)` !! `loadTiddler(title,callback)`

View File

@ -63,3 +63,14 @@ For more flexibility the KaTeX widget can also be used via the full widget synta
``` ```
<$latex text="\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi"></$latex> <$latex text="\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi"></$latex>
! Error Handling
An warning message is displayed if KaTeX detects a problem with the ~LaTeX syntax. For example:
```
$$\displaystyle f(x) = \int_{-\infty}^\infinity\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi$$
```
$$\displaystyle f(x) = \int_{-\infty}^\infinity\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi$$

View File

@ -5,7 +5,7 @@ title: Some of the things you can do with TiddlyWiki
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
* Take notes, and use tags and hyperlinking to form relationships between your notes * Take notes, and use tags and hyperlinking to form relationships between your notes
* Use tabs, tables, tag-based lists, and tables of contents to get organzed * Use tabs, tables, tag-based lists, and tables of contents to get organised
* Bookmark your favorite websites (see an example at http://giffmex.org/experiments/tidmarks.html) * Bookmark your favorite websites (see an example at http://giffmex.org/experiments/tidmarks.html)
* Keep track of tasks and appointments, and organise them by multiple tags (see our TaskManagementExample) * Keep track of tasks and appointments, and organise them by multiple tags (see our TaskManagementExample)
* Inventory just about anything: your recipes, personal library, contacts, music collection, and more * Inventory just about anything: your recipes, personal library, contacts, music collection, and more

View File

@ -1,5 +1,5 @@
created: 20140908114400000 created: 20140908114400000
modified: 20140916141919329 modified: 20140923141919329
tags: About tags: About
title: History of TiddlyWiki title: History of TiddlyWiki
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -56,3 +56,10 @@ Our approach was to focus on showing rather than telling. We worked with the Tid
By the end of 2011 I was increasingly feeling that I would be better placed to realise the potential of TiddlyWiki outside of the corporate confines BT. Accordingly, I left and started work as an independent developer, primarily working on a brand new reboot of TiddlyWiki in the shape of TiddlyWiki5. By the end of 2011 I was increasingly feeling that I would be better placed to realise the potential of TiddlyWiki outside of the corporate confines BT. Accordingly, I left and started work as an independent developer, primarily working on a brand new reboot of TiddlyWiki in the shape of TiddlyWiki5.
! Development of TiddlyWiki5
I worked on new release of TiddlyWiki from November 2011. As a programmer, working on "version 2.0" of something that I had already written is a very attractive proposition. It means that the requirements were fully understood, allowing me to focus on evolving the architecture needed to support the desired functionality.
! The Future
Now that TiddlyWiki5 has finally left "beta" status behind, my hope is that it will have a long life. Because it only uses standard features of HTML5 and Node.js, there is no reason why it cannot be fully operational for many years to come. My goal is for it last for at least 25 years.

View File

@ -0,0 +1,12 @@
created: 20140924115616653
modified: 20140924115627781
tags: Filters
title: FilterOperator: fields
type: text/vnd.tiddlywiki
The ''fields'' filter operator returns the names of all the fields used in the currently selected tiddlers.
|!Filter String |!Description |
|`[[HelloThere]fields[]]` |Returns the fields present in the tiddler `HelloThere` |
|`[tag[myTag]fields[]]` |Returns the aggregate of all the fields present on tiddlers that have the tag `myTag` |

View File

@ -8,7 +8,7 @@ type: text/vnd.tiddlywiki
The following plugins are distributed on tiddlywiki.com as part of the main TiddlyWiki distribution. The following plugins are distributed on tiddlywiki.com as part of the main TiddlyWiki distribution.
<list-links "[tag[Plugins]]">> <<list-links "[tag[Plugins]]">>
! What is a plugin? ! What is a plugin?

View File

@ -1,9 +1,9 @@
caption: Lists
created: 20131205160257619 created: 20131205160257619
modified: 20131206154613715 modified: 20140924112303029
tags: WikiText tags: WikiText
title: Lists in WikiText title: Lists in WikiText
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
caption: Lists
! Unordered Lists ! Unordered Lists
@ -52,3 +52,31 @@ Note that [[Block Quotes in WikiText]] can be mixed with lists. For example:
**> Another quote **> Another quote
* List Three * List Three
">> ">>
! Paragraphs in Lists
Entries in the list are delimited with a linebreak, making it impossible to include linebreaks within a list entry. There are a couple of workarounds.
First, you can transclude paragraph content from another tiddler. For example:
```
* First entry
* <$transclude tiddler="MyTiddler" mode="block"/>
* Third entry
```
Secondly, you can use an HTML "div" element to contain the multiline content. For example:
```
# Step 1
# Step 2
# Step 3<div>
Here is the first of several paragraphs. Note that the double linebreak preceding this paragraph is significant.
And here is the second of several paragraphs.
</div>
# Step 4
# Step 5
# Step 6
```

View File

@ -170,3 +170,5 @@ Eucaly J, @Eucaly, 2014/09/14
Mal Gamble, @malgam, 2014/09/19 Mal Gamble, @malgam, 2014/09/19
Ton Gerner, @gernert, 2014/09/19 Ton Gerner, @gernert, 2014/09/19
Julie Bertrand, @Evolena, 2014/09/22

View File

@ -36,7 +36,12 @@ KaTeXWidget.prototype.render = function(parent,nextSibling) {
var text = this.getAttribute("text",this.parseTreeNode.text || ""); var text = this.getAttribute("text",this.parseTreeNode.text || "");
// Render it into a span // Render it into a span
var span = this.document.createElement("span"); var span = this.document.createElement("span");
try {
katex.render(text,span); katex.render(text,span);
} catch(ex) {
span.className = "tc-error";
span.textContent = ex;
}
// Insert it into the DOM // Insert it into the DOM
parent.insertBefore(span,nextSibling); parent.insertBefore(span,nextSibling);
this.domNodes.push(span); this.domNodes.push(span);

View File

@ -1447,3 +1447,12 @@ body.tc-dirty span.tc-dirty-indicator, body.tc-dirty span.tc-dirty-indicator svg
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
} }
/*
** Errors
*/
.tc-error {
background: #f00;
color: #fff;
}