[Solved]: How do you do block comment in YAML?



Problem Statement:

Does anyone know how to comment a block of lines in YAML?

I know that you can make a single line comment in YAML by using the # tag, but I haven’t been able to find something like /* in java that starts a comment & has to be finished off with a */. Does such an operator exist in YAML?


Solution:

The YAML spec describes only one way of marking comments:

An explicit comment is marked by a “#” indicator.

That’s all. There are no block comments on YAML.



if You have Code Something like this:

---Time: 2001-11-23 15:01:42 -5User: edWarning:  This is an error message  for the log file---Time: 2001-11-23 15:02:31 -5User: edWarning:  A slightly different error  message.---Date: 2001-11-23 15:03:17 -5User: edFatal:  Unknown variable "bar"Stack:  - file: TopClass.py    line: 23    code: |      x = MoreObject("345\n")  - file: MoreClass.py    line: 58    code: |-      foo = bar


But if You want to put Block comment then I am showing you in Sublime Text.

1. Open Sublime Text and select the block of Code


2.  Press CMD +on Mac or CTRL +on Linux & Windows


3. That’s it. You are done.