silverbulletmd / silverbullet

The knowledge tinkerer's notebook
https://silverbullet.md
MIT License
2.52k stars 184 forks source link

Feature request: index wikilinks in frontmatter #1000

Closed Maarrk closed 3 weeks ago

Maarrk commented 3 months ago

Described in "Live" Wiki Links in Frontmatter - General - SilverBullet Community Community post.

Could be implemented by indexing text content of FrontMatter nodes, in a way similar to template code blocks: https://github.com/silverbulletmd/silverbullet/blob/75471fa86b8eeac62685ed8e6355aa68737b2d4d/plugs/index/page_links.ts#L128-L140

I also run into it previously, I wanted to get book authors this way, but backlinks wouldn't work from frontmatter. I think it's expected to work, since there already is page link autocompletion inside frontmatter now.

Should the page ref get a inFrontmatter field like asTemplate?

zefhemel commented 3 months ago

Sounds good. Question is how to detect wiki links. I'd suggest we follow the convention used in eg SETTINGS of expecting a "[[link]]" YAML value, you also get page completion that way. Note that values without those quotes are parsed by YAML as doubly nested links which is messy.

Maarrk commented 3 weeks ago

I believe it's closed with #1066