10 ms·
foo: | bar baz This quote style in YAML is its best feature, IMO. It's not massively useful for k8s outside of config maps, but for other uses of YAML
by barrkel 6y ago
foo: |
bar
baz
This quote style in YAML is its best feature, IMO.
It's not massively useful for k8s outside of config maps, but for other uses of YAML, it's great for embedding snippets of other languages that would otherwise need quoting.
- realshadow 6y agoKeeping up with indenion is a pain the ass when your config file is large
- barrkel 6y agoFolding and highlighting in the editor make it much easier. I use yafolding minor mode in Emacs, it folds based on indentation level, and it handles indentation-oriented syntaxes like Python and YAML as well as block-oriented syntaxes like C, Java, JS and Ruby. yaml-mode in Emacs highlights :| text in the quoted string highlight colour, so it's easy to see you're still in the block, or whether you've unindented your way out to the YAML again. I generally try and split out my yaml such that the quoted blocks don't need to be enormous, though. So, single SQL statements, rather than a whole SQL script, to take one motivating example. I also use highlight-indentation-current-column mode, for an extra visual aid.