> I am interested to know if there is a solution to the following
> problem. Say that I have a number of links in a tiddler. Is there a
> way that I could go to each of these links, and recursively follow the
> links in these tiddler also, copy the body of each tiddler, and make
> it into a linear document that will sit in one tiddler so that I can
> print it as a document that reads in logical progression.
> Said another way, I want to copy the body of each tiddler in a depth
> first search, and make it into a single document.

http://www.TiddlyTools.com/#RelatedTiddlersPlugin

peforms a recursive, depth-first traversal of tiddler links and
generates a tree-view display of the result.  Take a look at the
plugin-defined function:
   config.macros.relatedTiddlers.getList(start,exclude,callback)
where:
   'start' is the title of the root tiddler for the traversal
   'exclude' is an array of titles to skip (i.e. don't follow links
FROM those tiddlers)
   'callback' is an alternative function for getting a custom list of
the links from a tiddler

For your purposes, you won't need to use a custom callback, since you
are interested in the normal tiddler links from each tiddler, which is
already provided by the plugin as a default callback handler.  Once
you have retrieved the resulting list of related tiddlers, you can
write some relatively simple script that outputs the desired format
(e.g. embedding the content of each tiddler in the list).  Something
like this:

<script>
   var
start=story.findContainingTiddler(place).getAttribute('tiddler');
   var list=config.macros.relatedTiddlers.getList(start);
   var out='';
   for (var i=0; i<list.length; i++)
      out+='<<tiddler [['+list[i]+']]>>\n';
   return out;
</script>

Note: to embed javascript code within tiddler content, you need to
install:
   http://www.TiddlyTools.com/#InlineJavascriptPlugin

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 tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to