0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

YAML書くときにちょっと思い出したいこと

Last updated at Posted at 2021-08-26

yaml書くときの備忘録です。

当たり前

aa

  • aaa
  • aa
  • タブ
    禁止。
    2個スペースでインデント打とう。

  • 配列のネスト

- aaa
-
  - b1
  - b2
  -
    - b3.1
    - b3.2
- ccc
  • ハッシュ

:のあとに半角スペースを 1 つ以上いれるのを忘れないで。

A: aaa
  • ハッシュの中のネスト
A: aaa
B:
  B1: bbb1
  B2: bbb2
C: 
  - ccc1
  - ccc2
  • [---]

---で区切ることで、ひとつのファイルに複数の YAML ドキュメントを含めることができる

---
name: a_name
---
name: b_name
---
name: c_name

忘れがち

  • フロースタイル
  • 配列
[aaa, bbb, ccc]
  • ハッシュ
{ A: aaa, B: bbb, C: ccc }
  • 真偽値

真偽値 (true, yes, false, no)
Null値 (null, ~)

…だけの行があると、それ以降は読み込まれまない。エラーを特定するときなどに利用

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?