Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support plugin installation somehow #8

Open
simonw opened this issue Dec 23, 2021 · 3 comments
Open

Support plugin installation somehow #8

simonw opened this issue Dec 23, 2021 · 3 comments
Labels
help wanted Extra attention is needed research

Comments

@simonw
Copy link
Owner

simonw commented Dec 23, 2021

https://twitter.com/btbytes/status/1474138481324666891

This is sweeet! Since this is a "client-server" configuration, do you know where to find the tiddlywiki.info file for installing plugins etc? https://tiddlywiki.com/#Installing%20a%20plugin%20from%20the%20plugin%20library

Not sure how to approach this one. The tiddlywiki.info mechanism is part of the Node.js server, and I've not figured out how it works - I have a hunch that it's executing JavaScript from TiddlyWiki core though, which isn't an option for my Python code.

@simonw simonw added help wanted Extra attention is needed research labels Dec 23, 2021
@simonw
Copy link
Owner Author

simonw commented Dec 23, 2021

I'm using essentially the same approach as rsc/tiddly which says this in the README: https://github.com/rsc/tiddly#tiddlywiki-base-image

The TiddlyWiki code is stored in and served from index.html, which (as you can see by clicking on the Tools tab) is TiddlyWiki version 5.1.21.

Plugins must be pre-baked into the TiddlyWiki file, not stored on the server as lazily loaded Tiddlers. The index.html in this directory is 5.1.21 with the TiddlyWeb and Markdown plugins added. The TiddlyWeb plugin is required, so that index.html talks back to the server for content.

So one way to do this would be to support a custom tiddlywiki.html file which the user can create by following the instructions on that page. It's not very slick though.

@Jermolene
Copy link

Not sure how to approach this one. The tiddlywiki.info mechanism is part of the Node.js server, and I've not figured out how it works - I have a hunch that it's executing JavaScript from TiddlyWiki core though, which isn't an option for my Python code.

That's right, the tiddlywiki.info file is part of the wiki folder format, which is how TiddlyWiki stores wikis as individual tiddler files (docs), and so doesn't apply here.

I think the options are:

  1. Bake the required plugins into the TiddlyWiki HTML file template
  2. Splice the plugins into the template when the page is served (presumably along with all the other tiddlers)
  3. Use a preloader script that loads all the tiddlers from the server using the tiddlers.json route before booting into TidlyWiki's JavaScript.

I use a combination of the last two approaches on wikis like https://manuals.annafreud.org/ambit. The wiki files are baked into S3 a few times per day, but on startup it preloads any newer tiddlers via the tiddlers.json route.

@ludwa6
Copy link

ludwa6 commented Dec 26, 2021

I've installed Datasette app on my Mac, installed "datasette-tiddlywiki" via the built-in Plugins installer, and am eager to have it storing my TW content in SQLite!

Problem is: the app running in my browser at http://localhost:8001/-/tiddlywiki wants to access a tiddlywiki.db file... So i have created one from the "File: New empty database..." menu command, which does then enable loading a new TW instance in browser, but it appears with the two error messages below superimposed on top, preventing any interaction with the TW instance.

So i'm wondering: is this method of plugin installation from within the Datasette GUI supposed to work? I wonder, because the instructions in Readme of this repo don't address this method; they only cover installation from commandline.

I also wonder if it matters where the tiddlywiki.db file is stored; as the "New empty database..." modal defaulted to my ~/Documents folder, i put it there, but still: i wonder. ?

syncer-browser-tiddlyweb - 26th December 2021 at 12:50pm

Error retrieving skinny tiddler list: [XMLHttpRequest](http://localhost:8001/-/tiddlywiki#XMLHttpRequest) error code: 500

syncer-browser-tiddlyweb - 26th December 2021 at 12:50pm (count: 3)

Sync error while processing save of '[$:/StoryList](http://localhost:8001/-/tiddlywiki#%24%3A%2FStoryList)': [XMLHttpRequest](http://localhost:8001/-/tiddlywiki#XMLHttpRequest) error code: 500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed research
Projects
None yet
Development

No branches or pull requests

3 participants