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

Supporting YAML frontmatters for metadata #1

Open
2 of 3 tasks
mickael-menu opened this issue Feb 27, 2021 · 14 comments
Open
2 of 3 tasks

Supporting YAML frontmatters for metadata #1

mickael-menu opened this issue Feb 27, 2021 · 14 comments
Labels
enhancement New feature or request
Milestone

Comments

@mickael-menu
Copy link
Member

mickael-menu commented Feb 27, 2021

Many Zettelkasten use a YAML frontmatter to provide note metadata, e.g.:

---
title: Improve the structure of essays by rewriting
date: 2011-05-16 09:58:57
keywords: [writing, essay, practice]
---

zk only supports title, we should support the rest as well:

  • date for the creation date
  • keywords and tags for tags
  • unknown keys could be saved and indexed for targeted search

Neuron also supports unlisted: true which could be interesting to disable indexing of particular notes.

@mickael-menu mickael-menu added the enhancement New feature or request label Feb 27, 2021
@jin-ahn
Copy link

jin-ahn commented Dec 25, 2021

Hi! is the last task something that is still planned to be added? I am looking for the ability to use custom YAML keys for my own notes and have zk be able to search through for them.

@mickael-menu
Copy link
Member Author

I didn't plan to implement it yet but that could be interesting. Could you give me an example of frontmatter and how you would like to use it from the CLI?

@jin-ahn
Copy link

jin-ahn commented Dec 26, 2021


title: week 1
date: 2011-05-16 09:58:57
class: WR101
Professor: Dr Joe Smith
Reading: Smith 20-25
keywords: [writing, essay, practice]

I want to be able to do something where I find all notes from class 'wr101' or that have 'professor' as a keyword
I understand that technically I can just add Wr101 and Dr Joe Smith to tags or keywords to be searchable, but I also want the ability to categorize my notes based on certain custom fontmattee keys that it has (like my 'professor' example above)

@mickael-menu
Copy link
Member Author

Would something like this work?

zk list --metadata "professor:Dr Joe Smith"

or that have 'professor' as a keyword

For this, do you mean that zk list --metadata professor should match any note that has a professor metadata, no matter its value?

@jin-ahn
Copy link

jin-ahn commented Dec 29, 2021

Yes to both! Some of my notes are for classes, some of my notes are for work, so they don't always share the same metadata fields. I want to search based on a metadata field as a way to "categorize" my notes

@lyndhurst
Copy link

Hi,
I am just wondering if this is still a planned feature.
Thanks.

@mickael-menu
Copy link
Member Author

I don't have the bandwidth to work on zk anymore, so the project is in maintenance mode for now.

However if someone wants to contribute this particular feature, I'd be happy to help navigate the codebase and review a PR.

@lyndhurst
Copy link

Thanks for maintaining the application even though you are lacking the time, please keep it alive !

For now I manage to do my filtering with the regex match strategy. I have spent months migrating my notes to nvim and zk, and I am just starting to get into more advanced zk configuration. It might seem simple but there is actually a lot of possibilities there.

Anyway I do plan to try and get familiar with the code base for other aspects like fzf searches and actions, so when I do, and if I feel capable, I will keep your offer to review / help with a PR in mind.

Thanks again for your time and effort 👍

@gwicho38
Copy link

@tjex quick question -- is this issue and #446 closed as in 'will not complete'? Or was this functionality added?

If not, I'll give it a fair try since I think it'd be a nice thing to have and send a PR.

@mickael-menu
Copy link
Member Author

#446 was a duplicate of this issue as it was mentioned first here. It's not implemented at the moment.

@tjex
Copy link
Member

tjex commented Sep 16, 2024

@gwicho38 That would be awesome! I have frontmatter fields ready to be served up!
Feel free to submit a draft PR too if you get stuck or are unsure about something.

@gwicho38
Copy link

Sweet. May take you up on that. Cheers!

@gwicho38
Copy link

Created an issue in my 'zk' fork since I don't think I can assign it directly from here.

@tjex
Copy link
Member

tjex commented Sep 19, 2024

assign what? This isse on zk-org/zk would be the place to discuss. And you can reference this issue in your PR.

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

No branches or pull requests

5 participants