yaml / yaml-spec

YAML Specification
http://yaml.org/spec/
348 stars 54 forks source link

[feature request] alternative visual character to white space #309

Closed earizon closed 1 year ago

earizon commented 1 year ago

Yaml files can grow in size to the point that column identation are difficult to visualize.

Consider the use of an arbitrary character (for example '·') as an alternative to white space. This character must be translated to a white space at parse time. The only purpose is to offer visual aid in any working context (console, printed paper, ...). The idea to simply allow for things like:

key1:
   subkey1: ...
   ·  - a
   ·  - b
   ·  ·  - ...
   ·  ·  - ...
   ·  ·  - ...
   ·  ·  - ...
   ·  ·  - ...
   ·  ·  - ...
   ·  - c
   ·  ·  - ...
   ·  ·  - ...
   ·  ·  - ...
   ·  ·  - ...
   ·  ·  - ...
   ·  ·  - ...
   ·  - d
   ·  ·  - e
   ·  ·  ·  - ...
   ·  ·  ·  - ...
   ·  ·  ·  - ...
   ·  -f

  subkey2:
     - b
ingydotnet commented 1 year ago

This seems like something most modern editors can do. Or at least should do. And certainly you could apply a visualization filter like:

$ show-yaml-indent < foo.yaml | less

But adding this to the YAML language itself seems highly problematic.