AMD64 Gentooのドキュメント全体をコマンドラインからPDFに変換するには?

AMD64 Gentooのドキュメント全体をコマンドラインからPDFに変換するには?

変換するシェルスクリプトを作成してきました。AMD64 GentooマニュアルLinuxからPDFへ、これは現在のシェルスクリプトです。

function ghand {
  # Input 1 is the architecture
  # Input 2 is the Page name.
  mkdir -p ~/Textbooks/Gentoo/$1/$2/..
  cd ~/Textbooks/Gentoo/$1/$2/..
  wkhtmltopdf https://wiki.gentoo.org/wiki/Handbook:"$1"/"$2" "${2##*/}".pdf
}

function ghandall {
  mkdir -p ~/Textbooks/Gentoo/$1 && cd ~/Textbooks/Gentoo/$1
  wkhtmltopdf https://wiki.gentoo.org/wiki/Handbook:"$1" "$1".pdf

  # Installation
  S=Installation
  L=('About' 'Base' 'Bootloader' 'Disks' 'Finalizing' 'Kernel' 'Media' 'Networking' 'Stage' 'System' 'Tools')
  for i in "${L[@]}"
  do
    ghand $1 "$S"/"$i"
  done
  unset L
  unset S

  # Working with Gentoo
  S=Working
  L=('EnvVar' 'Features' 'Initscripts' 'Portage' 'USE')
  for i in "${L[@]}"
  do
    ghand $1 "$S"/"$i"
  done
  unset L
  unset S

  # Working with Portage
  S=Portage
  L=('Advanced' 'Branches' 'CustomTree' 'Files' 'Tools' 'Variables')
  for i in "${L[@]}"
  do
    ghand $1 "$S"/"$i"
  done
  unset L
  unset S

  # Networking
  S=Networking
  L=('Advanced' 'Dynamic' 'Extending' 'Introduction' 'Modular' 'Wireless')
  for i in "${L[@]}"
  do
    ghand $1 "$S"/"$i"
  done
  unset L
  unset S
}

function unit {
  pushd ~/Textbooks/Gentoo/"$1"
  pdfunite "$1".pdf */*.pdf "Handbook:"$1"".pdf
  popd
}

実行すると、ghandall AMD64 && unit AMD64完全なAMD64マニュアルがPDF形式で提供されますが、問題は、結果のPDFにマニュアルの元のHTML形式のCSSスタイルが提供する形式がないことです。たとえば、次のようになります。

オリジナルフォーマット @Gentoo Wiki

次のようにレンダリングされます。

PDFで最終レンダリング

最終PDFで。この問題をどのように克服できるかをご存知ですか? wkhtmltopdf以外のプログラムを使用してこれらのWebページをPDFに変換することをお勧めする場合は、プログラムが無料でコマンドラインから呼び出すことができ、Sabayon Linuxで利用可能であることを確認してください。

ベストアンサー1

おすすめ記事