mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-09-01 10:28:03 +00:00
Experimental plugin for Tahoe-LAFS
This commit is contained in:
3
editions/tahoelafs/tiddlers/DefaultTiddlers.tid
Normal file
3
editions/tahoelafs/tiddlers/DefaultTiddlers.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/DefaultTiddlers
|
||||
|
||||
HelloThere
|
6
editions/tahoelafs/tiddlers/HelloThere.tid
Normal file
6
editions/tahoelafs/tiddlers/HelloThere.tid
Normal file
@@ -0,0 +1,6 @@
|
||||
title: HelloThere
|
||||
|
||||
This is an experimental edition of TiddlyWiki5 for use with [[Tahoe-LAFS|https://tahoe-lafs.org/]]. At this point it is largely for experimentation by @zooko. Click the ''save changes'' button to PUT the updated TiddlyWiki HTML file back to the server.
|
||||
|
||||
<$button message="tw-new-tiddler" class="btn btn-mini btn-success">New Tiddler</$button>
|
||||
<$button message="tw-save-wiki" class="btn btn-mini btn-primary">Save Changes</$button>
|
4
editions/tahoelafs/tiddlers/SiteSubtitle.tid
Normal file
4
editions/tahoelafs/tiddlers/SiteSubtitle.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: SiteSubtitle
|
||||
modifier: JeremyRuston
|
||||
|
||||
Tahoe-LAFS edition
|
4
editions/tahoelafs/tiddlers/SiteTitle.tid
Normal file
4
editions/tahoelafs/tiddlers/SiteTitle.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: SiteTitle
|
||||
modifier: JeremyRuston
|
||||
|
||||
TiddlyWiki5
|
47
editions/tahoelafs/tiddlers/tests/test-wikitext.js
Normal file
47
editions/tahoelafs/tiddlers/tests/test-wikitext.js
Normal file
@@ -0,0 +1,47 @@
|
||||
/*\
|
||||
title: test-wikitext.js
|
||||
type: application/javascript
|
||||
tags: [[$:/tags/test-spec]]
|
||||
|
||||
Tests the wikitext rendering pipeline end-to-end. We also need tests that individually test parsers, rendertreenodes etc., but this gets us started.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
describe("WikiText tests", function() {
|
||||
|
||||
// Create a wiki
|
||||
var wiki = new $tw.Wiki();
|
||||
// Add a couple of tiddlers
|
||||
wiki.addTiddler({title: "TiddlerOne", text: "The quick brown fox"});
|
||||
wiki.addTiddler({title: "TiddlerTwo", text: "The rain in Spain\nfalls mainly on the plain"});
|
||||
wiki.addTiddler({title: "TiddlerThree", text: "The speed of sound\n\nThe light of speed"});
|
||||
|
||||
it("should render tiddlers with no special markup render as-is", function() {
|
||||
expect(wiki.renderTiddler("text/plain","TiddlerOne")).toBe("The quick brown fox");
|
||||
});
|
||||
it("should preserve single new lines", function() {
|
||||
expect(wiki.renderTiddler("text/plain","TiddlerTwo")).toBe("The rain in Spain\nfalls mainly on the plain");
|
||||
});
|
||||
it("should use double new lines to create paragraphs", function() {
|
||||
// The paragraphs are lost in the conversion to plain text
|
||||
expect(wiki.renderTiddler("text/plain","TiddlerThree")).toBe("The speed of soundThe light of speed");
|
||||
});
|
||||
|
||||
it("should render plain text tiddlers as a paragraph", function() {
|
||||
expect(wiki.renderTiddler("text/html","TiddlerOne")).toBe("<p>\nThe quick brown fox</p>");
|
||||
});
|
||||
it("should preserve single new lines", function() {
|
||||
expect(wiki.renderTiddler("text/html","TiddlerTwo")).toBe("<p>\nThe rain in Spain\nfalls mainly on the plain</p>");
|
||||
});
|
||||
it("should use double new lines to create paragraphs", function() {
|
||||
expect(wiki.renderTiddler("text/html","TiddlerThree")).toBe("<p>\nThe speed of sound</p><p>\nThe light of speed</p>");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})();
|
5
editions/tahoelafs/tiddlywiki.info
Normal file
5
editions/tahoelafs/tiddlywiki.info
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
"tiddlywiki/tahoelafs"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user