From 53d77edd0176444ef98f111ca126eb77456c59b5 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 12 Dec 2011 09:39:43 +0000 Subject: [PATCH] Updated comments and documentation --- js/Tiddler.js | 12 ------------ js/WikiTextProcessor.js | 1 - readme.md | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/js/Tiddler.js b/js/Tiddler.js index 7492bbcfe..e831a132d 100755 --- a/js/Tiddler.js +++ b/js/Tiddler.js @@ -8,24 +8,12 @@ have a `text` field, and some of the standard fields `modified`, `modifier`, `cr Hardcoded in the system is the knowledge that the 'tags' field is a string array, and that the 'modified' and 'created' fields are dates. All other fields are strings. -Tiddler text is parsed into a tree representation. The parsing performed depends on the type of the -tiddler: wiki text tiddlers are parsed by the wikifier, JSON tiddlers are parsed by JSON.parse(), and so on. - -The parse tree representation of the tiddler is then used for general computations involving the tiddler. For -example, outbound links can be quickly extracted from a parsed tiddler. Parsing doesn't depend on external -context such as the content of other tiddlers, and so the resulting parse tree can be safely cached. - -Rendering a tiddler is the process of producing a representation of the parse tree in the required -format (typically HTML) - this is done within the context of a TiddlyWiki store object, not at the level of -individual tiddlers. - The Tiddler object exposes the following API new Tiddler(src) - create a Tiddler given a hashmap of field values or a tiddler to clone new Tiddler(src1,src2) - create a Tiddler with the union of the fields from the sources, with the rightmost taking priority Tiddler.fields - hashmap of tiddler fields, OK for read-only access -tiddler.getParseTree() - returns the parse tree for the tiddler The hashmap(s) can specify the "modified" and "created" fields as strings in YYYYMMDDHHMMSSMMM format or as JavaScript date objects. The "tags" field can be given as a JavaScript array of strings or diff --git a/js/WikiTextProcessor.js b/js/WikiTextProcessor.js index 79ff49813..6a2e308cb 100644 --- a/js/WikiTextProcessor.js +++ b/js/WikiTextProcessor.js @@ -4,7 +4,6 @@ var WikiTextRules = require("./WikiTextRules.js"), WikiTextParser = require("./WikiTextParser.js").WikiTextParser; - /* Creates a new instance of the wiki text processor with the specified options. The options are a hashmap of optional members as follows: diff --git a/readme.md b/readme.md index cad418209..df6262697 100644 --- a/readme.md +++ b/readme.md @@ -267,7 +267,7 @@ This module privately includes the following modules: #### var wikiTextProcessor = new WikiTextProcessor(options) -Creates a new instance of the wiki text processor with the specified options. The options are a hashmap of optional members as follows: +Creates a new instance of the wiki text processor with the specified options. The options are a hashmap of optional members and are planned as follows: * **enableRules:** An array of names of wiki text rules to enable. If not specified, all rules are available * **extraRules:** An array of additional rule handlers to add