On Wed, May 21, 2014 at 10:11 AM, nakedmind <[email protected]> wrote: > On Wednesday, May 21, 2014 7:20:44 PM UTC+8, Terry wrote: >> >> I wonder if it would be sense for Leo's select body code to use a hook >> or something similar to find the body widget, so that plugins could >> change the meaning of "the body widget" more easily. Will make a note. >> > > I don't know if it's related but I've had this idea for a while now. What if > you can have multiple body editors for different data like ordinary text, > rich text, image, etc. > There is a global dictionary that maps node directives to body editors. > Plugins can add new node directives and select which existing body editors > to use by just > updating the global dictionary. Or plugins can add new body editors. So if > create a plugin that introduces a @pdf node directive and a corresponding > pdf viewer, I can just update the global dictionary and leo will know that > nodes with headlines starting with the aforementioned directive will use my > plugin's pdf viewer. The body editor may even be an external application.
Not a bad idea. In effect, this would be a generalization of the viewrendered or viewrendered2 plugins. At present, these plugins have this logic hard coded. It's surprisingly complicated to switch the rendering widget dynamically. It's conceivable that a more general approach would be less complex/buggy, but I wouldn't get my hopes up :-) Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
