YAML Comments - YAML

What are YAML Comments?

Since you are OK with the sentence structure and syntax and basic of YAML, let us continue further into its details. In this part, we will perceive how to utilize comments in YAML.

YAML supports single line comments. Its structure is clarified below with the assistance of a example −

YAML does not bolster multi line comments. On the off chance that you need to give comments to various lines, you can do as such as appeared in the example below –

Features of Comments

The features of comments in YAML are given below −

  • A commented block is skipped amid execution.
  • Comments help to include depiction for indicated code block.
  • Comments must not show up inside scalars.
  • YAML does exclude any approach to get away from the hash image (#) so inside multi-line string so there is no real way to isolate the comment from the crude string value.

The comments inside a gathering are appeared below –

The shortcut key for commenting YAML blocks is Ctrl+Q.

On the off chance that you are utilizing Sublime Text editor, the means for commenting the block are referenced below −

Select the block. Use "CTRL +/" on Linux and Windows and "CMD+/" for Mac operating system. Execute the block.

Note that similar advances are pertinent in the event that you are utilizing Visual Studio Code Editor. It is constantly prescribed to utilize Sublime Text Editor for making YAML files as it upheld by most operating systems and incorporates developer amicable alternate shortcut keys.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

YAML Topics