With this plugin you can reference a tiddler through an alias (or even
through many aliases). E.g. a tiddler "William Shakespeare" may also be
referenced as {{{[[Shaxper]]}}}.
When editing a tiddler you may enter alternative names for the tiddler
in the "Alias" field (below the tags field), similar to the way you
enter tags. You may even specify multiple alias names, separated by
spaces. Alias names containing spaces must be written as {{{[[...]]}}}.
You find the plugin at the new "Beta Area" of abego Software:
http://tiddlywiki.abego-software.de/Beta.html
Feedback is highly appreciated.
Have fun,
Udo
----------
Udo Borkowski
http://www.abego-software.de
I just released the first beta of the new TiddlerAlias plugin:
http://tiddlywiki.abego-software.de/Beta.html#%5B%5BTiddler%20Alias%20Example%5D%5D%20TiddlerAliasPlugin
With this plugin you can reference a tiddler through an alias (or even
through many aliases). E.g. a tiddler "William Shakespeare" may also be
referenced as {{{[[Shaxper]]}}}.
When editing a tiddler you may enter alternative names for the tiddler
in the "Alias" field (below the tags field), similar to the way you
enter tags. You may even specify multiple alias names, separated by
spaces. Alias names containing spaces must be written as {{{[[...]]}}}.
Ken Girard
Udo
But before we really can use this "alias" feature for translation we need a way to define fields for shadow tiddlers (not just their text) because in a translation of a shadow tiddler we want to set the "alias" field, too.
(function() {
// plugin code here...
})();
I think also it might be useful to put tags on shadow tiddlers
Ps, what's the purpose of this for plugins:
(function() { // plugin code here... })();
if (i > 10) {
int n = 0;
...
}
if (i > 10) {
var n = 0;
...
}
(function() {
var myVar = 123;})();
function myFunc(x) {
return x*myVar;
}
window.globalFunc = function(y) {
return 2*myFunc(y);
}
Ps, what's the purpose of this for plugins:
(function() {
// plugin code here...
})();
This defines an anonymous function and directly calls it (i.e. the functions body is executed). The main purpose is to "hide" variables and functions from the "global scope", to avoid poluting the "global namespace". This is mainly necessary because of the way JavaScripts handles "scoping".
[[Shaxper]].[[...]]I think also it might be useful to put tags on shadow tiddlers
On 9/22/06, Udo Borkowski <Udo.Bo...@gmx.de > wrote:
Ps, what's the purpose of this for plugins:(function() {
// plugin code here...
})();
This defines an anonymous function and directly calls it ( i.e. the functions body is executed). The main purpose is to "hide" variables and functions from the "global scope", to avoid poluting the "global namespace". This is mainly necessary because of the way JavaScripts handles "scoping".
Simon, an example is the error Clint reported with SelectThemePlugin and TW2.1, which I did a quick fix for not long ago. We have a for (var n in object) loop there that is globally declared, and was causing conflicts.... in a future rewrite it needs to be wrapped in a function.
Saq
Would that break something?I bet!
Would that break something?I bet!
If I recall correctly Jeremy tried something similar in an attempt to pass some "parameter" to the plugin currently loaded. But this change broke some code and was rolled back. (Anyone got some details?)
Udo Borkowski wrote:
> I just released Beta 2 of the TiddlerAliasPlugin
> (http://tiddlywiki.abego-software.de/Beta.html#TiddlerAliasPlugin).
>
> It fixes the bug reported by KenGirard. Thanks Ken.
>
> *About the Plugin*
Udo, this is a great plugin. Any idea if you can have the references to
[[TiddlerAlias]] merged with the references to [[Tiddler]]? Right now,
a tiddler that links to [[TiddlerAlias]] won't show up in the
references for [[Tiddler]]. So if we want to be able to track
references to [[TiddlerAlias]] we have to use pretty links (i.e.
[[TiddlerAlias|Tiddler]]).
Udo Borkowski wrote:
> I just released Beta 2 of the TiddlerAliasPlugin
- I added a control panel to the plugin so you can change the default
options without editing the plugin itself.
- Made it so you can specify what character you want the non-space
alias to substitute. Defaults to "-".
- Added a "lazy auto plural" option. Disabled by default. It's "lazy"
because it only adds or subtracts an "s" from the end of words. Was
basically a merging with this plugin:
http://jackparke.googlepages.com/jtw.html#PluralAliasPlugin
- Added an "auto lower case" option. Disabled by default. Makes the
most sense if you're not using WikiWords for your links.
- Only tested changes on Firefox 2.0, though IE 7.0 appears to work ok.
Not sure how happy I am with the how I implemented everything.
First, I used some sudo-recursion for the new auto-alias options. Was
the only way I could think of to automatically make lower-case
lazy-plural aliases (for example), which is something I wanted for my
own project. While this seems like the "expected" behavior to me, it
creates a fair amount of overhead. (First option is repeated N times,
second N-1, etc.) I also haven't done anything to make these auto
options work on manually entered aliases. While I tend to think that
auto-aliasing the aliases would be the expected behavior, the
efficiency issue would double with every manually entered alias. I'm
not sure how comfortable I am with that.
Second, while I like being able to switch out the "-" with a "_" (or
even a ""!), I'm not sure how safe that is to allow. Should it be
escaped?