-
Notifications
You must be signed in to change notification settings - Fork 14
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
Wiki style links #34
Comments
Definitely one of my favorite features of NValt. Not sure how difficult it will be to implement in an Atom package but could definitely be a fun project to explore. |
I found similar functionality in awiki perhaps a similar implementation could be made in nvatom. There are also several packages on atom.io which use the fuzzy finder to match local files from the string under the cursor. So perhaps an implementation would be to grab text between bounding brackets I think this is the action of the search box, so perhaps it's just a directive to bypass the search box when there are bounding brackets, thereby using the current query method... but triggering that method directly from a keybind, using the current string. |
Started working on it. https://github.com/seongjaelee/nvatom/tree/feature-34 I think the basic features you described are there. One thing I had to decide is to whether to use absolute interlink or relative interlink, and I decided to use the former. For example, Car/Hyundai.md containing [[Blue]] will lead to Blue.md, not Car/Blue.md. The latter would be harder to counter-reference all interlinks when moving/renaming a file. If you think this policy should be changed, let me know. I need to
|
Wow, You're fast! 🏃💨 Many thanks. So to make sure I understand how it's built, given a notes directory of:
The link of After giving it some thought, I think your decision makes sense. It assumes the most common usage is for the majority of notes to exist within the root notes directory, with some sub-folders used on occasion. I think this assumption is correct. Given that most users default to the root folder, interlinks should do so as well, and if the user wants to reference a relative file, then input the full path like so:
Am I correct in my understanding? Also, I tried to update to feature-34 but it keeps throwing this error. |
@xhn35rq Yes you are right. I think nvalt does not have directory structure, it automatically uses absolute (to the note directory) interlink. Thanks for trying it out already. =) I'll fix the bug soon. |
I think I fixed the bug. Thanks for the testing again! 👍 |
Correct. Thanks for fixing the bug I'll start dog-fooding on Feature 34. |
The linking works fine so far, however:
|
Just had a thought: the switch to |
I think I fixed this syntax coloring problem. It only applies this interlink open/highlight feature under the note directory. Auto-updating other links - I didn't implement it. nvalt also does not do that. It would be nice to have, but I think it is beyond my skill yet. I'll create another issue for this. For the case sensitivity, this is an interesting bug. I'll follow the precedence of nvalt.
|
Thanks, I'll test it out! 👍 Re: case insensitivity just to clarify the bug that I found: after following a link, renaming a file from within Atom doesn't rename but instead duplicates the file you're trying to rename. The old file retains the current name, while the new file is given the name you enter into the "Rename" field. This bug was supposed to be fixed but is re-triggered after following an Sorry if that was duplicate information, I just wanted to make sure I had clearly outlined the bug.
I can create both |
Oh... then we have two options.
Choosing 1: I think people would prefer using case insensitive format. nvalt also does this. For example, it is common to mix cases in wiki, as if these keywords are used in a normal sentence. For example,
Choosing 2: If we have I think 2 is more intuitive to users. What is your thought? |
I think case insensitivity makes sense, so 1 is more intuitive to me. If I want to define between notes, I give notes different names, rather than giving them the same name with different cases. Trying to differentiate between notes with cases doesn't make sense to me. I'm curious why you think 2 is more intuitive. |
Case insensitivity is option 2, not 1. The reason I chose 2 is,
|
Ah ok, I see what you mean. What I meant to say is "do whatever nvalt does" 😄 I thought that's what you meant by 1. Also, I had another thought about |
"The duplicate notes" is only for the case we have multiple case insensitive files (e.g., Car.md and car.md). I think introducing this behavior for such exceptional cases is an overkill.
I came with some edge cases on this behavior:
A modified behavior I can think of is, just do the lowercase exact title matching on existing files. If we have multiple of them, then pop up a selection window. In this case, if we have Worldmap.md, World.md, world.md, then [[WORLD]] will pop up a note selection window with World.md and world.md, and [[WorldMap]] will open Worldmap.md. However... I think this is still an expensive feature for an overly exceptional case.
I think assuming the first line of markdown doc to be a title might be too bold. Some people might use multimarkdown format with headers something like,
For my case, I sometimes omit adding title on the first line. |
All good points, thanks! Also, I just realized that @jonmagic mentioned using a file-watcher such as chokidar to monitor the note root directory, so the |
Great discussion here. I like the conclusion, start simple 👍 Down the road if we hit edge cases that affect a lot of people we can iterate. |
I did think of a situation where querying the database would be helpful when following a note-link. I've become aware that some people create a specific ID for each note, for example But this does feel like an edge case as I'm not sure how many people use this method to link notes. As an aside, this method does offer an alternative way of keeping links up-to-date between notes, without needing to manually or automatically re-write all links in every note. |
Wiki style links added in v0.9.1 release - thank you @seongjaelee 🏆 😄 |
Thanks for suggesting the feature and following up this issue! =) (I forgot to answer your last comment... I thought it was an interesting idea for those who names the file with that rule, but I didn't want to force such a rule to the users. And, as long as the feature is not supported from nvalt, I would put its priority low.) |
I think that is a smart decision. Thanks for the followup |
Do you plan to wiki style interlinking between notes? This would support direct jumping between notes without loading the title into the search box. I think Nvalt has this feature. My apologies, I am not at a point with Coffeescript to where I could submit a pull request. Thanks!
The text was updated successfully, but these errors were encountered: