Can I require a plugin on my local filesystem?

56 views
Skip to first unread message

Danielo Rodríguez

unread,
Aug 17, 2016, 5:42:39 AM8/17/16
to TiddlyWiki
I know this is a question so technical that it could fit into the developers group, but I think it could be of general interest.

Currently, on the node version you include the plugins that you want to use on the tiddliwiki.info file. This is very convenient, but I want to know if this could be a bit more flexible than just requiring official plugins.

What I want to do is to reference one or more of the plugins that I'm developing, so I can create an edition separately from the development of the plugin. So, ideally I could import a plugin in a fashion like:

"plugins": [
               
"tiddlywiki/tiddlyweb",
               
"tiddlywiki/filesystem",
               
"../../myPluginDirectory"
       
],

Regards

PMario

unread,
Aug 17, 2016, 8:34:40 AM8/17/16
to TiddlyWiki
see: http://tiddlywiki.com/#Environment%20Variables%20on%20Node.js

You can create a directory structure like this eg:

git/myPlugins/danielo/plugin1
git/myPlugins/danielo/plugin2


if you set the environment variable TIDDLYWIKI_PLUGIN_PATH="git/myPlugins/", you can use. The TIDDLYWIKI_PLUGIN_PATH variable can handle several paths. So if you want to use plugins from someone else you can add them too. Depending on your OS the paths may look different! TW can handle them with MacOS, Windows and Linux


"plugins": [
               
"tiddlywiki/tiddlyweb",
               
"tiddlywiki/filesystem",

               
"danielo/plugin1",
                "danielo/plugin2",
       
],


and tiddlywiki command will find it.

-m

Danielo Rodríguez

unread,
Aug 17, 2016, 8:57:21 AM8/17/16
to TiddlyWiki
Thak you very much Pmario! Exactly what I was looking for.
I suppose that I can use this like any other normal ENV variable. EJ, setting it before calling the tiddlywiki command.

Regards.
Reply all
Reply to author
Forward
0 new messages