mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Add support for preloading plugins by path instead of name
This commit is contained in:
parent
2f8053265e
commit
feab75a6d1
15
boot/boot.js
15
boot/boot.js
@ -2044,10 +2044,17 @@ $tw.loadTiddlersNode = function() {
|
|||||||
$tw.wiki.addTiddler($tw.loadPluginFolder($tw.boot.corePath));
|
$tw.wiki.addTiddler($tw.loadPluginFolder($tw.boot.corePath));
|
||||||
// Load any extra plugins
|
// Load any extra plugins
|
||||||
$tw.utils.each($tw.boot.extraPlugins,function(name) {
|
$tw.utils.each($tw.boot.extraPlugins,function(name) {
|
||||||
var parts = name.split("/"),
|
if(name.charAt(0) === "+") { // Relative path to plugin
|
||||||
type = parts[0];
|
var pluginFields = $tw.loadPluginFolder(name.substring(1));;
|
||||||
if(parts.length === 3 && ["plugins","themes","languages"].indexOf(type) !== -1) {
|
if(pluginFields) {
|
||||||
$tw.loadPlugins([parts[1] + "/" + parts[2]],$tw.config[type + "Path"],$tw.config[type + "EnvVar"]);
|
$tw.wiki.addTiddler(pluginFields);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var parts = name.split("/"),
|
||||||
|
type = parts[0];
|
||||||
|
if(parts.length === 3 && ["plugins","themes","languages"].indexOf(type) !== -1) {
|
||||||
|
$tw.loadPlugins([parts[1] + "/" + parts[2]],$tw.config[type + "Path"],$tw.config[type + "EnvVar"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Load the tiddlers from the wiki directory
|
// Load the tiddlers from the wiki directory
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
created: 20131219100520659
|
created: 20131219100520659
|
||||||
modified: 20190412170813209
|
modified: $tw.loadPluginFolder(name.substring(1));
|
||||||
tags: [[TiddlyWiki on Node.js]]
|
tags: [[TiddlyWiki on Node.js]]
|
||||||
title: Using TiddlyWiki on Node.js
|
title: Using TiddlyWiki on Node.js
|
||||||
type: text/vnd.tiddlywiki
|
type: text/vnd.tiddlywiki
|
||||||
@ -14,14 +14,14 @@ tiddlywiki --verbose --load mywiki.html --rendertiddler ReadMe ./readme.html
|
|||||||
|
|
||||||
Running `tiddlywiki` from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments from left to right. The arguments are separated with spaces.
|
Running `tiddlywiki` from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments from left to right. The arguments are separated with spaces.
|
||||||
|
|
||||||
<<.from-version "5.1.20">> First, there can be zero or more plugin references identified by the prefix `+`. These plugins are loaded in addition to any specified in the [[TiddlyWikiFolder|TiddlyWikiFolders]].
|
<<.from-version "5.1.20">> First, there can be zero or more plugin references identified by the prefix `+` for plugin names or `++` for a path to a plugin folder. These plugins are loaded in addition to any specified in the [[TiddlyWikiFolder|TiddlyWikiFolders]].
|
||||||
|
|
||||||
The next argument is the optional path to the [[TiddlyWikiFolder|TiddlyWikiFolders]] to be loaded. If not present, then the current directory is used.
|
The next argument is the optional path to the [[TiddlyWikiFolder|TiddlyWikiFolders]] to be loaded. If not present, then the current directory is used.
|
||||||
|
|
||||||
The commands and their individual arguments follow, each command being identified by the prefix `--`.
|
The commands and their individual arguments follow, each command being identified by the prefix `--`.
|
||||||
|
|
||||||
```
|
```
|
||||||
tiddlywiki [+<pluginname>] [<wikipath>] [--<command> [<arg>[,<arg>]]]
|
tiddlywiki [+<pluginname> | ++<pluginpath>] [<wikipath>] [--<command> [<arg>[,<arg>]]]
|
||||||
```
|
```
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
@ -29,6 +29,7 @@ For example:
|
|||||||
```
|
```
|
||||||
tiddlywiki --version
|
tiddlywiki --version
|
||||||
tiddlywiki +plugins/tiddlywiki/filesystem +plugins/tiddlywiki/tiddlyweb mywiki --listen
|
tiddlywiki +plugins/tiddlywiki/filesystem +plugins/tiddlywiki/tiddlyweb mywiki --listen
|
||||||
|
tiddlywiki ++./mygreatplugin mywiki --listen
|
||||||
```
|
```
|
||||||
|
|
||||||
<<.from-version "5.1.18">> Commands such as the ListenCommand that support large numbers of parameters can use NamedCommandParameters to make things less unwieldy. For example:
|
<<.from-version "5.1.18">> Commands such as the ListenCommand that support large numbers of parameters can use NamedCommandParameters to make things less unwieldy. For example:
|
||||||
|
Loading…
Reference in New Issue
Block a user