Adding link types

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding link types

keith1y
I was wondering if it might be worth dispatching the calls
visitBrokenInternalLink: visitEmbeddedInternalLink: etc back to the Link
instance...

So that the types of link can render themselves appropriately.

Keith

   

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Adding link types

keith1y
Keith Hodges wrote:
> I was wondering if it might be worth dispatching the calls
> visitBrokenInternalLink: visitEmbeddedInternalLink: etc back to the Link
> instance...
>
> So that the types of link can render themselves appropriately.
>
> Keith
>  
Example:

PRRenderer-visitInternalLink: anObject
    anObject isBroken
        ifTrue: [ ^ anObject acceptLinkBroken: self  ].
    (anObject isEmbedded not or: [ self doesRemember: anObject target ])
        ifTrue: [ ^ anObject acceptLinkGoto: self ].
    self
        remember: anObject target
        while: [ anObject acceptLinkEmbed: anObject ]


PRInternalLink-acceptLinkBroken: visitor
    ^ visitor visitInternalLinkBroken: self

PRMyLink-acceptLinkBroken: visitor
    ^ visitor visitMyLinkBroken: self

Keith

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Adding link types

Lukas Renggli-2
>> I was wondering if it might be worth dispatching the calls
>> visitBrokenInternalLink: visitEmbeddedInternalLink: etc back to the  
>> Link
>> instance...

Indeed, that would make the code easier to extend. I keep a note on  
that and we can try to refactor that in the near future.

Right now, I have to be a bit careful. I did all kinds of experiments  
in the latest commits, that very likely will not all make it into the  
next release. I am also waiting for feedback for that matters (see my  
next mail).

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki