-
Notifications
You must be signed in to change notification settings - Fork 25
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
empty key value #15
Comments
Hello @acepelon , you can use for note in notes:
note.metadata.remove_empty() Let me know if it does the job |
Thank you for the quick response. I apologize for my lack of python, but it tells me notes isn't iterable. ` notes.write() yielded:
|
If you update pyomd to the latest version (>= 0.7) this should be solved. Otherwise you can do: for note in notes.notes:
... |
Thank you for your patience. I didn't see a recent update to py-obsidianmd in git:
and I show the latest version of py-obsidianmd as: but regardless, your advice like this works great. I appreciate it!
|
Hi,
I apologize for my ignorance, but as I was trying this out, I discovered that when I do a remove, it removes the value but leaves the key:
notes.metadata.remove(k="tags",l="type/book",meta_type=MetadataType.INLINE)
for example leaves me with:
tags ::
I imagine I am just missing it, but I see this in the YT video as well. Is there an option to remove both key and value? I can run a sed like
sed '/:: *$/d' The\ Listening\ Book\ -\ by\ W.A.\ Mathieu.md
after the fact to remove it, but it seems like maybe removing the key if it has an empty value could be an option also? Would then potentially relate to #13 as well.
Thanks!
ACE
The text was updated successfully, but these errors were encountered: