Activepath plugin so extFiles are master, Leo is read-only?

13 views
Skip to first unread message

HansBKK

unread,
Feb 7, 2012, 10:43:25 AM2/7/12
to leo-e...@googlegroups.com
Sorry for the extended intro, skip to the bottom for a concise question if the topic isn't of interest.

For a variety of reasons, all my own fault I'm sure, I've got two relatively large Leo files that have gotten out of sync with the external files in my filesystem, including hundreds of the scary "...has been modified outside of Leo. Overwrite this file?" and unfortunately I haven't updated since this was fixed, and with all the "interesting" developments will probably hold off for the moment.

Unfortunately I didn't properly follow my own SOP, with help from Terry's script, to ensure that all my content nodes in the .leo data is replicated out into the external files, so I can't just delete the .leo files and start over. So I've decided to empty them out manually, carefully comparing with the externals, checking for clones (now straight duplicated content in the externals) and most importantly data that only exists in the .leo, creating external files manually to store it.

I plan to rely on the external filesystem only for the moment, but will be experimenting with Zim, which is probably more "my speed" for this particular use case, easily handles cross-file linking to reduce the need for cloning, apparently supports content-tagging in a relatively user-friendly way, and happily is also written in Python.

The only (minor) issue is that it has its own "proprietary" markup syntax, but the author is working on an export routine to pandoc's extended markdown, which should at least in future handle exporting to EPUB, websites, DocBook etc. (he could just as easily used reST to get into pandoc, but chose markdown instead).

My question - once I've emptied and deleted these two current .leo files and am managing the content externally, is there a recommended way to use Leo (presumably with activepath) so that I can automate bringing the whole dirstruc tree in so that it's all "read-only" AFA Leo is concerned? I then want to be able to refactor externally - rename folders and files, add/delete move directory branches around in the filesystem, maybe not open Leo for weeks, and then when I do, everything is updated and brought in sync.

If I have to manually maintain stuff in Leo to match my often-changing tree with hundreds of files, I'll probably wait until things settle down and see how Zim goes first. . .

TIA

Terry Brown

unread,
Feb 7, 2012, 11:55:49 AM2/7/12
to leo-e...@googlegroups.com
On Tue, 7 Feb 2012 07:43:25 -0800 (PST)
HansBKK <han...@gmail.com> wrote:

> My question - once I've emptied and deleted these two current .leo files
> and am managing the content externally, is there a recommended way to use
> Leo (presumably with activepath) so that I can automate bringing the whole
> dirstruc tree in so that it's all "read-only" AFA Leo is concerned? I then
> want to be able to refactor externally - rename folders and files,
> add/delete move directory branches around in the filesystem, maybe not open
> Leo for weeks, and then when I do, everything is updated and brought in
> sync.
>
> If I have to manually maintain stuff in Leo to match my often-changing tree
> with hundreds of files, I'll probably wait until things settle down and see
> how Zim goes first. . .

Of the top of my head response - I think there's a setting for
active_path that lets you specify which kind of @<file> node is used
for importing files. It's possibly, if my import approach was quick
and dirty enough :-) that you could get away with setting that to
"@view", and you'll just get the file contents loaded into a node which
will never write anything (because @view isn't a real @<file> type).

For updating, as long as you're sure there's nothing in the tree you
want, you can just delete the whole thing and have active_path load it
again. When you do an update it marks nodes for files which are no
longer present with asterisks, that might be useful for checking for
things in Leo not present on the filesystem.

Cheers -Terry

HansBKK

unread,
Feb 7, 2012, 2:16:36 PM2/7/12
to leo-e...@googlegroups.com, terry_...@yahoo.com
On Tuesday, February 7, 2012 11:55:49 PM UTC+7, Terry wrote:

>> is there a recommended way to use Leo (presumably with activepath) so that I can automate bringing the whole dirstruc tree in so that it's all "read-only" AFA Leo is concerned? I then want to be able to refactor externally - rename folders and files, add/delete move directory branches around in the filesystem, maybe not open Leo for weeks, and then when I do, everything is updated and brought in in sync.

Of the top of my head response - I think there's a setting for active_path that lets you specify which kind of @<file> node is used
for importing files.  It's possibly, if my import approach was quick and dirty enough :-) that you could get away with setting that to
"@view", and you'll just get the file contents loaded into a node which will never write anything (because @view isn't a real @<file> type).

That's very helpful thanks, I hadn't caught that directive.

Apparently it's only mentioned here - perhaps it should be added to the more general pages, perhaps here ?

If that's no good, then I'll try @shadow (which I've been using without any apparent trouble) with the read-only plugin. . .

Terry Brown

unread,
Feb 7, 2012, 2:31:27 PM2/7/12
to leo-e...@googlegroups.com
On Tue, 7 Feb 2012 11:16:36 -0800 (PST)
HansBKK <han...@gmail.com> wrote:

> > for importing files. It's possibly, if my import approach was quick and
> > dirty enough :-) that you could get away with setting that to
> > "@view", and you'll just get the file contents loaded into a node which
> > will never write anything (because @view isn't a real @<file> type).
> >
> That's very helpful thanks, I hadn't caught that directive.

Um, I didn't know it was a directive - I just made it up :-)

I can't remember how active_path does its importing - I was hoping it
was simplistic enough to just create a node '@<xxx> filename.py' and
stick the contents of the file in the body - where <xxx> is whatever
you put in the setting for preferred @<file> type.

Now I think more about it I guess it does proper @auto / @shadow
importing, so maybe that won't work (even with a truly non-existent
directive, like @peek or @list or whatever :-)

Just too busy right now to actually look at the code.

Cheers -Terry

HansBKK

unread,
Feb 7, 2012, 2:53:50 PM2/7/12
to leo-e...@googlegroups.com, terry_...@yahoo.com
On Wednesday, February 8, 2012 2:31:27 AM UTC+7, Terry wrote:

Um, I didn't know it was a directive - I just made it up :-)

LMAO! I was feeling guilty for having missed something like an entirely new @<file> type 8-)

It's implemented by the at-view plugin, so I'll give that a shot first, just in case, then your phantasmagorical @anything 8-) and then worst-case @shadow with read-only.py.

 

I can't remember how active_path does its importing - I was hoping it was simplistic enough to just create a node '@<xxx> filename.py' and
stick the contents of the file in the body - where <xxx> is whatever you put in the setting for preferred @<file> type.


And I assume you mean "activepath will create a node " since I'm also planning on testing the "delete the whole tree and re-create" idea over hundreds of folder in one go, nothing manual - and yes, I do have backups 8-)

Thanks for taking the time to respond. . .

Terry Brown

unread,
Feb 7, 2012, 3:01:58 PM2/7/12
to leo-e...@googlegroups.com
On Tue, 7 Feb 2012 11:53:50 -0800 (PST)
HansBKK <han...@gmail.com> wrote:

> And I assume you mean "activepath will create a node "

Yep.

Cheers -Terry

Reply all
Reply to author
Forward
0 new messages