> Well the original problem I mentioned was that we need a way to
> resolve space names (or that kind of syntax) which in the most basic
> case means being able to say "prepend the space name onto the string
> '.tiddlyspace.com' to make the hostname portion of the link".
>
> In my gist[1] that's currently a static string, but what we want is to
> be able to declare, somewhere, how space names are resolved,
> preferably in a programatic way.
>
> My understanding of what you were suggesting was that link macro,
> knowing that it is of space type, would look for a function to perform
> the resolution, thus being able to create a correct target.

In fact, I think you do want to process all links, not just space links.

The reason is that I think that the encodeURIComponent() that I added
a few weeks ago is part of the same bundle of special logic: how to
treat TiddlySpace links. I can imagine other hosts that might use a
different way of encoding tiddler titles into URIs (perhaps using
dashes for spaces).

But otherwise, yes, I think we're seeing the same problem and the same solution.

> The main problem here is that the formatter rule and its handler itself
> are (correctly) encapsulated and thus don't know that in whatever
> context we happen to be in the space domain '.tiddlyspace.com'. In
> some _other_ context (running the same code, in the same process)
> it might be something else.

Right. I think the formatter can just shovel the space component into
the parameters for the link macro, and let the link macro invoke the
link generator callback to generate the actual link.

> It matters naught to me whether there are many or one callback, but
> from an extensibility standpoint, assuming you want a single link macro,
> and the inevitability of wanting to massage links (beyond simple internal
> external-ness), from a writer-of-formatter-rules it would be nice to
> be able to declare, in my formatter two things:
>
> * that the link I'm creating is a special
> * that this (adjacent piece of code) is the massager to make it behave

I think this might be where we're differing. I don't see such a tight
coupling between the special formatter and the link massaging rules. I
think that's partly because as I mentioned above, I think it's useful
for the syntax for space links to be part of the TW5 core. This means
that the formatters you've written would become part of the core, and
not be packaged along with the massager.

> All that send I'm not wed to any particular way of doing this. I just
> want to be able to get space links working. How is an interesting
> concern, but secondary for me. I _really_ want to move on from
> the 2.6.x-based twikifier.

Terrific. I'll prototype up some code and get back to you,

Best wishes

Jeremy

> [1] https://gist.github.com/2149828
>
>
> --
> 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.
>



-- 
Jeremy Ruston
mailto:[email protected]
http://www.tiddlywiki.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.

Reply via email to