DEV Community

Cover image for That time when you thought you knew Y(A)ML šŸ˜µ

That time when you thought you knew Y(A)ML šŸ˜µ

alxizr on June 10, 2021

Hello everyone, Thank you for joining in for this article about YAML files. We will make it today a little lightweight tutorial about YAML configu...
Collapse
 
michaelcurrin profile image
Michael Currin • Edited

I recommend adding a link to the YAML homepage

yaml.org/

Also according to that site homepage, it stands for "YAML Ain't Markup Language", which is what you have in your cover image.

While your definition at the end of "Yet Another Markup Language" was correct up to around 2001 yaml.org/spec/history/2001-12-10.html

It's worth mentioning both in one paragraph. Also I wouldn't call it "YML" except when describing as an extension - .yml.

Collapse
 
alxizr profile image
alxizr • Edited

Added the link to the home page (again). It was actually there already but i can't understand why it disappeared

I wouldn't bother about the acronyms. The purpose is to know how to use it and not figuring out what it stand for in my opinion.

Collapse
 
michaelcurrin profile image
Michael Currin

A correction,

This is not valid YAML. YAML lint rejects it.

      description: "|"
        Awarded Green Car Journal's 2020 Green Car of the YearĀ®, 
        Corolla Hybrid even comes with an enhanced Hybrid Battery Warranty that lasts for 10 years from date of first use, 
        or 150,000 miles, whichever comes first
Enter fullscreen mode Exit fullscreen mode

So remove the quotes. For both | and >.

      description: |
        Awarded Green Car Journal's 2020 Green Car of the YearĀ®, 
        Corolla Hybrid even comes with an enhanced Hybrid Battery Warranty that lasts for 10 years from date of first use, 
        or 150,000 miles, whichever comes first
Enter fullscreen mode Exit fullscreen mode
Collapse
 
alxizr profile image
alxizr

Hi, thanks. The quotes were added actually by the dev.to engine that renders the code blocks. I will take a look how to escape the special characters.

Collapse
 
michaelcurrin profile image
Michael Currin

Some resources

  • Validators
  • Converters
    • JSON to YAML - useful to check your YAML data got interpreted as expected. The JSON will be verbose but precise/explicit.
Collapse
 
alxizr profile image
alxizr

Already exists, in the end of the article there is a link to a tool that i use, it is an online yaml validator

Collapse
 
michaelcurrin profile image
Michael Currin

Typo:

-Johnny
+Jonhnny
Enter fullscreen mode Exit fullscreen mode
Collapse
 
alxizr profile image
alxizr

Thanks. Fixed

Collapse
 
michaelcurrin profile image
Michael Currin

Thanks for the info - was interested to learn more about the anchors.

BTW you duplicated this line at the end "By the way, if you asked yourself"

Collapse
 
alxizr profile image
alxizr

Fixed as well

Collapse
 
alxizr profile image
alxizr

btw, stay tuned for my next article, hope to release it in the next 2 or 3 weeks. I do have a full time job at work and also as a parent. It is going to be all about docker compose and the use of anchors.