windowsでasciidocをhtmlに変換する方法を紹介します。
1.rubyの準備
ダウンロード先は以下です。
Downloads
The easy way to install Ruby on Windows This is a self-contained Windows-based installer that includes the Ruby language, an execution environment, important...
画面左側からダウンロードするバージョンを選択します。
カモトラはRuby 2.4.2-2 (x86)を選択しました。
windows上で
スタート→「Ruby 2.4.2-2-x86」→「Start Command Prompt with Ruby」と選択すると、コマンドプロンプトのような画面が起動します。
rubyのバージョンを確認してみましょう。
1 2 3 |
C:\Users\kamo>ruby -v ruby 2.4.2p198 (2017-09-14 revision 59899) [i386-mingw32] C:\Users\kamo> |
2.asciidoctorのインストール
asciidoctorをインストールします。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
C:\Users\kamo>gem install asciidoctor Fetching: asciidoctor-1.5.6.1.gem (100%) Successfully installed asciidoctor-1.5.6.1 Parsing documentation for asciidoctor-1.5.6.1 Installing ri documentation for asciidoctor-1.5.6.1 Done installing documentation for asciidoctor after 4 seconds 1 gem installed C:\Users\kamo> C:\Users\kamo>asciidoctor --version Asciidoctor 1.5.6.1 [http://asciidoctor.org] Runtime Environment (ruby 2.4.2p198 (2017-09-14 revision 59899) [i386-mingw32]) (lc:Windows-31J fs:Windows-31J in:- ex:Windows-31J) C:\Users\kamo> |
3.変換
asciidocの書式で作成したファイル「kamo.adoc」を用意します。
1 2 3 |
C:\Users\kamo> C:\Users\kamo>asciidoctor kamo.adoc C:\Users\kamo> |
同じディレクトリに「kamo.html」ファイルが作成されます。
以上になります。