Open In App

How to block comments in YAML ?

YAML is a human-friendly data serialization standard for all programming languages. It is commonly used for configuration files and in applications where data is being stored or transmitted.

The Normal Way for commenting in YAML is Inline commenting with the “#” symbol, however, if you want to comment blocks then we have a list of ways in which it can be done.



Step 1: Select the block

Step 2: Press cmd plus / on Mac or press ctrl plus / on Linux & Windows.

Note: This method works on the following editors –



At any level of the code, you may add a new block text named like “Description” or “Comment” or “Notes” or whatever that you wish

Example:

Instead of
# This comment
# is too long

use
Description: >
This comment
is too long

or
Comment: >
This comment is also too long
and newlines survive from parsing!

Advantages:

Article Tags :