On Tue, 3 Apr 2012, Jeremy Ruston wrote:
Are you thinking that there would be a mapping of link types to
various functions (which return the ElementNode) or something within a
single function that handles different types of links?
The former seems in keeping with the usual patterns.
So a "formatter" would result in a link macro of type X. Macro
processing would say "oh yeah, that's X, funcX deals with that".
Can you clarify what sort of link types you'd expect to see?
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.
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.
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
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.
[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.