blacksmithgu / datacore

Work-in-progress successor to Dataview with a focus on UX and speed.
MIT License
1.25k stars 11 forks source link

Support for linked inline fields #10

Open dleeftink opened 1 year ago

dleeftink commented 1 year ago

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 commented 9 months ago

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

dleeftink commented 9 months ago

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,

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.