Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
This is the very barebones beginnings of a demo implementation of an alternate tiddler store. It is not functional. If using the Vercel builds, open developer tools in the browser to see it failing due to the absence of basic wiki methods.

The plan is to build it up into the smallest possible plain JS wiki store implementation, sharing as much implementation as possible with the existing core implementation with as little code duplication as possible. It could then serve as the basis for future experiments with wiki stores based on SQLite (@linonetwo), or a custom append only database (@yaisog).
  • Loading branch information
Jermolene committed Mar 4, 2023
1 parent f343198 commit fdec12f
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 9 deletions.
14 changes: 7 additions & 7 deletions boot/boot.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion editions/prerelease/tiddlywiki.info
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"tiddlywiki/dynannotate",
"tiddlywiki/codemirror",
"tiddlywiki/menubar",
"tiddlywiki/jszip"
"tiddlywiki/jszip",
"tiddlywiki/demo-alternate-store"
],
"themes": [
"tiddlywiki/vanilla",
Expand Down
3 changes: 2 additions & 1 deletion editions/tw5.com/tiddlywiki.info
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"tiddlywiki/railroad",
"tiddlywiki/evernote",
"tiddlywiki/internals",
"tiddlywiki/menubar"
"tiddlywiki/menubar",
"tiddlywiki/demo-alternate-store"
],
"themes": [
"tiddlywiki/vanilla",
Expand Down
6 changes: 6 additions & 0 deletions plugins/tiddlywiki/demo-alternate-store/plugin.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/demo-alternate-store",
"name": "Demo alternate store",
"description": "Developer demo of an alternate wiki store implementation",
"list": "readme"
}
22 changes: 22 additions & 0 deletions plugins/tiddlywiki/demo-alternate-store/rawmarkup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*\
title: $:/plugins/tiddlywiki/demo-alternate-store/rawmarkup.js
type: application/javascript
module-type: library
Startup code injected as raw markup
\*/

(function() {

// Need to initialise these because we run before bootprefix.js and boot.js
$tw = window.$tw || Object.create(null);

This comment has been minimized.

Copy link
@linonetwo

linonetwo Mar 5, 2023

Contributor

Do we need to prepare a class instance that extends the core $tw? Otherwise some $tw.utils will be unavailable.

This comment has been minimized.

Copy link
@Jermolene

Jermolene Mar 5, 2023

Author Member

Hi @linonetwo I'm not sure what you mean. At this point neither boot.js nor boot-prefix.js has been executed, so at this point none of the utilities will be available. They will be available by the time the wiki object is instantiated, though.

$tw.hooks = $tw.hooks || { names: {}};
$tw.boot = $tw.boot || {};
$tw.boot.preloadDirty = $tw.boot.preloadDirty || [];

$tw.Wiki = function() {

};

})();
6 changes: 6 additions & 0 deletions plugins/tiddlywiki/demo-alternate-store/rawmarkup.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title: $:/plugins/tiddlywiki/demo-alternate-store/rawmarkup
tags: $:/tags/RawMarkupWikified

`<script>`
{{$:/plugins/tiddlywiki/demo-alternate-store/rawmarkup.js}}
`</script>`
3 changes: 3 additions & 0 deletions plugins/tiddlywiki/demo-alternate-store/readme.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: $:/plugins/tiddlywiki/demo-alternate-store/readme

Developer demo of an alternate wiki store implementation

0 comments on commit fdec12f

Please sign in to comment.