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

Support for linked inline fields #10

Open
dleeftink opened this issue May 15, 2023 · 2 comments
Open

Support for linked inline fields #10

dleeftink opened this issue May 15, 2023 · 2 comments

Comments

@dleeftink
Copy link

dleeftink commented May 15, 2023

I am wondering if the parser will support linked inlines:

[[ target-file#heading | topic :: weather ]]

I am working on a plugin that automatically appends/updates backlinks (and their surrounding context) to a specified #heading in a target-file. Above example for instance, would add/update the line topic :: weather in target-file.md under Heading.

It would be nice if the link alt text could be parsed on the 'sending' note without having to include additional parentheses inside the link for correct parsing. This way, the inline field is synchronised (i.e. pushed) from the 'sending' note to the 'target' note [1].

BTW, this already works in the 'sending' note when using GFM: [topic :: weather](target-file.md#heading).

[1]: In the future, possibly even two-way synced.

@blacksmithgu
Copy link
Owner

This does seem like an interesting format for inline fields. I can add support for parsing inline fields out of links.

@dleeftink
Copy link
Author

dleeftink commented Sep 15, 2023

The way I've setup the plugin is that it would push whatever alt text is provided in a link, if the linked note satisfies some user conditions (e.g. the linked file exists in a selected folder, its file name matches a regex, its contents include certain properties or headings). The only thing missing currently, is a way for Dataview to parse the Wiki-style links in the sending note.

For instance,

  • [[ target | property :: value ]] -> sends nothing to the target note, but Dataview ideally parses the alt text.

  • [[ target# | property :: value ]] -> inserts or updates the target note metadata property with value with the alt link text parsed by Dataview in the sending note. Notice how a # without heading suffix is recognised by the plugin as a linked inline field to be pushed to a target note's metadata section, with minimal link keystrokes required on the user end.

  • [[ target#heading | property :: value ]] -> inserts or updates the first target note inline property with value under Heading, with the alt link text parsed by Dataview in the sending note.

Additionally, the inline nesting level in the sending note is reflected in the target.md file as well, which allows for some interesting use-cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants