プログラムを中心とした個人的なメモ用のブログです。 タイトルは迷走中。
内容の保証はできませんのであしからずご了承ください。

2017/07/04

AsciiDoc を Visual Studio Code でプレビューする

update2017/10/21 event_note2017/07/04 5:44

以下のプラグインを Visual Studio Code にインストールすることで AsciiDoc のプレビューとシンタックスハイライトが可能になります。

ただし、プレビューを有効にするにはあらかじめ Asciidoctor がインストールされている必要があります。
また、AsciiDoc の中に埋め込んだ PlantUML などもプレビューするには設定を変更する必要があります。

[ファイル] > [基本設定] > [ユーザー設定] で設定ファイルを開き、以下のように記述します。

既定値

// command to be used for the HTML generation
"AsciiDoc.html_generator": "asciidoctor -o-"

変更後

// command to be used for the HTML generation
"AsciiDoc.html_generator": "asciidoctor -r asciidoctor-diagram -o-"

尚、私は一時ファイルがカレントディレクトリに出力されるのが嫌なので、以下のようにしています。

// command to be used for the HTML generation
"AsciiDoc.html_generator": "asciidoctor -a outdir=tmp -a imagesdir=tmp -a imagesoutdir=tmp -r asciidoctor-diagram -o-"