Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
So far, we've looked at CSV, XML and JSON as data on the web solutions, all of which are text-based and all of which are fairly easy to read. In this chapter, we'll examine another entry in the data on the web sweepstakes, one that relies on visual spacing to provide structure. I am, of course, referring to YAML. The YAML does not, as some would think, stand for Yet Another Markup Language. Rather, it's a recursive acronym that's short for, YAML Ain't Markup Language because so little markup is actually used.
It was first proposed in 2001 and created by the wonderfully named Ingy dot Net, along with partners Clark Evans and Oren Ben-Kiki. You can find the latest version as well as reference material at the yaml.org site. Don't be taken aback by the purely textual page, the page itself is written in YAML format. The creators of YAML refer to it as a Human-readable data serialization standard. Which, ironically, is somewhat less human understandable than YAML code itself.
Here, we're seeing a user with a first name, last name, and state specified. Notice the complete lack of quotes and how quickly you can grasp what's going on. YAML unlike many markup languages which are white space agnostic, uses positioning for structure and simple characters as delimiters. Specifically, structure is determined by indentation using spaces, not tabs. That's important. The name value pairs, or as they are called in YAML, key value pairs, are separated by a colon.
As noted before, strings don't require quotes. Although in some cases, like a zip code, you might want to use them to distinguish your string from a number. To indicate a list item, you use a hyphen, which just coincidentally is how I write out my list by hand so it makes a lot of sense to me. The indented structure, because it doesn't use any delimiters that you have to escape, is great for including other code like HTML, XML, or JSON and it can all be included as a YAML data object.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 92190 Viewers
82 Video lessons · 104058 Viewers
71 Video lessons · 75386 Viewers
56 Video lessons · 106759 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.