> +1 vote for (optionally) making it macro-output-
> aware (via some plugin)... including, last but not least, tiddler
> macro output!
The core implementation of getReferringTiddlers() searches the tiddler
*source text*, rather than a searching in the *DOM elements* rendered
as tiddler output. The primary reason for this is performance.
Searching through the tiddler source content to find tiddler links
using text patterns (i.e., regular expressions for WikiWords,
bracketed text, etc.) can be processed reasonably quickly for most
documents. In contrast, parsing and rendering every tiddler in the
document in order to search the resulting DOM elements for *generated*
TiddlyLinks would be, in most cases, *extremely* slow (and would use
up an *enormous* amount of browser memory as well!).
However... for this specific use-case (a custom-written macro that
generates tiddlylinks as output)... it should be possible to hijack
the core function to add extra entries into the resulting array of
tiddlers that is being returned.
Something like this:
TiddlyWiki.prototype.core_getRefs =
TiddlyWiki.prototype.getReferringTiddlers;
TiddlyWiki.prototype.getReferringTiddlers =
function(title,unusedParameter,sortField) {
var r=this.core_getRefs.apply(this,argument);
// add references from custom macro
r=config.macros.myMacro.addExtraReferences(title,r);
return r;
};
// append extra link references to 'r'
config.macros.myMacro.addExtraReferences=function(title,r) {
// based on macro functionality, add more tiddlers to the array
...
return r;
}
----------
That should get you started in the right direction...
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.