LoginSignup
2
2

More than 5 years have passed since last update.

宮崎在住エンジニアのジョウ(@JotarO_Oyanagi) です。

API ドキュメントを作成していて「swagger とか ReDoc でテーブル使いたいけど、どうすればいいんだろ」となってあれこれ探した結果、以下の方法で YAML で Markdown 記法が使えるのがわかったのでメモします。

description: | を使う

こういうことです。


...
description: |
  見出し:
  # テキスト

  イタリック:
  *テキスト*

  ボールド:
  **テキスト**

  モノスペース:
  `テキスト`

  罫線:
  ---

  箇条書き:
  * その1
  * その2
  * その3

  番号付きリスト:
  1. その1
  2. その2
  3. その3

  リンク:
  [テキスト](https://example.co.jp) 

  画像:
  ![ロゴ画像](https://img.co.jp/logo.png)


  コード:(`` を ``` に置き換えてください)
  ``
  function() {
    return true;
  }
  ``

  テーブル:
  | 見出し1 | 見出し2 |
  | ---- | ---- |
  | データ1 | データ2 |

これで API ドキュメントづくりが捗りますね!

2
2
2

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
2
2