]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
src/bin/pdfman, scripts/bash_aliases, pdfman.1: Make pdfman a standalone program...
authorAlejandro Colomar <alx@kernel.org>
Sun, 3 Nov 2024 11:23:01 +0000 (12:23 +0100)
committerAlejandro Colomar <alx@kernel.org>
Sun, 3 Nov 2024 12:33:22 +0000 (13:33 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man1/pdfman.1 [new file with mode: 0644]
scripts/bash_aliases
src/bin/pdfman [new file with mode: 0755]

diff --git a/man/man1/pdfman.1 b/man/man1/pdfman.1
new file mode 100644 (file)
index 0000000..aef4024
--- /dev/null
@@ -0,0 +1,25 @@
+.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH pdfman 1 (date) "Linux man-pages (unreleased)"
+.SH NAME
+pdfman
+\-
+render a manual page in PDF
+.SH SYNOPSIS
+.B pdfman
+.RI [ man-options ]
+.RI [ section ]\~ page
+.SH DESCRIPTION
+The
+.B pdfman
+command renders a manual page in PDF.
+All the arguments are interpreted by
+.BR man (1).
+.EE
+.SH SEE ALSO
+.BR man (1),
+.BR groff (1),
+.BR gropdf (1),
+.BR xdg\-open (1)
index bd6829409ba3d72fbaf84b692613c88e8d0a4afd..318e66c56c1451ef30a90c964a291313166078a3 100644 (file)
@@ -88,17 +88,6 @@ man_lsvar()
        |uniq;
 }
 
-#  pdfman()  renders a manual page in PDF
-# Usage example:  .../man-pages$ pdfman man2/membarrier.2;
-
-pdfman()
-{
-       local tmp="$(mktemp -t "${!###*/}.XXXXXX")";
-
-       man -Tpdf "$@" >"$tmp";
-       xdg-open "$tmp";
-}
-
 #  man_gitstaged  prints a list of all files with changes staged for commit
 # (basename only if the files are within <man?/>), separated by ", ".
 # Usage example:  .../man-pages$ git commit -m "$(man_gitstaged): msg";
diff --git a/src/bin/pdfman b/src/bin/pdfman
new file mode 100755 (executable)
index 0000000..b230151
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# Copyright 2021-2024, Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+set -Eeuo pipefail;
+
+tmp="$(mktemp -t "${!###*/}.XXXXXX")";
+
+man -Tpdf "$@" >"$tmp";
+xdg-open "$tmp";