create relative urls when dragging binary files to Leo

35 views
Skip to first unread message

Josef

unread,
Jul 24, 2012, 4:59:23 AM7/24/12
to leo-e...@googlegroups.com
I would prefer if the @url created when a binary file (PDF) is dragged into Leo would be a *relative* one,
e.g. if I drag a file foo.pdf, which sits in the same directory as the Leo file into Leo, then I would expect to end up with a headline like:
@url foo.pdf, and not as it is now: @url file:///home/.../foo.pdf.

I would even expect this to be @url ../foo.pdf if the PDF sits in the parent directory or @url ../sibling/foo.pdf if it sits in the sibling directory etc.
Python (os.path) has facilities to build relative paths, so most of the logic for this is already there.

The advantage of a relative path is: I can then move the whole directory tree including Leo file and referenced files and the links still work, and I can share both Leo and referenced files via SVN or similar, since my co-workers are likely to have different absolute paths then I.

In some cases an absolute path is needed, though - so I would suggest to create one by ctrl-dragging or alt-dragging or so.

- Josef

Terry Brown

unread,
Jul 24, 2012, 8:18:57 AM7/24/12
to leo-e...@googlegroups.com
On Tue, 24 Jul 2012 01:59:23 -0700 (PDT)
Josef <joe...@gmx.net> wrote:

> I would prefer if the @url created when a binary file (PDF) is dragged into
> Leo would be a *relative* one,

These sound like worthwhile enhancements, perhaps you could file a
wishlist bug item for them:
https://bugs.launchpad.net/leo-editor

Cheers -Terry

Fidel Pérez

unread,
May 18, 2013, 8:02:57 AM5/18/13
to leo-e...@googlegroups.com, terry_...@yahoo.com
Absolutely agree:
Files could fall into two categories:

-Those which are within Leo file relative scope, which can be relative to it. The user losses no information whatsoever by having them always being relative to the Leo file.

-Those which are outside the Leo file folder, which then should be absolute, since the user could potentially lose information if he moved the Leo file
Reply all
Reply to author
Forward
0 new messages