> One thing I've noticed that might be improved or changes is that > currently dependencies are managed as a simple list of link targets. > This means that when you query the dependencies of a single tiddler > you might get output like this: > > [ 'TiddlySpace', > 'TiddlySpaceSockets', > 'https://github.com/cdent/tapas', > 'http://tiddlyspace.com/bags/tapas_extra/tiddlers/tiddlersocket.js', > 'https://github.com/cdent/tapas/issues', > '@tapas', > 'TiddlySpaceSockets#d75673c75548023b8b8acf782a002b85' ] > > (these are the dependencies from my http://cdent.tiddlyspace.com/tapas > tiddler) > > We've got basically two types of links here: a wikilink or an > external link. I haven't inspected WikiTextRules in detail but I'm > guess there could be more and there might be others that result from > plugins, etc.
The behaviour you're seeing is intentional but provisional (as in, I'm open to suggestions to change it). At the moment, the wikification engine doesn't try to determine whether a link is internal or external right until it is rendered, when the function WikiStore.adjustClassesForLink assigns classes to the link according to whether the target exists as the title of a tiddler. It is done this way so that if a link needs to be updated because a target tiddler has changed its status, it becomes possible to just rerender the link, rather than having to reparse the tiddler too. Back in the parsing processing, when the dependencies are computed, I'm trying to avoid accessing any other tiddlers in the store because then we'd have to reparse when the store changes. Thus the only mechanism available for determining whether a link is external would be for the parsing stage to apply regexps to the target string. We found with TiddlyWiki that it's very hard to come up with a good general purpose regexp for detecting external URIs and so I felt it was better to let the outside world apply it's own logic to determine external links. As I may have mentioned, I am thinking that the representation of dependencies needs to be updated to distinguish between tiddlers that are linked to from those that are transcluded. > In my experiments I now need to branch on whether the link is a Wiki > link (free or camel) or something else to choose whether to pull an > additional tiddler into the store. Is this what you're > intending/expected, or is this an interim state of affairs? It does seem counter-intuitive, but as I say, it does give you a great deal of control over the policies governing how a URI is parsed. > The gravy train version of dependencies, for my use case, would be > something like this: A dictionary with keys representing types of > links and values that are the links themselves. The types would be > things like: > > 1 link to tiddler no text required > 2 link to tiddler requiring text > 3 url > > I recognize this may be a bit outside the immediate remit, but if > you're still fleshing it out, there are some ideas. What's the distinction between types 1 and 2? Links in TW5 are coded as macros, and macros have been extended so that they can have children. Thus, the link macro can contain arbitrary content, not just text. You may find it useful to dig around in the internal structures by clicking on the "parse tree" and "render functions" buttons at the bottom of each tiddler here: http://tiddlywiki.com/tiddlywiki5/ I'm pleased it's coming together, Best wishes Jeremy > For the time being I can still do what I need to do with stuff as > is. > > -- > Chris Dent http://burningchrome.com/ > [...] > > -- > You received this message because you are subscribed to the Google Groups > "TiddlyWikiDev" 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/tiddlywikidev?hl=en. > -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" 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/tiddlywikidev?hl=en.
