পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Monday, February 20, 2017

Grav - YAML Syntax

The YAML stands for YAML Ain't Markup Language which includes human readable content and often used in configuration files, blueprints (metadata information about resource) and page settings.

Features

Following are the features of YAML:
  • Compare to XML or JSON, YAML is less complex and provides same features.
  • It provides configuration settings without need to learn complex code types such as CSS, JavaScript or PHP.
  • YAML is very simple which describes data and content of the YAML file can be easily translated to multiple language types.

Basic Rules of YAML

There are some basic rules of YAML which are used to reduce the ambiguity in multiple languages and editable programs.
  • You must end the YAML files with .yaml extension.
  • YAML must be case sensitive.
  • YAML doesn't support use of tabs. Instead of tabs, it uses spaces which are not supported universally.

Basic Data Types of YAML

YAML supports some basic data types which can be used with programming languages such as:
  • Scalars: strings or numbers.
  • Sequences: arrays or lists.
  • Mappings: hashes or dictionaries.

Scalars

Scalars are the basic data types which uses strings or numbers on the pages to work with the data. It may be a boolean property (either yes or no), integer value such as 2 or string of text such as word or sentence or title of the website.
For instance:
string: "Grav"
integer: 10
float: 10.5
boolean: true
Sometimes scalars comes with unquoted values like integer, float or boolean. The string value uses punctuation which comes with single or double quotation marks which uses escaping to specify ASCII and Unicode characters.

Sequences

YAML represent sequences in the form of arrays or lists. It defines the each item with opening dash(-) placed in the list as shown below.
For instance:
- Apple
- Orange
- Grapes
Suppose if you want to define nested sequence with the sub items, and then place a single space before each dash in the sub items.
For instance:
-
 - Apple
 - Orange
 - Grapes
If you want nested sequence within the nested list then add some levels as shown below:
For instance:
-
 -
  - Apple
  - Orange
  - Grapes

Mappings

It is a way of defining keys along with the values.
For example, you can assign some value to a specific element as:
Sports: cricket
Here the value is "cricket" that maps with the key called "Sports". You can use this mapping with the sequence to specify list of items for cricket. Say for example, we will define some player names for the value "cricket" making names as child and Sports: cricket as parent.
Sports: cricket
- Sachin Tendulkar
- Rahul Dravid
- M S Dhoni

No comments:

Post a Comment