Blame | Last modification | View Log | Download
--- %YAML:1.0test: Stringsbrief: >Any group of characters beginning with analphabetic or numeric character is a string,unless it belongs to one of the groups below(such as an Integer or Time).yaml: |Stringphp: |'String'---test: String charactersbrief: >A string can contain any alphabetic ornumeric character, along with manypunctuation characters, including theperiod, dash, space, quotes, exclamation, andquestion mark.yaml: |- What's Yaml?- It's for writing data structures in plain text.- And?- And what? That's not good enough for you?- No, I mean, "And what about Yaml?"- Oh, oh yeah. Uh.. Yaml for Ruby.php: |array("What's Yaml?","It's for writing data structures in plain text.","And?","And what? That's not good enough for you?","No, I mean, \"And what about Yaml?\"","Oh, oh yeah. Uh.. Yaml for Ruby.")---test: Indicators in Stringsbrief: >Be careful using indicators in strings. In particular,the comma, colon, and pound sign must be used carefully.yaml: |the colon followed by space is an indicator: but is a string:right heresame for the pound sign: here we have it#in a stringthe comma can, honestly, be used in most cases: [ but not in, inline collections ]php: |array('the colon followed by space is an indicator' => 'but is a string:right here','same for the pound sign' => 'here we have it#in a string','the comma can, honestly, be used in most cases' => array('but not in', 'inline collections'))---test: Forcing Stringsbrief: >Any YAML type can be forced into a string using theexplicit !!str method.yaml: |date string: !!str 2001-08-01number string: !!str 192php: |array('date string' => '2001-08-01','number string' => '192')---test: Single-quoted Stringsbrief: >You can also enclose your strings within single quotes,which allows use of slashes, colons, and other indicatorsfreely. Inside single quotes, you can represent a singlequote in your string by using two single quotes next toeach other.yaml: |all my favorite symbols: '#:!/%.)'a few i hate: '&(*'why do i hate them?: 'it''s very hard to explain'entities: '£ me'php: |array('all my favorite symbols' => '#:!/%.)','a few i hate' => '&(*','why do i hate them?' => 'it\'s very hard to explain','entities' => '£ me')---test: Double-quoted Stringsbrief: >Enclosing strings in double quotes allows youto use escapings to represent ASCII andUnicode characters.yaml: |i know where i want my line breaks: "one here\nand another here\n"php: |array('i know where i want my line breaks' => "one here\nand another here\n")---test: Multi-line Quoted Stringstodo: truebrief: >Both single- and double-quoted strings may becarried on to new lines in your YAML document.They must be indented a step and indentationis interpreted as a single space.yaml: |i want a long string: "so i'm going tolet it go on and on to other linesuntil i end it with a quote."php: |array('i want a long string' => "so i'm going to "."let it go on and on to other lines "."until i end it with a quote.")---test: Plain scalarstodo: truebrief: >Unquoted strings may also span multiple lines, if theyare free of YAML space indicators and indented.yaml: |- My little toe is broken in two places;- I'm crazy to have skied this way;- I'm not the craziest he's seen, since there was always the German guywho skied for 3 hours on a broken shin bone (just below the kneecap);- Nevertheless, second place is respectable, and he doesn'trecommend going for the record;- He's going to put my foot in plaster for a month;- This would impair my skiing ability somewhat for theduration, as can be imagined.php: |array("My little toe is broken in two places;","I'm crazy to have skied this way;","I'm not the craziest he's seen, since there was always "."the German guy who skied for 3 hours on a broken shin "."bone (just below the kneecap);","Nevertheless, second place is respectable, and he doesn't "."recommend going for the record;","He's going to put my foot in plaster for a month;","This would impair my skiing ability somewhat for the duration, "."as can be imagined.")---test: 'Null'brief: >You can use the tilde '~' character for a null value.yaml: |name: Mr. Showhosted by: Bob and Daviddate of next season: ~php: |array('name' => 'Mr. Show','hosted by' => 'Bob and David','date of next season' => null)---test: Booleanbrief: >You can use 'true' and 'false' for Boolean values.yaml: |Is Gus a Liar?: trueDo I rely on Gus for Sustenance?: falsephp: |array('Is Gus a Liar?' => true,'Do I rely on Gus for Sustenance?' => false)---test: Integersdump_skip: truebrief: >An integer is a series of numbers, optionallystarting with a positive or negative sign. Integersmay also contain commas for readability.yaml: |zero: 0simple: 12php: |array('zero' => 0,'simple' => 12,)---test: Positive Big Integerdeprecated: truedump_skip: truebrief: >An integer is a series of numbers, optionallystarting with a positive or negative sign. Integersmay also contain commas for readability.yaml: |one-thousand: 1,000php: |array('one-thousand' => 1000.0,)---test: Negative Big Integerdeprecated: truedump_skip: truebrief: >An integer is a series of numbers, optionallystarting with a positive or negative sign. Integersmay also contain commas for readability.yaml: |negative one-thousand: -1,000php: |array('negative one-thousand' => -1000.0)---test: Floatsdump_skip: truebrief: >Floats are represented by numbers with decimals,allowing for scientific notation, as well aspositive and negative infinity and "not a number."yaml: |a simple float: 2.00scientific notation: 1.00009e+3php: |array('a simple float' => 2.0,'scientific notation' => 1000.09)---test: Larger Floatdump_skip: truedeprecated: truebrief: >Floats are represented by numbers with decimals,allowing for scientific notation, as well aspositive and negative infinity and "not a number."yaml: |larger float: 1,000.09php: |array('larger float' => 1000.09,)---test: Timetodo: truebrief: >You can represent timestamps by usingISO8601 format, or a variation whichallows spaces between the date, time andtime zone.yaml: |iso8601: 2001-12-14t21:59:43.10-05:00space separated: 2001-12-14 21:59:43.10 -05:00php: |array('iso8601' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ),'space separated' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ))---test: Datetodo: truebrief: >A date can be represented by its year,month and day in ISO8601 order.yaml: |1976-07-31php: |date( 1976, 7, 31 )