On Sat, 26 Jul 2014 08:32:10 -0700 (PDT) "Edward K. Ream" <[email protected]> wrote:
> By analogy with the plugin importers in leo/plugins/importers, Leo > will soon support plugin write code in leo/plugins/writers. > > There are writer plugins for .md (markdown), .org, .otl and .rst > files. They are remarkably simple. > > These plugins are untested, and not yet hooked into Leo's core. > Coming later today, perhaps... > > **Important**: there is no need for separate writer plugins for most > kinds of files. The standard @file write code will suffice because > Leo knows about the comment delimiters, etc. for each language. At > present, such data is hard-coded in tables in leoApp.py, but Leo will > soon build those tables from something like: Interesting, until this post I hadn't realized the modules you were making weren't both readers and writers. I thought I had a use case where I wanted language specific reading and writing, e.g. writing comments like ### setOfLetters ################################################# in the output and having those disappear into Leo node names in Leo, but get written out that way again on write. But now the use case isn't clear in my mind - if the node names are just "function" names (or whatever named units the language in question defines), then it seems you're right, Leo only needs to know the language on read, write is trivial but for the edge cases in whitespace and indentation of course. So it's only organizer nodes that need special consideration, not sure where they fall for other languages / @persistance / @shadow etc. I guess the use case I was thinking of is the situation you see in R statistical analysis scripts sometimes where there's a long string of steps and it's nice to organize them into a *flat* list of named nodes, which could be written out / read in in a comment format like the above, but there isn't a language element carrying the names. Sort of non-hierarchical organizer nodes. Having said all that, there are writer modules where needed, so, best of both worlds :-) Cheers -Terry > leo/plugins/data/language_data.py. > > Users will be able to tell Leo about new languages simply by adding a > new dictionary to language_data.py. > > 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.
