octalmage / Marknote

Markdown Note Taking.
36 stars 13 forks source link

Add internal link support. #3

Closed octalmage closed 10 years ago

octalmage commented 10 years ago

Modify link behavior to allow linking to other notes.

octalmage commented 10 years ago

Started here:

https://github.com/octalmage/Marknote/blob/master/app.js#L10

octalmage commented 10 years ago

In 8154d1d I add internal links using Test. The uri will match anywhere in the notes title. For example

[Test](internal://Te)

Would match a post with the title "Test", or "Testing".

Started adding support for links using only the title like,

[Test](test)

but I ran into issues with escaping the markdown for regex. The line with the issue can be found here.

and it looks like I can use this solution!:

octalmage commented 10 years ago

I guess we need to decide how we want to do this. Is using internal:// acceptable? I wonder if we'll run into any issues in the future. Once issue I see right now is this could conflict with links that don't include http(s). Currently I detect it's not a URL by matching "://" and matching by TLD isn't the cleanest option since new TLD are getting added all the time.

IDK.

mjchamplin commented 10 years ago

I definitely feel like we may need a unique syntax here. Could we do something shorter than internal://?

[Test](note://title) or maybe even [Test](note:title)?

octalmage commented 10 years ago

Yeah note:// is fine! I think it needs the :// to be converted to a link.

But with my pre-processor I implemented just test. So if you think that's worth doing, I can make it happen! I'll fix it up anyway then we can decide.

mjchamplin commented 10 years ago

Sounds good! I'll be working on the UI tomorrow.

octalmage commented 10 years ago

I fixed the clean links in 8477dc6!

Now [Test](Note title) works.

octalmage commented 10 years ago

I'm going to close this, we can reopen it if there are any conflicts.