Tiddlywiki5: Feature request: Create Plugin Library from other paths

Created on 9 Apr 2020  路  21Comments  路  Source: Jermolene/TiddlyWiki5

Referring to https://groups.google.com/d/msg/tiddlywiki/EMHF71bzlP0/kCyau0c5AwAJ it seems Tiddlywiki plugin library can be made only from plugins stored under:

tidllywiki/plugins folder. For example on Windows 10 if Tiddlywiki is stored in

D:\Tiddlywiki, then the plugins are in D:\Tiddlywiki\plugins\

The recommended script to make plugin library using official pluginlibrary edition

tiddlywiki mylib --init pluginlibrary

as belows

 "build": {
        "library": [
            "--makelibrary",
            "$:/UpgradeLibrary",
            "--savelibrarytiddlers",
            "$:/UpgradeLibrary",
            "[prefix[$:/]] -[[$:/plugins/tiddlywiki/upgrade]] -[[$:/plugins/tiddlywiki/translators]] -[[$:/plugins/tiddlywiki/pluginlibrary]] -[[$:/plugins/tiddlywiki/jasmine]]",
            "recipes/library/tiddlers/",
            "$:/UpgradeLibrary/List",
            "--savetiddler",
            "$:/UpgradeLibrary/List",
            "recipes/library/tiddlers.json",
            "--rendertiddler",
            "$:/plugins/tiddlywiki/pluginlibrary/library.template.html",
            "index.html",
            "text/plain"
        ]
    }

On the other hand Tiddlywiki allows to store plugins on other paths: See https://tiddlywiki.com/prerelease/#Environment%20Variables%20on%20Node.js

The request is to be able to create library of plugins from customized path no only from installed path of Tiddlywiki on Node.js

All 21 comments

Use the environment variables and you are good to go.

You can use it like: tiddlywiki --build my-libs

 "build": {
        "library": [
           ... default stuff removed to make the example smaller
        ],
        "my-libs": [
           ... here you can do whatever you want. It just needs to work. So you can use any paths that you need.
        ]
    }

IMO there is no need for a new feature.

Thanks @pmario

I give a try and back to you!

@pmario
I have all developed plugins in

D:\Tiddlywiki\plugins\kookma

Should I repeat all the command in current "library": here? I appreciate if you kindly give me an example

Unfortunately I could not make any library!

  • I am on WIndows 10, Node.js 12.13.1 and Tiddlywiki 5.1.22p
  • Tiddlywiki is installed on drive C:
  • Plugins are saved under D:\Tiddlywikiplugins\kookma
  • The extra plugin path was added using TIDDLYWIKI_PLUGIN_PATH as described in https://tiddlywiki.com/prerelease/#Environment%20Variables%20on%20Node.js
  • The build command I used is given in the below tiddlywiki.info
{
    "description": "Kookma Plugin Library",
    "plugins": [
        "tiddlywiki/pluginlibrary"
    ],
    "themes": [],
    "build": {
        "my-libs": [
            "--makelibrary","$:/UpgradeLibrary",
            "--savelibrarytiddlers","$:/UpgradeLibrary","[prefix[$:/plugins/kookma/]]","recipes/library/tiddlers/","$:/UpgradeLibrary/List",
            "--savetiddler","$:/UpgradeLibrary/List","recipes/library/tiddlers.json",
            "--rendertiddler","$:/plugins/tiddlywiki/pluginlibrary/library.template.html","index.html","text/plain"
        ]
    }
}
  • the command at terminal to build library is
tiddlywiki --build my-libs
  • The output folder is created with empty library

Please advise!

Can you tell my the env variable: TIDDLYWIKI_PLUGIN_PATH ... What's the exact value?

I'm not 100% sure, but I think you need to include your plugins in the plugins section of the library edition. They are not automatically included, as with the TW main project.

Thanks @pmario

It is: D:\Tiddlywiki\plugins

If I store the developed plugins in C:\Tiddlywiki\51.22plugins alongside official plugins e.g

  • C:\Tiddlywiki\5.1.22\plugins\tiddlywiki
  • C:\Tiddlywiki\5.1.22\plugins\kookma

Then it works!
Note that my Tiddlywiki 5.1.22 is installed in C:\Tiddlywiki\5.1.22.

But I like to store my developed plugins in separate folder e.g D:\Tiddlywiki\plugins\kookma and then be able to create a library from them.

Try this:

    "plugins": [
        "tiddlywiki/pluginlibrary",
        "kookma/yourplugin1",
        "kookma/yourplugin2"
    ],

be aware of the the comma at the end, except the last array element.

Thanks @pmario

Sorry, does not work!

I think the path is not discoverable by pluginlibrary and nothing created!

Hi @kookma it sounds like you're developing your plugins inside a copy of the TW5 repo. I wouldn't recommend that because it makes it harder to update TW5 without disturbing your plugins.

@pmario @inmysocks I think we could do with a demo repo showing how to develop plugins and distribute them through a custom plugin library. Does any of you have anything that could serve as a starting point?

Thank you @Jermolene
I just used the official plugin to create a new project (wiki) as below

tiddlywiki mylib --init pluginlibrary

and then tried to make the plugin library!

If I can be of any help please let me know!

I am eagerly waiting to see how custom third party plugin library can be created!

I may recommend to have some guideline (kind of standards) for making plugin library and all developer follow it.

I probably have something, I will look in the morning.

Hi @inmysocks,
That would be great and is superior if some of your common plugins can be packaged into a plugin library!

It looks like @kookma is right, or I am missing something big. Currently the only place that makelibrary.js looks for plugins is inside the tiddlywiki/plugins folder, it doesn't use the environment variable.
I modified makelibrary.js for the plugin library that I published and put a note to make a pull request, which I never ended up doing. I will do it now.

In makelibrary.js it only takes plugins from $tw.config.pluginsPath which is set to ../plugins/ in boot.js.

The pull request I am making is just a quick update to makelibrary.js to make use of the environment variables also.

The pull request is #4559

I made a cleaner version of the setup I used before I started using Bob and put it into a repo here https://github.com/inmysocks/PluginDevelopment

It needs more documentation I think, but it is a start. It is also almost certainly buggy because I am the only one who has tested it.

I am not sure if there is a better place for it, is there a tiddlywiki repo that this would be appropriate for?

Thanks @inmysocks
I will give a try and will back with result. I would be happy to help to improve the documentation!

Hi @inmysocks
It seems it does not work. I submitted the issue on the repo page
https://github.com/inmysocks/PluginDevelopment/issues

This feature request has been addressed by PR https://github.com/Jermolene/TiddlyWiki5/pull/4559

So, I close this issue.

Was this page helpful?
0 / 5 - 0 ratings