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 · 8 comments
Open
2 of 3 tasks

Supporting YAML frontmatters for metadata #1

mickael-menu opened this issue Feb 27, 2021 · 8 comments
Labels
enhancement New feature or request
Projects
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 this to To do in zk via automation Feb 27, 2021
@mickael-menu mickael-menu added the enhancement New feature or request label Feb 27, 2021
@mickael-menu mickael-menu moved this from Backlog to In progress in zk Mar 12, 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 👍

@tjex tjex added this to the 0.15.0 milestone May 2, 2024
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
zk
In progress
Development

No branches or pull requests

4 participants