yaml: adding line breaks

2021-07-25

 | 

~1 min read

 | 

135 words

As part of my project to create a personal wiki, I wound up modifying the frontmatter on nearly every one of my 900+ notes. This was because the tool I used, [nonplain.js](https://github.com/nonplain/nonplain.js has a perspective on which YAML format to use.

One of the consequences all of my titles were modified. Instead of:

example.md
---
title: "This is my really long title that tells a nice story because titles are a bit like APIs"
---

The tool modified it to be:

example.md
---
title: >-
  This is my really long title that tells a nice story because titles are a bit like APIs
---

This is a folding style. The extra - in >- means that there’s no trailing line break (\n) in the parsed line.

I love when tools teach me things!



Hi there and thanks for reading! My name's Stephen. I live in Chicago with my wife, Kate, and dog, Finn. Want more? See about and get in touch!