From: Clark C. E. <cc...@cl...> - 2004-05-01 20:14:44
|
The use case was to allow a file to be 'embedded' in YAML. However, this is quite easy with sed, so there really isn't a need for this construct. $ sed 's/^/ /' embedd.txt >> file.yaml ;) Clark On Sat, May 01, 2004 at 09:30:19PM +0300, Oren Ben-Kiki wrote: | > | Or another one closer to heredoc which perl and php are used to: | > | - ginving another url: |<< | > | http://www.another-url.org/this_link_is_far_too_long_... | > | << | > | > This is our most frequently proposed feature. I suppose that it | > isn't any more ugly than double quoted strings... Brian/Oren? | We have considered this, at one time. You can have the same effect by | using an indented literal scalar. The benefit of the "terminated" style | is that you don't need to indent the scalar. From a YAML point of view, | that's a disadvantage; the document structure becomes much less visible. | | It almost seems as though this should be a flow style rather than a | block style, since it uses a marker rather than indentation to denote | structure. The following doesn't make much sense, though: | | --- | some: | flow: { terminated: <<EOF | Text | EOF} | ... | | Perhaps if someone comes up with a use case where indenting the text is | a problem? The problem isn't long lines (for these, you need to use | double quotes anyway). Admittedly, indenting literal scalars costs | screen real estate, but they have to be pretty deeply nested for this to | make a real difference (you can indent each level by just one space if | you want). |