question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FR: Format YAML Arrays

See original GitHub issue

I would like a feature that unwraps yaml collections in frontmatter (per example 2.3 here). This was an option on an older obsidian linter.

Example:

---
tags: [red, yellow, green]
aliases: [Note, 'Note , Comma', BigNote]
===

would convert to:

---
tags:
  - red
  - yellow
  - green
aliases:
 - Note
 - Note , Comma
 - BigNote
---

The dataview plugin allows arbitrary fields in frontmatter, so this functionality would not be limited to fields recognized by Obsidian. (Perhaps there would be an option to list the fields that should be unwrapped)

Describe Alternatives You’ve Considered

I have not been able to think of any alternatives other than manually doing this.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
pjkaufmancommented, Jul 15, 2022

Seems to also take care of https://github.com/platers/obsidian-linter/issues/172 as well.

1reaction
pjkaufmancommented, Jul 15, 2022

Gotcha. I thought you were saying Obsidian Lint did make these kinds of changes prior. I will see what can be done around this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

YAML - Array & collection - W3schools.io
An array is a group of similar values with a single name. In YAML, Array represents a single key mapped to multiple values....
Read more >
YAML Arrays - Linux Hint
In YAML, an array may be defined in two ways. Each element is defined on a single line in the standard style, and...
Read more >
YAML Multi-Line Arrays - Stack Overflow
A YAML array can be represented as: ['key1', 'key2', 'key3'] . A YAML sequence uses a dash followed by a space and then...
Read more >
How to represent arrays in YAML - Educative.io
The block sequence style of YAML uses hyphens or dashes to ( - ) to represent arrays. A hyphen ( - ) followed...
Read more >
The YAML Format (Symfony Docs)
A YAML file is rarely used to describe a simple scalar. Most of the time, it describes a collection. YAML collections can be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found