Cucco’s Compute Hack

コンピュータ関係の記事を書いていきます。

markdownで書いたドキュメントにPlantUMLの図を挿入する方法

markdownで書いたドキュメントにPlantUMLの図を挿入する方法。
以下、どちらも可能。

  1. mdファイルに直接記載する。
  2. PlantUMLのファイルを参照する。

これで、ファイル分割しつつ、図と説明をテキストファイルで記述できるようになった。

結果

f:id:Cucco:20200523173931p:plain
プレビューされる内容

ソースコード

■mdファイル

# Section1
直接のPlantUMLの記載を、図として挿入する。
```plantuml
@startuml
:Hello world;
:this is section1;
@enduml
```
# Section2

別ファイルにあるPlantUMLの記載を、図として挿入する。

```plantuml
!include a00_hello_world.pu
```
# Section3
終わり

■PlantUMLの記載ファイル(a00_hello_world.pu)

@startuml
:Hello world;
:This is on defined on
several **lines**;
@enduml