YAML fields issue

I have a collection that uses YAML headers (with no blank lines between the entries). This generally works fine (in terms of the fields being recognised by Notenik) but if a field’s longtext value closes with a blank line then - after the collection is refreshed - all fields below that new line are no longer recognised by Notenik and are shown as a long string as part of the body text. Side note: I am not knowingly adding the closing new line in the text field.

If i manually add a new line between all entries in the YAML section directly in my md files then Notenik once again recognises things correctly when i refresh the collection. However…

If i then make a change to a value in a note, save and refresh the collection, I find that Notenik has removed all of those blank lines in the YAML and the original issue returns.

My template file has spaces between the entries - not sure if that should affect things or not? It is the same template file as i shared here

This is causing me quite a few issues as it breaks all my mirrored files etc.

just to add a bit more to this…

Sometimes when Notenik reformats the YAML it adds a new --- where the new line was, resulting in that becoming the bottom of the YAML and not the next --- that is still in place but now part of the body.

It sounds like you are intentionally choosing YAML metadata instead of the Notenik format. Is this the case?

If so, then I’m wondering if you are successfully using the files with some other software as well?

To the best of my knowledge, YAML metadata was never really intended for use with what Notenik considers to be longtext fields: that is, YAML metadata fields were never intended to contain content formatted using Markdown.

So I’m wondering if you’re really doing yourself any favors by using YAML metadata.

the main favour is that it is a large batch of existing notes that i have. if i need to change the approach then i can but wasn’t aware of this shortcoming with YAML/Notenik.

The other advantage is that the metadata isn’t visible in the markdown preview/export of external editing apps.

Well, let me see what I might be able to do to accommodate…

if you can that would be great. otherwise i will switch to the notenik format as for this particular batch of notes i get way more out of what notenik can do than i can get elsewhere.

And just to double-check, when you look at your Collection settings, is the Preferred File Format set to YAML Frontmatter?

yes - it is set as YAML currently

Here I’ll point out a specific issue regarding YAML metadata parsing in Notenik. I have a folder in Notenik where I autmatically add my Kindle annotations. For this purpose I use kindle plugin for Obsidian. This plugin has a customizable template for a great control over added YAML metadata. My current issue is the plugin autmatically insert some other metadata for proper syncing between the Kindle and the designated folder. Belowe is an example of the generated markdown file.

---
title: A Great Book
author: Name Surname
index: Name Surname;
seq: 95.x
level: 2
kindle-sync:
  bookId: '12345'
  title: A Great Book
  author: Name Surname
  highlightsCount: 300
---
Body

The follwing kindle-sync: and following fields are automatically generated by the plugin and it is persistent, otherwise it will break the sync operation. Indentation is put by the plugin.

kindle-sync:
  bookId: '12345'
  title: A Great Book
  author: Name Surname
  highlightsCount: 300

As you’d notice, the YAML metadata has duplicate field entries; title and author. However, this autogenerated content is causing an issue in Notenik. Here are the screenshots:

Below are the screenshots from Obsidian and Typora respectively:

I wonder if there could be a fix for this, especially for the Notes list. All files generated by the plugin are shown with title: prefix.

My preferred file format is set to YAML. Although my main application is Notenik, I have to rely on YAML metadata for some interoperability between other apps and Notenik. Currently is use Omnivore and Kindle plugins for importing my highlights in to Notenik. For printing purposes I use Typora and Marked 2, which strip the YAML metadata before printing.

Hopefully there would be an “easy” way to fix this issue.

Thank you.

EDIT: By the way this is a minor gripe, since I can use alternative approaches for reading the highlights.

Try out the Notenik beta version 14.3.1 and let me know how this work for you.

EDIT: Ooops my bad, with excitement I forgot to download the newest beta and initially wrote that the issue had persisted !! I’ve deleted my previous comments.


Upon installing the latest beta (14.3.1) and subsequent testing issue with the note list has been resolved. Thank you for your efforts.

Correct me if I’m wrong, Notenik parses the second author / title fields which are the indented ones in YAML block generated by the Obsidian plugin.

Good, glad things are working for you! Yes, Notenik should now be parsing the Obsidian fields, and prefixing their field names with the Obsidian parent field name.

1 Like