Difference between revisions of "YAML Syntax"

From Ever changing code
Jump to navigation Jump to search
(Created page with "<source lang=yaml> host: host-1 datacenter: #mapping location: Poland #key-value mapping indentention cabinet: 13 roles: #list - web - dns </source>...")
 
Line 1: Line 1:
<source lang=yaml>
= Styles =
{| class="wikitable"
|+ YAML syntax styles
|-
! Block style
! Flow style
|- style="vertical-align:top;"
| Human frendly, less compact
| An extension of JSON, foldinf long lines, tags and anchors
|-
| <source lang=yaml>
host: host-1
host: host-1
datacenter:        #mapping
datacenter:        #mapping
   location: Poland #key-value mapping indentention
   location: Poland #key-value mapping indentention
   cabinet: 13
   cabinet: 11
roles:            #list
roles:            #list
   - web
   - web
   - dns
   - dns
</source>
</source>
| <source lang=yaml> host: "host-1"
datacentrer: { location:
  Poland , cabinet: 11 }
roles: [ web , dns ]
# {} kv mapping
# [] list (array)
</source>
|}


= Characters =
= Characters =

Revision as of 08:56, 6 August 2019

Styles

YAML syntax styles
Block style Flow style
Human frendly, less compact An extension of JSON, foldinf long lines, tags and anchors
host: host-1
datacenter:        #mapping
  location: Poland #key-value mapping indentention
  cabinet: 11
roles:             #list
  - web
  - dns
host: "host-1"
datacentrer: { location:
  Poland , cabinet: 11 }
roles: [ web , dns ] 
# {} kv mapping
# [] list (array)

Characters

  • Printable Unicode
  • Unsupported symbols
    • C0/C1 blocks
      • Exceptions: Tab, Line Feed, Carrage Return, Delete, Next line
    • Surrogates
  • Encoding: UTF-8, 16, 32
  • To be JSON compatibile must be UTF-32