mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
18 lines
484 B
Nix
18 lines
484 B
Nix
{ writeShellScriptBin, ghostscript, man }:
|
|
let
|
|
name = "man-pdf";
|
|
in writeShellScriptBin name ''
|
|
if [ $# -eq 1 ]; then
|
|
man_entry="$1"
|
|
elif [ $# -eq 2 ]; then
|
|
man_page="$1"
|
|
man_entry="$2"
|
|
else
|
|
echo >/dev/stderr "Usage: ${name} [MAN-PAGE] ENTRY"
|
|
exit 1
|
|
fi
|
|
|
|
echo "${man}/bin/man "''${man_page:-}" "$man_entry" | ${ghostscript}/bin/ps2pdf - "$man_entry.pdf""
|
|
${man}/bin/man "''${man_page:-}" "$man_entry" | ${ghostscript}/bin/ps2pdf - "$man_entry.pdf"
|
|
''
|