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

Show backlinks from :PROPERTIES: #41

Open
zetashift opened this issue May 24, 2024 · 7 comments
Open

Show backlinks from :PROPERTIES: #41

zetashift opened this issue May 24, 2024 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@zetashift
Copy link

So I have a reading list, with books for example:

* TOREAD Book Name
:PROPERTIES:
:author: [[id:734f176d-f598-460c-a2f9-c134e5d339ca][Author Name]]  
:END:

Now when I'm on the authors page I expect to see backlink to the that properties drawer/book name. Currently the quickfix window is completely empty.
Is it possible to do this or is there maybe a better way to organize this?

@chipsenkbeil
Copy link
Owner

Does orgmode support links in the properties drawer? This plugin uses nvim-orgmode to find links within a file and then index id links, so it would need to be handled upstream in that plugin to support links there. In the meantime, you'd need to include your link somewhere else (heading or body) for it to be available.

cc @kristijanhusak

@chipsenkbeil chipsenkbeil added the nvim-orgmode Issue is related to the nvim-orgmode plugin label May 24, 2024
@zetashift
Copy link
Author

So in Doom Emacs I can go to links in properties drawer, but from looking around this seems to be not-according-to-spec.

From: https://www.orgroam.com/manual.html

Org-roam relied on the obtained Org AST for the buffer to parse links. However, links appearing in some places (e.g. within property drawers) are not considered by the Org AST to be links. Therefore, Org-roam takes special care of additionally trying to process these links. Use org-roam-db-extra-links-elements to specify which additional Org AST element types to consider.

@chipsenkbeil
Copy link
Owner

chipsenkbeil commented May 24, 2024

If the org AST doesn't support links in property drawers by default, then I don't believe nvim-orgmode will support them, either.

I'm totally happy to have this feature added to this plugin, but can't guarantee I'll get to this myself. Happy to review a pull request, though!

@chipsenkbeil chipsenkbeil added help wanted Extra attention is needed and removed nvim-orgmode Issue is related to the nvim-orgmode plugin labels May 24, 2024
@zetashift
Copy link
Author

If the org AST doesn't support links in property drawers by default, then I don't believe nvim-orgmode will support them, either.

I believe that's completely fair!

I'm totally happy to have this feature added to this plugin, but can't guarantee I'll get to this myself. Happy to review a pull request, though!

Well it doesn't help that I'm new to orgmode/neovim as well :P.
I could atleast attempt it, I'm not sure where to start, wouldn't this require a change in the tree-sitter parser to identify links in the PROPERTIES drawer?

@kristijanhusak
Copy link

@zetashift
Copy link
Author

Oh that is pretty cool!

That would entail something like this:

  local ts_query = ts_utils.get_query([[
      (paragraph (expr) @links)
      (drawer (contents (expr) @links))
      (property_drawer (value (value) @links))
      (headline (item (expr)) @links)
  ]])

The (property_drawer (value (value) @links)) got added in?

@kristijanhusak
Copy link

@zetashift yes, something like that, but you would need to write the surrounding logic also to get the links for org-roam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants