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

add syntax for external file with relative path #1039

Closed
1 task done
champignoom opened this issue Sep 2, 2023 · 4 comments · Fixed by #1072
Closed
1 task done

add syntax for external file with relative path #1039

champignoom opened this issue Sep 2, 2023 · 4 comments · Fixed by #1072
Labels
feature Issues related to feature proposals. Please attach a module.

Comments

@champignoom
Copy link
Contributor

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

Currently one can specify an external file with `{file:///absolute/path}', but URI with file scheme can only represent an absolute path.

It would be nice if one can specify an external file with relative path as well, for example `{./relative/path/text.docx}'.

Help

Yes

Implementation help

No response

@champignoom champignoom added the feature Issues related to feature proposals. Please attach a module. label Sep 2, 2023
@github-project-automation github-project-automation bot moved this to added-updated-reopened in sorting neorg issue tracker Sep 2, 2023
@vhyrro
Copy link
Member

vhyrro commented Sep 9, 2023

Already doable! {/ myfile.docx} is a relative filepath by default :)

The file:// URI schema says in its specs that it only works with absolute filepaths, which is why the {/ } syntax is generally recommended instead

@vhyrro vhyrro closed this as completed Sep 9, 2023
@github-project-automation github-project-automation bot moved this from added-updated-reopened to done in sorting neorg issue tracker Sep 9, 2023
@champignoom
Copy link
Contributor Author

Sorry I wasn't clear that I was looking for a syntax that is opened with xdg-open. {/ myfile.docx} will be opened with neovim and is unreadable.

@vhyrro
Copy link
Member

vhyrro commented Sep 9, 2023

The {/ } syntax is also opened by xdg-open, however Neorg has an internal list of formats that it opens this way. currently i think pdfs and images are on that list only, so adding other things like docx would be useful. Either that, or we could approach the problem the other way around and open everything with xdg-open unless it's a known text format in which case it's opened by Neovim.

@champignoom
Copy link
Contributor Author

Or just add a an event like "hop-link-external" together with a keybinding, so that the users can open in either way they want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issues related to feature proposals. Please attach a module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants