Nice post, Terry. I use clones extensively for both scenarios you mention below. I try to avoid using them for repeatable text snippets wherever possible by creating and referencing small external text files, but that's not always practical. The biggest problem I would have in getting away from them altogether is that while I am quite literate in markup languages (html, LaTEx, etc.) I'm quite rusty when it comes to programming code and writing scripts (my last actual programming was 20 years ago in Pascal, never learned Python). I wouldn't even know where to start writing a script to go through an outline and replace all instances of a block of text with an updated version of same. So for me (at least for now), I will continue to rely on clones until and unless I can find a better alternative. Having said that, I always need to be aware of situations where clones can 'bite' (cross-files and @auto... as I mentioned in another post). Regards,
Rob.......... On Tuesday, December 6, 2016 at 1:50:30 PM UTC-5, Terry Brown wrote: > > (How I feel about clones, YMMV) > > Clones are really really good for creating task specific views of code, by > gathering together all the nodes relevant to a particular development task, > so you don't have to constantly scroll up and down the outline to get to > the relevant pieces. "Code" could be a manuscript or other non-computer > related document that requires editing in multiple places. > > Who uses them that way? Well, Edward, certainly, and probably a lot of > other people. Clones are fairly safe to work with in this role, although > I'm sure there are still ways they can have unexpected side effects. In > this role, you typically only have one occurrence of each clone in a @file, > the rest are in the Leo outline itself, but not in places written to > external files. This makes them less likely to bite. > > What else do people use them for? Template / snippet replacement for > recurring elements like headers and footers in websites, blogs, and in > code. This seems to be the context that people most often (a) get lyrical > about how unique Leo is for providing this great workflow, and (b) run into > trouble because of the tricky nature of cross file clones. > > I can see why people are attracted to clones for this second category of > uses, but I'm really not sure they're the best choice. In code, wanting to > repeat things may indicate bad design, you can usually define something > somewhere and reference it by name in the manner appropriate to the > language you're using. For things like website headers / footers, there are > a lot of other ways without the extra load of avoiding cross file clone pit > falls. Websites typically use some kind of templating system like > http://jinja.pocoo.org/docs/dev/. And you can still leverage Leo to > handle things like website headers / footers without clones. A *small* > script could run through an outline generating web pages with common header > / footer content pulled from Leo nodes. > > Finally, for the task specific code view case, I prefer alternatives which > may not be *quite* as fluid and seamless as clones (mainly for UI reasons), > but have no sharp edges you need to be wary of. The bookmarks, tagging, and > backlinks plugins are all options in this case, with the first two being > particularly usable. > > Cheers -Terry > > > > -- 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 https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
