How does TW find the plugins folder ?

107 views
Skip to first unread message

Danielo Rodríguez

unread,
May 1, 2018, 5:45:15 AM5/1/18
to TiddlyWikiDev
Hello,

I'm trying to setup a multi-plugin development workflow, but, as usual, I'm confused about how TW works.
What I want, ideally, is a plugin folder containing all my built plugins on an hierarchical way, and then an editions folder where, on each edition I can decide which plugins to include.

Currently the only thing I'm getting is targeting built my plugins inside the plugins folder of the edition. This is far from ideal. I am aware of the env variable TIDDLYWIKI_PLUGIN_PATH but that can get cumbersome because I already have that pointing to a different location, and including more than one means problems when switching between windows and linux.

So, how does the official tiddlywiki find the plugins folder ? It does not have any env variable set, the plugins folder it's outside of any folder so... how ?

I know that from time to time I come here asking something similar, but it happens to me that each time I come back to tw development I spend one day or two trying to figure what's the best way.


Regards

PMario

unread,
May 1, 2018, 7:26:33 AM5/1/18
to TiddlyWikiDev
Hi Danielo,

The environment variable can point to several plugin paths.

I already have that pointing to a different location, and including more than one means problems when switching between windows and linux.

Why. The environment variables have to be different anyway. In linux you must use ":" as seperator and in windows it's ";" ... I'm using both systems and have absolutely no problem.
I'm using different paths in both systems. The environment variables are local to your system and not pushed to git .. So I don't see why it should cause problems.

My setup looks like this:

Windows:
TW source: D:\git\tiddly\tiddlywiki\TiddlyWiki5

TIDDLYWIKI_PLUGIN_PATH: D:\git\tiddly\wikilabs\plugins
TIDDLYWIKI_EDITION_PATH: D:\git\tiddly\wikilabs\editions

eg:
uni-link plugin : D:\git\tiddly\wikilabs\plugins\wikilabs\uni-link
                            plugin.info
                            \tiddlers


tiddlywiki.info for an edition that should use uni-link plugin see: https://github.com/wikilabs/editions/blob/master/uni-link/tiddlywiki.info

I also use a second edition for development: https://github.com/wikilabs/editions/blob/master/uni-link-server/tiddlywiki.info  which uses some TW and some more of my own plugins.

I do have all my editions in one repo
I do have all my plugins in a different repo

TiddlyWiki reads environment variables from left to right and uses the first path, where it finds the plugin or edition. Since you don't want to have duplicated soruces, that's the right way to go. ....

have fun!
mario

BJ

unread,
May 2, 2018, 9:03:57 AM5/2/18
to TiddlyWikiDev
The default plugin location is next to the core folder -

tw\core
tw\editions
tw\plugins

then you put plugins as

tw\plugins\bj\flexitype\pluginsfiles
tw\plugins\bj\visualeditor\pluginsfiles
etc


all the best
BJ

Danielo Rodríguez

unread,
May 3, 2018, 7:49:05 AM5/3/18
to TiddlyWikiDev
Hello Pmario,

Thanks for your answer.



Why. The environment variables have to be different anyway. In linux you must use ":" as seperator and in windows it's ";" ... I'm using both systems and have absolutely no problem.
I'm using different paths in both systems. The environment variables are local to your system and not pushed to git .. So I don't see why it should cause problems.

I disagree. There are differences between environments, but there are also solutions to them. That's why I use things like cross-env and npm scripts for being able to use the same set of scripts on both environments.
In my case, the paths will be relative to the project, and they will be the same. The only difference will be the path separator. I strongly trust on building cross-os scripts. TW does the opposite and that is something I really dislike.
 
My setup looks like this:

Windows:
TW source: D:\git\tiddly\tiddlywiki\TiddlyWiki5

TIDDLYWIKI_PLUGIN_PATH: D:\git\tiddly\wikilabs\plugins
TIDDLYWIKI_EDITION_PATH: D:\git\tiddly\wikilabs\editions

eg:
uni-link plugin : D:\git\tiddly\wikilabs\plugins\wikilabs\uni-link
                            plugin.info
                            \tiddlers


tiddlywiki.info for an edition that should use uni-link plugin see: https://github.com/wikilabs/editions/blob/master/uni-link/tiddlywiki.info

I also use a second edition for development: https://github.com/wikilabs/editions/blob/master/uni-link-server/tiddlywiki.info  which uses some TW and some more of my own plugins.

Thanks for sharing your folder structure and links to your projects. That's always enricher and I'll check them out for sure. 
 

I do have all my editions in one repo
I do have all my plugins in a different repo

I will probably end with something similar. Having one repo per plugin is definitely non sustainable. Maybe I'll group some plugins, but that setup makes a lot of sense. Specially for sharing tools, styles and build pipelines.
 

TiddlyWiki reads environment variables from left to right and uses the first path, where it finds the plugin or edition. Since you don't want to have duplicated soruces, that's the right way to go. ....

I suspected that behavior, but thanks for confirming. 

PMario

unread,
May 3, 2018, 9:40:40 AM5/3/18
to TiddlyWikiDev
On Thursday, May 3, 2018 at 1:49:05 PM UTC+2, Danielo Rodríguez wrote:

Why. The environment variables have to be different anyway. In linux you must use ":" as seperator and in windows it's ";" ... I'm using both systems and have absolutely no problem.
I'm using different paths in both systems. The environment variables are local to your system and not pushed to git .. So I don't see why it should cause problems.

I disagree. There are differences between environments, but there are also solutions to them. That's why I use things like cross-env and npm scripts for being able to use the same set of scripts on both environments.
In my case, the paths will be relative to the project, and they will be the same. The only difference will be the path separator. I strongly trust on building cross-os scripts. TW does the opposite and that is something I really dislike.

IMO there is no need to have different build scripts for unix and or windows. Using things like "virtualenv" is like shooting in your foot. It only hurts and nothing else.

I'm using and building my stuff on both systems, and I'm using the exact same "npm run scrips" on both systems.

Only the environment variables point to different paths. ... that's it.

For testing and building I use npm .. See my editions/xx-server  directories. ...

The whole thing isn't perfect, because you need to "cd" into the right directory to activate the scripts. ... But it is "good enough" for the moment.

have fun!
mario

Danielo Rodríguez

unread,
May 7, 2018, 3:32:43 AM5/7/18
to tiddly...@googlegroups.com
Thanks again mario.
I'll check them out for sure!

Regards

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywikidev/J2gd_4K3yTM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywikidev+unsubscribe@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/02d9dc17-2943-4f70-a8f6-7c062c19777f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages