2
2

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 5 years have passed since last update.

PlatntUMLを使ってMarkdownでAPIドキュメント作成

Posted at

はじめに

PlantUMLを使うと、APIドキュメントを効率的に公開できることが分かりました。今回はPlantUMLを使って、APIドキュメントを記述する流れをメモしておきたいと思います。

PlantUMLのインストール

brewを使うと簡単にインストールすることができますので、事前にbrewをインストールしておいてください。

$ brew install graphviz
$ brew install plantuml

plantumlで以下のようなチェックサムエラーが発生しました。私の環境の場合はbrew upgradeを行うことで問題が発生しなくなりました。

$ brew install plantuml
==> Downloading https://downloads.sourceforge.net/project/plantuml/1.2018.1/plantuml.1.2018.1.jar
==> Downloading from https://downloads.sourceforge.net/#!/project/plantuml/1.2018.1/plantuml.1.2018.1.jar
######################################################################## 100.0%
Error: SHA256 mismatch

$ brew upgrade
$ brew install plantuml
==> Downloading https://downloads.sourceforge.net/project/plantuml/1.2018.1/plantuml.1.2018.1.jar
==> Downloading from https://jaist.dl.sourceforge.net/project/plantuml/1.2018.1/plantuml.1.2018.1.jar
######################################################################## 100.0%
🍺  /usr/local/Cellar/plantuml/1.2018.1: 4 files, 6.9MB, built in 8 seconds

Atomのplantumlプラグインのインストール

以下の3つのプラグインをインストールします。

  • plantuml
  • plantuml-viewer
  • markdown-preview-enhanced
  1. AtomのPreferenceからInstallを選択
  2. plantumlを入力してパッケージ検索
  3. plantumlとplantuml-viewerをインストール

Screen Shot 2018-03-04 at 6.39.40 PM.png

  1. markdown-preview-enhancedを入力してパッケージ検索
  2. markdown-preview-enhancedをインストール

markdown-preview-enhancedを利用するために、markdown-previewの設定をオフにします。

Screen Shot 2018-03-04 at 9.40.39 PM.png

APIドキュメントの記述

APIドキュメント風に記述して見ました。以下のようにMarkdownの中にplantumlのメタデータを埋め込むことができるので、図をPNGに落とすなどの手間が省けてとても助かります。

Screen Shot 2018-03-04 at 10.26.06 PM.png
2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?