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

autocomplete for keywords in YAML frontmatter #4070

Open
7 tasks done
h-larsson opened this issue Jan 19, 2023 · 6 comments · May be fixed by #4519
Open
7 tasks done

autocomplete for keywords in YAML frontmatter #4070

h-larsson opened this issue Jan 19, 2023 · 6 comments · May be fixed by #4519
Labels
feature This is a completely new feature for Zettlr.

Comments

@h-larsson
Copy link

h-larsson commented Jan 19, 2023

Checklist

  • Zettlr does not possess this feature (if it does, but the feature doesn't work out for you, propose an enhancement instead.)
  • Zettlr's current features cannot be used to approximate this behaviour (otherwise, propose an enhancement instead.)
  • I have searched the documentation to make sure I did not overlook it.
  • I have searched both open and closed issues to see if someone has already proposed this.

Feature Proposal

Autocomplete for keywords in YAML frontmatter would be great. It already works for tags and

Example Workflow

Write

---
title: "Welcome to Zettlr!"
keywords:
  - general
...
#genius 

in file1.md.
Start writing

---
title: "Welcome to Zettlr! 2"
keywords:
  - gen
 ...

in file2.md and getting autocomplete suggestion for gen to either general or genius.
(As far as I understand, tags and keywords are treated the same way. If that is not the case, the autocomplete should only suggest general).

Caveats

I cannot think of any.

Do you wish to attempt implementing this yourself?

No

Platforms

  • Windows
  • macOS
  • Linux

Additional Information

(I only tested this on linux with version 2.3.0 UUID: f77f0308-2ef0-4327-875a-0679c5d8c261)

@h-larsson h-larsson added the feature This is a completely new feature for Zettlr. label Jan 19, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 19, 2023

Thanks so much for opening up your first issue here on the repository! 🎉 We would like to warmly welcome you to the community behind the app! ☺️ We'll check in soon and have a look at your issue. In the meantime, you can check your issue and make sure it aligns with our contribution guidelines! Here's the comprehensive list:

Enhancements

An enhancement takes a feature and improves or alters its behaviour. Please make sure to argue how your proposition will aid non-technical text workers, and why it can't be emulated easily with other features or apps!

Feature requests

Feature requests introduce whole new features into the app. This requires a lot of work, so these might be turned down if the implementation costs supersede the benefits we expect to see from implementing it. Please do not be disappointed if that happens. It likely has nothing to do with your great request but simply with us and our missing resources!
You can of course always ask someone to implement this feature, because a PR with a working new feature has much higher chances of being merged! :)

Bug reports

Please note that one of the main reasons for why bug reports cannot be addressed is that there's not enough information for us to find and fix the bug you describe, so make sure you try to pinpoint the bug as close as possible.
The ideal bug report for us has two qualities:

  1. The bug is always reproducible, at least within a certain context. 2. We know exactly what specifically goes wrong, and there is consensus on
    what should happen instead.

Please note that if you encounter behaviour that does not align with your expectations of what would happen, this might as well be simply intended behaviour and we need to simply clarify why the behaviour is the way it is. This is not to be considered a bug and such issues may be closed! Suggest an enhancement instead!
But now, have a great day and thank you again!

@h-larsson
Copy link
Author

According to boring-cyborg, this is not a feature request but an enhancement. How can I change the label?

@exanrauzer
Copy link

exanrauzer commented Jan 19, 2023

This is tricky case. The main difference between tags and keywords is that keyword can 'contain' two or more words (long-tail keyword), and tag can't (#or-it-can-like-that).

I think it could be considered if a keyword in yaml, for example: knowledge management software could be taken as the same as #knowledge-management-software in text itself. Or maybe allow: #[knowledge management software] syntax, or other way. Or maybe the searching mechanism would spot on both phrases whichever would be typed for search.

But i feel that keyword is not the same 'thing' as tag. Tag is rather a: link and label. And keyword is rather a... keyword, or even category(!) or container(!) - tells about the context of a text. You can have technical (functional) tags like: #draft #new #fix #dillemma which doesn't say anything about the context so I wouldn't put them in the same basket with keywords.

@h-larsson
Copy link
Author

Thanks for the explanation. This may be a separate issue, but then I find it confusing that keywords do seem to be converted to tags -- they appear in the tag cloud as well as in the file manager. So to some extend the #[knowledge management software] syntax is already implicitly used.

keyword

@exanrauzer
Copy link

exanrauzer commented Jan 19, 2023

Yes, well spotted. So they are converted/combined with tags, however it is the end of the road. You cannot use the multi word tag created by keyword in text (body text). They are suggested but you cannot use them - they are broken. For example: #knowledge management software tag created by the keyword splits into three words with a <#> before the first one. Anyway this is not the point of your issue, sorry for digressions!

You suggest that autocompletion for keywords in yaml would be great, but what you literally suggest is to have autocompletion suggestion start working after hypen, space and first typed letter, right?

@h-larsson
Copy link
Author

Yes, thanks for the clarification. Sorry, I realized there is a typo in the issue. I'll change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is a completely new feature for Zettlr.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants