Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links to folders and files #310

Open
ErikZZZZZZ opened this issue Feb 27, 2024 · 9 comments
Open

Links to folders and files #310

ErikZZZZZZ opened this issue Feb 27, 2024 · 9 comments

Comments

@ErikZZZZZZ
Copy link

Just updated my system to Linux Mint 21.3 with Tomboy (classic) no longer in the repository. So I considered Tomboy-ng; first 0.34 which is in the repository and then 0.39. There are couple of features present or missing that inhibit my switching to Tomboy-ng at present, although I congratulate the builders with what had been achieved. Certainly version 0.39 feels smooth, although the hyperlinks are not as fast as in Tomboy Classic, i.e. the detection. I really appreciate the effort that has been put into this, so as to create a solid foundation to continue the life of Tomboy.
A necessity for me are links to folders and files. I use them frequently in Tomboy Classic and doing without would be cumbersome. It helps when the cursor would take on another shape when touching a link.
Another drawback is the styling of the bullet lists. It is too specific with characters and numbers on level 6, 7 and 8. The arrow styles on level 4 and 5 are very present. Either take something neutral like Tomboy Classic: closed dot, open dot, triangle; or make it configurable so the user can choose an appropriate style fitting the purpose. Restriction to 8 levels might be awkward in some cases. Also, changing bullet level with Tab/Shift+Tab is more or less standard in many text processing tools.

@davidbannon
Copy link
Member

Thanks Erik, some usefull comments but I am a bit worried about how many I can address !

I am unsure what you you mean by links to folders and files ? Do you mean that a click of such links will open your file manager ? I don't remember TB doing that but its been a long time ...

The cursor change, yes, I think its possible but like so many of such things, maybe at a further cost to responsiveness. I'll look into it.

Bullet Style is locked into the KMemo component I use to display marked up content. I don't personally like it either. User configerable would further complicate an already very messy bit of code (although much improved in an unreleased 0.40).

Tab/Shift - yes, history there. 0.39 has an 'indent' linked to tab key at request of another user, it was reserved long ago for that purpose. I am seriously considering reversing that, the Indent behavior is non TB and I have seen a bug manifest it self there (but, predictably, not repeatable). Having an excuse that the Tab key needs to be committed to bullets might make that easier. Maybe. Can you name those apps that use Tab key associated with Bullets ?

Thanks for your input.

Davo

@ErikZZZZZZ
Copy link
Author

Thank you, Davo, for responding to my remarks.

Clicking a link to a folder in TB Classic results in that folder opening in Nemo (I am using Linux Mint). Text files open in an editor. PDF in a document reader, etc. I guess it follows the general preferences set.

Libre Office Writer offers 10 levels of bullets, which are configurable. Thunderbird has something similar, but with less configuration options. Both applications treat Tab as increasing the level and Shift-Tab as decreasing the level. I have no idea if the code of these applications could be of assistance for Tomboy-NG.

Kind regards, Erik

@davidbannon
Copy link
Member

Hmm, I guess I could replicate that local links behaviour. I'll have to go back to U16.04 with a working Tomboy and see exactly what it does. Refreshing links is a major factor in response times so I'm not making any promises.

I guess the same approach would work with images, a link points to an image and clicking it opens the default image viewer ? Would get people wanting to embed images in a note off my back.

Hmm, I'll look into those Tab ideas, I like the idea of getting rid of the current indent, its not, imho particularly useful and does complicate the code.

But I will have to leave the user configurable bullets to Libre Office, they have a few more full time developers that me !

Davo

@davidbannon
Copy link
Member

Erik, been trying to find more about this "link to files" facility you had in a Tomboy release. Newest I can find is in Ubuntu 18.04, I'm guessing that your previous linux Mint was probably based on U18.04. But it does not seem to have anything like you describe. Its Tomboy is the most recent release of Tomboy, no new commits for 7 years now.

If I am to implement something, I'd like it to be compatible with what Tomboy did back then. Can you tell me a bit more ?

When you insert such a link, just what did you do ? Did it involve you typing something in line or did you need to popup a dialog box ? Or just a FileOpenDialog ? Just what did such an embedded link look like in Tomboy's text ? I'm sort of imagining something like file:~/pictures/prettypicture.png or, maybe file://Documents/proposal.doc ?

Davo

@ErikZZZZZZ
Copy link
Author

The most recent version of TB Classic is 1.15.9; It was included in LM19 (=U18), disappeared in LM20, but was later added to LM20(=U20). It also was included in LM21.1, but no longer in LM21.3 (=U22). In order to get it running, I have to add some (legacy) dependencies.

A character string is 'identified' by TB as a link to a file or folder when it start with a '/' followed by one or more characters and then another '/'. You can type or paste it. No special actions. Of course such a string does not always represent a valid path name, but that appears when you hit the link.
A string starting with '~/' followed by one or more characters is also recognized as a link to a file or folder; such as ~/pictures/prettypicture.png.
In the same way hyperlinks to URL's are recognized: anything starting with http:// or https:// colors blue with underline.

I hope this is of assistance to you.

Erik

@davidbannon
Copy link
Member

davidbannon commented Mar 19, 2024

yes, you are right Erik, that must have been added after I stopped using it, or, at last stopped upgrading. I had a lot of problems with sync in particular and it got a bit worse with each update.

I'll have to think about cross platform implications, for windows users its '\' and and Windows (and to a lesser extent, Mac) users are strongly encouraged to not know where their files are by the OS. That does imply a GUI of some sort. I have already overloaded the link button [make a link; show backlinks] but maybe it would make sense to say that if the cursor is on a space and then a slash when link button (or keyshortcut) is pressed, we popup a file open dialog.

You and I (and most linux users) will be happy with the "just typ it in" approach and thats also possible.

I note that Tomboy does not check the viability of a link, just assumes the user knows what they want. Slower to test when marking up but I am conscious of what happens if someone sync their notes to a machine with different file structure. Going to need to thinking....

Not going to happen in 0.40 (shortly because of an openssl bug) but should make it into 0.41 I guess. A working beta in a month or so ...

Thanks for your help.

Davo

@davidbannon
Copy link
Member

davidbannon commented Mar 22, 2024

Erik, I was so interested in this idea, I decided to rush it through.
So, there is now a beta release at https://github.com/tomboy-notes/tomboy-ng/releases/tag/v0.39a
However, I am not completely happy with how it works, would value your input -

  • At present, I show a link for anything that has leading whitespace and then '/', '\', '~/' or '~\'. But I reckon few users who sync between linux and windows will have their files in exactly the same place so, I reckon its better to only show the ones that use the right directory separator for the OS in use ?
  • I don't think the rule about just starting a link with a backslash is enough to ensure notes are not sprinkled with unintended bad (or even good) links. I am considering a proper URL, eg file://.....

My browser only accepts local urls that are absolute, three backslashes, file:///home/dbannon/arm-rtl.txt. No place there for a tilde. So, for us, a simpler rule might be to drop the tilde and say that three slashes is absolute and only two is relative to $HOME ? So, for example, all the below refer to an image in a users Picture directory.

  • Windows : file://c:\Users\davo\OneDrive\Pictures\image.png or file://Pictures\image.png
  • Linux/Mac : file:///home/davo/Pictures/image.png or file://Pictures/image.png

(Note the way Microsoft are now sneaking their user's content onto OneDrive ? I had not noticed before ...)

Davo

@ErikZZZZZZ
Copy link
Author

ErikZZZZZZ commented Mar 26, 2024

Thanks for all the effort in such a short time, Davo.
After having downloaded and installed v0.39b, I connected TBNG to (a copy of) my notes. Observations:

  • existing links to files are not recognized;
  • this would imply that every existing link has to be prefixed by 'file://';
  • option to use abbreviated links, i.e. without '/home/user/' is attractive (less is more), but pasting a link into a note comes with '/home/user/' included;
  • links to URL's work fine;
  • if a link is in a bullet list, the bullet gets underscored as well.

My conclusion: a step in the right direction, but offers not enough continuity from TB Classic for me to step in; in addition the implementation of bullets is too much of a break with the way TB Classic works.

Kind regards, Erik

@davidbannon
Copy link
Member

Thanks Erik. My first draft used a link syntax similar to original Tomboy but for a number of reasons, including some feed back from others, I quickly revised it. The Tomboy syntax is too confusing for both users and system, being same as an internal note syntax. So, if its going to happen, it will definitely be that file:// url approach. Sorry if that does not suit you.

A lot more work need to go into how that syntax is created however. Just typing it is one way but most users will want some help.

David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants