asciidocをPDFで出力する
from AsciiDoc備忘録
PDFにする!
$ gem install asciidoctor-pdf
$ gem install asciidoctor-pdf-cjk
$ asciidoctor-pdf -r asciidoctor-pdf-cjk hoge.adoc
ただ、、これだけだと日本語が化けたので、以下サイトを見つつ「default-theme.yml」ファイルを変更した
code:yml
M+ 1p Fallback:
normal: mplus1p-regular-fallback.ttf
bold: mplus1p-regular-fallback.ttf
italic: mplus1p-regular-fallback.ttf
bold_italic: mplus1p-regular-fallback.ttf
fallbacks:
- M+ 1p Fallback
asciidoctor-pdf で日本語が化ける for Windows10 - Qiita
"E:\Ruby31-x64\lib\ruby\gems\3.1.0\gems\asciidoctor-pdf-1.6.2\data\themes\default-theme.yml"
https://qiita.com/hidao/items/f8a94a9ced332606c67f
すごい、農林水産研究情報総合センターの文書もある
https://itcweb.cc.affrc.go.jp/affrit/_media/documents/guide/asciidoc/asciidoc-start.pdf
外部イメージファイルを組み込んだ時にワーニングが出た
asciidoctor: WARNING: allow-uri-read is not enabled; cannot embed remote image: https://www.soumu.go.jp/main_sosiki/joho_tsusin/security/business/executive/img/ill02_01.jpg
対処
以下コマンドで実施(日本語の文字化けも対応したver)
asciidoctor-pdf -a pdf-theme=default-with-fallback-font -a allow-uri-read hoge.adoc