How to install plugins using a Node.js setup

I have colouring for javascript. when the tiddler is “idle” but not when I edet it. I’ve installed $:/plugins/tiddlywiki/highlight

And what I’m asking is syntax coloration for tw5 contents.

So I halt my server (I’m running tw on node.js)’ edit my tiddlywiki.info file to include codemirror :slight_smile:

{
    "description": "Basic client-server edition",
    "languages" : [
        "fr-FR"
    ],
    "plugins": [
        "tiddlywiki/tiddlyweb",
        "tiddlywiki/filesystem",
        "tiddlywiki/highlight",
        "tiddlywiki/codemirror"
    ],
    "themes": [
        "tiddlywiki/vanilla",
        "tiddlywiki/snowwhite"
    ],
    "build": {
        "index": [
            "--rendertiddler",
            "$:/plugins/tiddlywiki/tiddlyweb/save/offline",
            "index.html",
            "text/plain"
        ],
        "static": [
            "--rendertiddler",
            "$:/core/templates/static.template.html",
            "static.html",
            "text/plain",
            "--rendertiddler",
            "$:/core/templates/alltiddlers.template.html",
            "alltiddlers.html",
            "text/plain",
            "--rendertiddlers",
            "[!is[system]]",
            "$:/core/templates/static.tiddler.html",
            "static",
            "text/plain",
            "--rendertiddler",
            "$:/core/templates/static.template.css",
            "static/static.css",
            "text/plain"
        ]
    }
}

And after that I restart the server and update the browser. I can see code mirror plugin installed. But no new coloring functionality! Where am I wrong?

BTW what is this “static” array in the json?

1 Like

An update about my problem with code mirror. The codemirror plugin is functional. I know because I can have the line numbers shown while editing. My problem is it doesn’t provide any syntax while editing (be it js, tw5 or css).

Do you also have CodeMirror Mode JavaScript $:/plugins/tiddlywiki/codemirror-mode-javascript installed ?
That is the actual highlighter, sort of a plugin of plugin.
If you don’t than you could try that.
Otherwise I wouldn’t know how to solve you’re problem. Best of luck!

Thank you for your code-mirror help, @trend ! I now have syntax coloration for javascript. Great indeed!

I have inserted other sub-plugins now.

@TW_Tones I have a problem installing the EditButtons plugins. Note that I work exclusively with the node.js server edition.

What I did : I modified fy tiddlywiki.ifo file thus:

    "plugins": [
        "telmiger/EditButtons",
        "tiddlywiki/tiddlyweb",

What I got:

Warning: Cannot find plugin ‘telmiger/EditButtons’

I can’t find the source for EditButtons to try a local install.

https://tid.li/tw5/plugins.html

I use it on single file, source from the above link and on TW 5.2.3, Windows 11, Chrome Browser.

1 Like

have a closer look at the docs. Environment vars

https://tiddlywiki.com/#Plugins:Plugins%20[[Installing%20custom%20plugins%20on%20Node.js]]%20[[Environment%20Variables%20on%20Node.js]]

I read that doc. Quite frankly, it is not fit for server stuff. There lack some real life example not triviality or otherwise assuming a familiarity with something that is not familiar for me and I can’t see what I did wrong.

I can’t propose a better wording for the doc yet, because I don’t know what I am trying to discover in the doc. I just know there is problem with these for me as they currently are.

I empathise, I have experienced this a few times, I think sometimes we need a Dev to work with a user to realise what needs to be in the documentation.

I did introduce a whole video series that uses this exact elements of the docs. May be this will help you out more. The videos start with file based plugins and the core plugin library. In the middle of the series it starts to use a node based system.

The series doesn’t explain the solution of the problem you posted, but the examples should be close enough to give you the info to solve the problem.

@jypre … I did move these posts to this new thread, to start it’s own discussion.

1 Like

But which/where are those thread? I can’t find them even on a regular PC.

1 Like

This is the new thread that has been created by moving these posts out of the discussion Elephant in the room - #31

@Mario perhaps rephrase the moderator message along the lines of “I moved the above posts here to create this new thread”.

The footer of the first post contains the backlink to the original thread:

Am I dumb? I am LOST at finding what is new, what is old and can’t tell where I am if I follow the link. And the subjects seem not to have been changed. Too confused I am!

So I left these topics now. Anyway, they will make progress of their own with less challenged users.

@pmario I looked at your videos. I’m not sure this is a good format for technical stuff such as CLI and configuration files problems. But that’s another story.

So OK for the environment variables, I got the references about them in the official docs clear. If I understand correctly, I don’t need them if I put my plugins in the plagins directory at the root of the wiki (same level as tiddlyiwiki.info).

The problems I have is where and how to get that plugin files for third party plugin in some cases.

The case I was looking for is EditButtons by telminger. I can’t see a repository where to fetch those files. I found tid.li Plugins — A TiddlyWiki Plugin Source where it is installed.

I drag and drop it to my wiki, and I saw it installed two files:

 syncer-server-filesystem: Dispatching 'save' task: $:/Import 
 syncer-server-filesystem: Dispatching 'save' task: $:/plugins/telmiger/EditButtons 

I know this s not what is needed, but here I’m only tryng to get the plugin files! I stopped my server. I moved the stuff I got to the root of my wiki (named eva):

mv eva/tiddlers/_system/plugins/ eva

and then I restart the server. I got 3 warnings:

Warning: Cannot find plugin 'telmiger/EditButtons'
Warning: missing plugin.info file in /usr/share/tiddlywiki/proteva-wiki/eva/plugins/telmiger
Warning: missing plugin.info file in /usr/share/tiddlywiki/proteva-wiki/eva/plugins/tiddlywiki
 syncer-server-filesystem: Dispatching 'save' task: $:/StoryList 
Serving on http://0.0.0.0:8080
(press ctrl-C to exit)

Apparently I have not got the plugin.info file. Here’s what I got:

$ ls -la eva/plugins/telmiger/
total 28
drwxr-xr-x 2 jnpr jnpr  4096 Oct 18 13:29 .
drwxr-xr-x 4 jnpr jnpr  4096 Oct 18 13:29 ..
-rw-r--r-- 1 jnpr jnpr 15750 Oct 18 13:29 editbuttons.json
-rw-r--r-- 1 jnpr jnpr   332 Oct 18 13:29 editbuttons.json.meta
$

Any idea for this specific case?

The plugins from “telminger” are at GitHub GitHub - rimi/tw5-telmiger-plugins

If you clone the whole repo and use the Environment variable setup, it would be possible to include his plugins using the tiddlywiki.info file.

I’m sorry I don’t have the time to set up a debugging environment to replicate your problems and fix them step by step.

If you start at video 1 and work along on your own system you will see how it all works together. Picking video No x and start from there doesn’t make too much sense, since some info provided by an earlier video may be missing.

I did have a look at my videos and the info you need to get it going is there. From my point of view you didn’t take the time to stop the video “work along” with your own setup.

@pmario Thank you for the github of telminger. I should have known better.

As for your videos, I did have watched several of them when I posted my previous message, but I mostly saw what I knew, and I’m not under windows so it was not that simple to have a direct application. So I have my tried.

And after your post, I got back digging what I saw as my main problem: setting that environment variable. It’s simple under linux. But it fact I was not simply under linux. I was using podman (an alternative to docker) under linux. It turn out it was very simple indeed. I already had done that in my Dockerfile. But what I did not know was what really was “tini” that I use as en entry point (in an alpine linux docker launched). It was not a shell, I had to launch a shell to see them. But it was not the real problem. I was still having complaint about not having plugin.info file.

But I kept trying and I finally found out a way tohave the EditButtons plugin running. I put the EditButtons directory directly ander the plugins directory of the wiki directory and make no mention of EditButtons in my tiddlywiki.info files.

Maybe I should have understood that from the beginning, but the fact is that I have not.

Anyway all of you helped me and that help helped me helping myself. I shall try to work out the solution for a solution requiring mention in tiddlywiki.info file but for the sake of it, because I have a dockerfile per project. That’s simpler for me.

OK – I see. … That’s a more advanced setup and you are right having windows as a reverence here is an extra “abstraction”. … not to name it “distraction” :wink:

Nice that you figured it out.
have fun!
-mario

@pmario Yes I’m glad I eventually found a way to do it. Your help if it did not provide me the direct solution gave me the will to dig further, and by telling what I did each time, it also help me going forwards.

We recommend install plugin using plugin-library, for example https://tw-cpl.netlify.app/

In this way, new users don’t need to know about JSON or .info file, just click buttons.

Old user may know these, but when recommending a way to install plugin in nodejs setup, we should still recommend click button to install plugin in plugin library, like how Obsidian does.