
【Asciidoc】EPUBに変換する ー 環境を整える ー
今回から、「EPUB」について。。。
「Asciidocter-epub3」では余り作業していなかったので、取り敢えず環境設定から。
(今まで「AsciidocFX」で作業していましたので。。。)
さて、「Asciidocter-epub3」モジュールの導入が必要です。
に従って
NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install asciidoctor-epub3
「sudo」付きで実行しました。が躓きました。。。
ERROR: Error installing asciidoctor-epub3:
ERROR: Failed to build gem native extension.
(中略)
You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.
(後略)
「・・・開発環境を入れろとな・・・」
sudo apt-get install ruby-dev
開発環境を入れた後、EPUB3拡張機能を再実行。
今度は上手く行きました。
が。。。「Windows」環境だと少し大変かも・・・。
「Windows」の場合、「AsciidocFX」で変換したほうが楽かもしれません。
「Asciidoc」構文はほぼ同じはずです。
さあ、テストです。
= AsciidocでEpubを。
ようこそ、Epubの世界へ。
を準備しました。ファイル名は「1st_test.adoc」です。
$ asciidoctor-epub3 -D output 1st_test.adoc
を実行。「output」フォルダの下に「1st_test.epub」が出来ています。
表示してみると

上手く言っているようです。
ちなみに自分は「EPUB」関連を扱う時に
を利用しています。
オリジナルを各端末用に変換できるし、ビューアーもエディターも付いているので重宝しています。
上記のスクリーンショットも「Calibre」のビューアーのものです。
取り敢えず今回はここまで。
…ではまた。
当Noteは下記の「AsciiDoc Language Documentation」の文法に従っています。