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

Idea: Create links for things that do not exist. #135

Closed
mbriggs opened this issue Dec 27, 2021 · 3 comments
Closed

Idea: Create links for things that do not exist. #135

mbriggs opened this issue Dec 27, 2021 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@mbriggs
Copy link

mbriggs commented Dec 27, 2021

Been really been liking zk, trying to migrate off of craft.do.

Something I really like about craft is the ability to link to things that do not exist yet. I will create links for most nouns and ideas even if I don't have content yet to collect backlinks.

I feel like I can accomplish this today with what exists with some lua in nvim, but it will be kind of hacky, and I feel like this is something that could be better.

What I am thinking is a key to surround a selection with [[ ]]. If a diagnostic appears, call a function that:

  • captures the title in the wiki link
  • create new note with insertLinkAtLocation
  • capture the file name of the buffer
  • go back to the previous buffer
  • find the link inserted by zk
  • remove the extra set of [[ ]]
  • replace the file name with the captured title text

is this a use case that you think is a good idea? I would imagine it would be better (and maybe easier) to implement this in zk itself, maybe as a code action. If you are into it, I'll work on a PR instead of the above hacky lua function :)

@mickael-menu
Copy link
Member

Yes I thought of adding stuff to handle "ghost/virtual" notes, especially to see all the backlinks associated to it.

I'm not sure I understand exactly the steps you described though. There's already a code action to create a new note from a selection.

Do you want to add a code action to create a new note (including generating a filename) from an already existing [[title]] link in a note, if it is reported as "not found"?

@skbolton
Copy link
Contributor

Same as #28

@mickael-menu
Copy link
Member

Good point, thanks. I'll close this one as duplicate. Feel free to chime in in #28 @mbriggs

@mickael-menu mickael-menu added the duplicate This issue or pull request already exists label Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants