Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
YAML Comments
Next article icon

YAML Comments

Last Updated : 14 Dec, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report
YAML_Comments

Comments are used to prevent the execution of statements. Comments are ignored while the compiler executes the code. Comments are user-friendly as user can get explanations of code using comments.

Since you are alright with the sentence structure and fundamentals of YAML, let us continue further into its details. In this part, we will perceive how to utilize comment in YAML. Comment are utilized to depict meaningful message about life of code.  

There are two kinds of Comments.  

  1. Inline or single line comment
  2. Block level comment

YAML has the language structure uphold for inline remarks, yet not for block level Comment  

Inline comment: Inline comments are remarks proclaimed at the line of code, Hashtag image is utilized toward the beginning of the line to tell processor that it is comment.

Example:

# remarks Punctuation model in YAML document    or  #### #### comment model

These just determines as single line Comments. Each line of comment begins with hashtag image and clear space followed by portrayal. Each line ends with new line break.  

Block level Comment: Square Comments are to remark the various lines. YAML has no help for block Comment naturally, you can utilize numerous inline Comment  

# block level Comment model    # Comment line 1    # Comment line 2    # Comment  line 3

Significant notes of Comment in YAML: Comments are disregarded by yaml processor. It is helpful to report about the line of code, empowers designers life is straightforward, help easy route orders by various IDE

YAML underpins single line comment. Its structure is clarified beneath with the assistance of a model −

# This is single line comment.

Highlights of comments: The highlights of comments in YAML are given underneath -

  • A commented block is skipped during the execution of code.
  • Comments help to add portrayal for determined 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 it is highly unlikely to isolate the comment from the crude string esteem.

Example:

#comment 1  - Value line 1    #comment 2  - value line 2    #comment 3  - value line 3

The alternate way key mix for commenting YAML blocks is Ctrl+Q.

Note: The similar advances are suitable on the off chance. It is constantly prescribed to utilize Superb Word processor for making YAML documents as it upheld by most working frameworks and incorporates engineer neighborly easy route keys.


Next Article
YAML Comments

R

ritikkumartiwari
Improve
Article Tags :
  • HTML

Similar Reads

    HTML Comments
    HTML comments are used to add notes or explanations in the HTML code that are not displayed by the browser.They are useful for documenting the code, making it easier to understand and maintain.To add a comment, use the syntax <!-- your comment here -->. HTML<!-- This is a comment and will n
    4 min read
    C Comments
    The comments in C are human-readable notes in the source code of a C program used to make the program easier to read and understand. They are not a part of the executable program by the compiler or an interpreter.Example:C#include <stdio.h> int main() { // This is a comment, the below // state
    3 min read
    Comments in R
    In R Programming Language, Comments are general English statements that are typically written in a program to describe what it does or what a piece of code is designed to perform. More precisely, information that should interest the coder and has nothing to do with the logic of the code. They are co
    3 min read
    Solidity - Comments
    Comments are an important aspect of programming as they help in providing clarity and understanding to the code. They allow developers to document the code and explain its purpose, making it easier for others to read and maintain the code. Solidity, being a programming language, also supports the us
    4 min read
    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 comme
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences