User Tools

Site Tools


software:yaml

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
software:yaml [2025/05/27 14:52] ronsoftware:yaml [2025/05/31 15:02] (current) ron
Line 1: Line 1:
 +# YAML
 +
 +## multi-line strings
 copied from [Stack Overflow](https://stackoverflow.com/questions/3790454/how-do-i-break-a-string-in-yaml-over-multiple-lines) copied from [Stack Overflow](https://stackoverflow.com/questions/3790454/how-do-i-break-a-string-in-yaml-over-multiple-lines)
  
-|| header || header || +* `> → interior line breaks are stripped out, although you get one at the end. 
-item1 | item2 |+* `|`  → line breaks are preserved as \n 
 +* `>-` → like `>` but without trailing line break  
 +* `|-` → like `|` but without trailing line break 
 + 
 +In this table:  
 +\b means space character, \n means "newline character" except where noted.  
 +"Leading space" refers to an additional space character on the second line, when the first characters are only spaces (which establishes the indent).
  
 +^                                 ^ `> ^ `|`  ^ `>-` ^ `|-` ^ `>+` ^ `|+` ^    ^ `"`^ `'`^
 +| Spaces/newlines converted to:        |      |      |      |      |      |    |    |    |
 +| Trailing space                  |  \b  |  \b  |  \b  |  \b  |  \b  |  \b  |    |    |    |
 +| Leading space              | \n\b | \n\b | \n\b | \n\b | \n\b | \n\b |    |    |    |
 +| Single newline              |  \b  |  \n  |  \b  |  \n  |  \b  |  \n  | \b | \b | \b |
 +| Double newline              |  \n  | \n\n |  \n  | \n\n |  \n  | \n\n | \n | \n | \n |
 +| Final newline              |  \n  |  \n  |      |      |  \n  |  \n  |    |    |    |
 +| Final double newline      |  \n  |  \n  |      |      | \n\n | \n\n |    |    |    |
 +| How to create a literal:        |      |      |      |      |      |      |    |    |    |
 +| Single quote                   |  '              ' |  ' | '' |
 +| Double quote                   |  "              " | \" |  " |
 +| Backslash                   |  \    \      |  \    \    \    \ |`\\`|  \ |
 +| Other features                  |      |      |      |      |      |      |    |    |    |
 +| In-line newlines with literal \n|  🚫  |  🚫  |  🚫  |  🚫  |  🚫  |  🚫  | 🚫 | ✅ | 🚫 |
 +| Spaceless newlines with `\`   |  🚫  |  🚫  |  🚫  |  🚫  |  🚫  |  🚫  | 🚫 | ✅ | 🚫 |
 +| # or : in value           |  ✅  |  ✅  |  ✅  |  ✅  |  ✅  |  ✅  | 🚫 | ✅ | ✅ |
 +| Can start on same line as key    🚫  |  🚫  |  🚫  |  🚫  |  🚫  |  🚫  | ✅ | ✅ | ✅ |
  
software/yaml.1748357573.txt.gz · Last modified: 2025/05/27 14:52 by ron

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki