diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2021-07-05 23:48:57 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2021-07-06 01:49:10 -0600 |
| commit | dae5b3eb6b5b58e8ea1cbcebb82a874f058e2abd (patch) | |
| tree | 2ebfdacf595dc94485c9d1b6fc8015dff587cc43 /docs | |
| parent | cefa93cf519baadaef6c6ca30bfe9d29e564a988 (diff) | |
document how to convert a man page to PostScript and PDF using the man command [skip ci]
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/modules/manpage-backend/pages/index.adoc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/modules/manpage-backend/pages/index.adoc b/docs/modules/manpage-backend/pages/index.adoc index 72c239d1..71c6c8ae 100644 --- a/docs/modules/manpage-backend/pages/index.adoc +++ b/docs/modules/manpage-backend/pages/index.adoc @@ -46,6 +46,28 @@ Here is an example man page composed in AsciiDoc for the `eve` command: include::example$manpage.adoc[] ---- +== Convert the man page to PostScript or PDF + +Once you have created a man page, you can convert it to PostScript using the `man` command. + +Let's assume that the output file produced by the Asciidoctor manpage converter is `progname.1`, where `progname` is the name of the command and `1` is the volume number. +You can convert `progname.1` to PostScript and redirect the output to `progname.ps` using the following `man` command: + + $ man -t ./progname.1 > progname.ps + +Alternately, you can redirect the output of the `man` command to `ps2pdf` to further convert it to PDF: + + $ man -t ./progname.1 | ps2pdf - progname.pdf + +Using these same commands, you can convert Asciidoctor's own man page to PDF: + + $ asciidoctor -h manpage | man -t -l - | ps2pdf - asciidoctor.pdf + +In this case, the `-l -` reads the man page content generated by the help mode of the `asciidoctor` command. + +Keep in mind that the files in this section are not generated using Asciidoctor. +If you want to generate PDF files directly from Asciidoctor, you may be interested in checking out https://github.com/asciidoctor/asciidoctor-pdf[Asciidoctor PDF^]. + [#doctype] == Man page doctype |
