News for hackers. Stuff that matters.
Re:RFC 9512: YAML Media Type by deathanatos on Wednesday February 21, 2024 @11:18AM (#39455707)
… really?

I feel like for multi-line strings, I almost always use |, and only |. It takes the indented block as-is, which I feel like is going to be what you'd want … always?

I think maybe once, ever, I used > to fold some whitespace…?

I know the chomping & indent indicators exist, but I feel like I've only ever seen those in programmatically generated YAML. I have trouble envisioning a real-world use-case that is going to make me pull them out. They're a facet of the language that feels as if it exists solely for a processor that might need to emit any possible string, which | would not permit, and the inline strings might be uglier.

That said … there is a post like yours in every YAML thread. But I think those of us that understand YAML … I'm having a hard time grokking what you're doing that causes consternation.

Re:RFC 9512: YAML Media Type by TomSwirly on Wednesday February 21, 2024 @11:48AM (#39456133)
> It takes the indented block as-is, which I feel like is going to be what you'd want … always?

What if you are writing primarily paragraphs?

What if you want extra blank lines at the end of a block? Or no carriage return at all?

In my reading, unscientifically I feel I see the `>` text formatter most often, then almost as often `|`, then `>-` occasionally, then `>+` just one time.

Re:RFC 9512: YAML Media Type by deathanatos on Wednesday February 21, 2024 @03:23PM (#39458984)
That's a big what-if, I guess. If you're okay with line wrapping … do line-wrapping & |, if you're not … don't do line wrapping & |?

I'm not usually putting prose into YAML, outside of comments. I think most of my blocks are scripts, small data files, long queries, the like. That's sort of why I was looking for a (perhaps non-hypothetical) use case.

Re:RFC 9512: YAML Media Type by neuromanser on Wednesday February 21, 2024 @04:44PM (#39460004)
> for multi-line strings, I almost always use |, and only |. It takes the indented block as-is

Except it doesn't. Try using

    steps:
      - run: |
          > f echo not redirected
in Github Actions.