Installing the plugins on an existing TW

Hey Danielo,

On the noteself.github.io page I clicked the link at the bottom for: installing the plugin which goes to:

https://noteself.github.io/#%24%3A%2Fplugins%2Fdanielo515%2Ftiddlypouch%2FInstallation

which does not exist.

I have a current node TW in my dropbox, and I am interested in using noteself to setup revisions.

Thanks!
Diego

Hello @diego898, welcome to NoteSelf community.

Please note that we only officially support using the plugins related to NoteSelf (tiddlypouch for example) on the NS editions that already exists. Installing and configured the separate plugins on an existing TW is considered a task for advanced users.

That said, if you want to try it out the plugins you will need are: tiddlypouch and pouchdb plugin. Both are available at the online edition of NoteSelf, so you can pick them from there.
Note also that TiddlyPouch is a sync mechanism, so it may not work with your saving to Dropbox saver, but I’m unsure about this.

Regards

When I dragged noteself over to a fresh node wiki (outside of dropbox) to install the plugins, refreshing the wiki brings up an error about an undefiend TWPouch

Here is the error:

Could you also post the console output? Also would be useful if you tell me wich plugins have you installed exactly, Noteself is not a plugin.

Regards

I drag over the empty noteself.html file into my empty node TW and import the following two plugins:

After restarting, the console says:

Ok, just what I was guessing. That is some kind of chicken-egg problem. TiddlyPouch needs to inject some code at the head section of your tiddlywiki file. However, in order to do this the plugin needs to exist on TiddlyWiki before you save it, but you can not save the wiki with the plugin already installed because it won’t boot up. Let me make this clear, the ideal steps in order to this to work would be:

  1. Install TiddlyPouch plugin, and save
  2. Open TW with the plugin already installed an save again
  3. Enjoy

However the step 2 can never happen because the error does not allow TW to boot. This is a know issue with tiddlywiki, and buggyj (a TW plugin creator) made some code changes to fix it: https://github.com/Jermolene/TiddlyWiki5/issues/2159
However there is no pull request and the code has not been merged yet into core, so the problem persist.

Here is what you can try:

  1. take the 4 files listed here: https://github.com/buggyj/TiddlyWiki5/commit/91a2afd2495122a534f9e6066e7e7272e83ca119
  2. Import them to your TW, save and reload
  3. Try to install tiddly-pouch again

At some point I think I’ll include those 4 files on the offline edition of NoteSelf, so they come for free with the full file import. However, there are a lot of things I have to fix and improve before that.

Regards

Hey @danielo515,

Im not exactly sure what happened, but I went ahead and installed couchdb and pouchdb from their website and npm, loaded up my test wiki and it now works. I can use it locally, and after installing:

npm install -g couchdb-dump

I can now export my database like this:

cdbdump -d myDataBase > ~/Desktop/myfile.json

The only surprising thing, is that now new tiddlers I create no longer create .tid files (this is a node version of TW). They exist, but only in the database as opposed to .tid. files. This would normally be fine, but I use scripts to create .tid files automatically in response to certain events.

I guess with this new workflow, I’d have to:

  1. Create a new node TW version
  2. Install your plugins by dropping over an empty noteself and importing them
  3. Intstalling couchdb and pouchdb
  4. Launch local working version of TW

I guess I also have to change my scripts to instead of creating .tid files, creating a .json string Id insert into the db manually?

Hello @diego898

Glad to hear that it is working now fine for you.

Well, I think that I know what have happened. The instructions I gave you were for an standalone edition of tiddlywiki because, well, I thought you were using a single html file.
What have happened is that you have restarted your server, and that is the equivalent of saving the TW standalone twice. You gave TPouch the opportunity to inject the required code on the head of the page, and that is why it now works.

This is what I warn you about. TPouch is a sync adaptor. The current mechanism of tiddlywiki only accepts one single sync-adaptor, and the one with the highest precedence or the one added the last wins, in this case it is the pouchadaptor. So even knowing that you have the filesystem sync adaptor and that you are running a node TW version, the pouchadaptor still wins an gets the monopoly of handling tiddlers.

Not necessary. Yes, new tiddlers will be saved to the database, but that does not mean that you can not load .tid files on startup. When you start your node edition of TW it will load all the tid files inside the tiddlers directory. Then, when you edit and save them on tiddlywiki new versions will be saved to the database. So you can understand your physical tid files as the first version and new revisions will be stored to the database.
There is nothing wrong with injecting JSON tiddlers on the database tough, they will be loaded fine too.

Regards

danielo,

One thought that struck me is would it be practical to edit a tiddlywiki file in a good editor such as NotePad++ and insert the TiddlyPouch code at the head section of the tiddlywiki file rather than depend on the injection.

I edit tiddlywiki files when I cause fatal errors hacking tiddlywiki. Mostly to edit a tiddler I cant open for edit, or remove tags causing a failure.

Regards
Tony

Hello @Tony

That may work for people using a traditional TW or an offline file of NoteSelf. However, you can not change the HTML of the online edition neither the node-js one, which is what @diego898 is using.
But you gave me an idea, I could create a tool for emergency situations that could bring you access to your databases, allowing you to erase some of them in case of need. Such tool could be accessed in the same way as any other NS edition, so you will have access to the same data and set of databases.

@danielo515 I tried your suggested solution (implementing buggyj’s fix, save/reload, then import TP), and I’m getting the same $TPouch not defined error. I did some trouble shooting and it looks like after importing tiddlypouch into a new TW the plugin filter will return a list of included tiddlers, but the subsequent tag filter does work because those included tiddlers aren’t “really” in the tiddler store yet.

When I just run the
[plugin[$:/plugins/danielo515/tiddlypouch]tag[$:/tags/RawMarkup]]
filter through the Advanced Search i get no results. When I run
[plugin[$:/plugins/danielo515/tiddlypouch]]
I get a list of all the included tiddlers, however most of them (including the boot.js tiddler) are Missing. If I click on any of them i get the Missing tiddler card.

Any ideas?