0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Asciidoctor PDF Ver2への対応方法

Last updated at Posted at 2024-08-27

はじめに

 Asciidoctor PDFをVer1からVer2へ移行しようとしたところ、いくつか変更しなければならない箇所があったため主な変更点を紹介する。
 AsciidoctorのPDF化についての詳細は下記の記事を参照(ただし、記事はVer1前提)。

動作確認環境

  • OS
    • Windows 10
    • Ubuntu 22.04
  • Asciidoctor v2.3.18

方法

PDFスタイル(テーマ)の指定方法を変更する

 Ver2では、Ver1で指定していたpdf-stylepdf-stylesdirが利用不可能となった。それぞれ、pdf-themepdf-themedirに置き換える必要がある。

Ver1 Ver2
pdf-style pdf-theme
pdf-stylesdir pdf-themesdir

 詳細は公式ドキュメントを参照。

章ラベルアトリビュートを変更する

 chapter-labelchapter-signifierに変更する。

Ver1 Ver2
chapter-label chapter-signifier

 詳細は公式ドキュメントを参照。

PDFテーマファイル(xxx-theme.yml)内のタグを変更する

 以下のタグが非推奨となった。

  • literal
  • key
  • blockquote
  • outline_list

変更せずに、PDF化すると以下のような警告メッセージが出る。

asciidoctor: WARNING: the literal theme category is deprecated; use the codespan category instead
asciidoctor: WARNING: the blockquote theme category is deprecated; use the quote category instead
asciidoctor: WARNING: the outline-list theme category is deprecated; use the list category instead

以下に示すように、非推奨となったタグ名を変更する。

Ver1 Ver2
literal codespan
key kbd
blockquote quote
outline_list list

 詳細は公式ドキュメントを参照。

上記以外の対応

 上記以外の対応は、以下の公式ドキュメントを参照。

まとめ

 AsciidoctorのVer2への対応方法を紹介した。Ver1での設定で無効化されているのがいくつかあることが分かった。Ver1からVer2へ移行する場合は注意する。公式ドキュメントが良くまとまっているので参照すると良い。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?