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

Index wikilinks in frontmatter strings #1066

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Maarrk
Copy link
Contributor

@Maarrk Maarrk commented Aug 27, 2024

This implements #1000

The link is indexed only if it is the full content of a string node (allowing for quotes and whitespace) to discourage writing essays in the frontmatter 😄

I added an explanation why the quotes are needed on YAML page, I can't think of a page to document that the feature exists at all, I think it's discoverable by looking at indexPage in SETTINGS

@Maarrk
Copy link
Contributor Author

Maarrk commented Aug 27, 2024

Short demo of what it allows, credit to Raphwriter

Zrzut ekranu z 2024-08-27 13-31-38

Zrzut ekranu z 2024-08-27 13-33-07

@Maarrk
Copy link
Contributor Author

Maarrk commented Aug 27, 2024

Would be nice to make them clickable, but I think that becomes a much larger feature, since they shouldn't hide the [[ ]] like links in normal text do when cursor is away. Same for tags in frontmatter.

Considering #736 this would be almost like another editor mode when inside frontmatter: different widgets, different autocomplete etc., I don't know how I would approach that. Hope this bit here helps

@zefhemel
Copy link
Collaborator

zefhemel commented Aug 28, 2024

I have this test page:

---
another: "[[nice page]]"
---
This is a nice page [[nice page]]!

```query
link where page = @page.name
```

I would expect 2 entries in link, one for the regular page link and one for the frontmatter. And sometimes I get this, but not always. I make a small edit, let it save and Alt-q and it's there, and sometimes it's not. Do you have any idea what could be going on here? Some sort of race condition?

Then, when I rename another page I would expect both these links to be updated, but that's also not happening. Perhaps it's related to this indexing not happening consistently though... Can you replicate this?

@Maarrk
Copy link
Contributor Author

Maarrk commented Aug 30, 2024

Funnily enough, it did work in a small test space, but in my main one, I can't get the frontmatter mention to show up at all. I will look into it more these days, thanks for the heads up 👍

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

Successfully merging this pull request may close these issues.

2 participants