Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Unified Diff: build-aux/manconv.sh

Issue 7109015: Update XZ Utils to 5.0.3 (in deps) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/xz/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « TODO ('k') | build-aux/version.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build-aux/manconv.sh
===================================================================
--- build-aux/manconv.sh (revision 0)
+++ build-aux/manconv.sh (revision 0)
@@ -0,0 +1,58 @@
+#!/bin/sh
+#
+###############################################################################
+#
+# Wrapper for GNU groff to convert man pages to a few formats
+#
+# Usage: manconv.sh FORMAT [PAPER_SIZE] < in.1 > out.suffix
+#
+# FORMAT can be ascii, utf8, ps, or pdf. PAPER_SIZE can be anything that
+# groff accepts, e.g. a4 or letter. See groff_font(5). PAPER_SIZE defaults
+# to a4 and is used only when FORMAT is ps (PostScript) or pdf.
+#
+# Multiple man pages can be given at once e.g. to create a single PDF file
+# with continuous page numbering.
+#
+###############################################################################
+#
+# Author: Lasse Collin
+#
+# This file has been put into the public domain.
+# You can do whatever you want with this file.
+#
+###############################################################################
+
+FORMAT=$1
+PAPER=${2-a4}
+
+# Make PostScript and PDF output more readable:
+# - Use 11 pt font instead of the default 10 pt.
+# - Use larger paragraph spacing than the default 0.4v (man(7) only).
+FONT=11
+PD=0.8
+
+SED_PD="
+/^\\.TH /s/\$/\\
+.PD $PD/
+s/^\\.PD\$/.PD $PD/"
+
+case $FORMAT in
+ ascii)
+ groff -t -mandoc -Tascii | col -bx
+ ;;
+ utf8)
+ groff -t -mandoc -Tutf8 | col -bx
+ ;;
+ ps)
+ sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \
+ -rC1 -rS$FONT -Tps -P-p$PAPER
+ ;;
+ pdf)
+ sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \
+ -rC1 -rS$FONT -Tps -P-p$PAPER | ps2pdf - -
+ ;;
+ *)
+ echo 'Invalid arguments' >&2
+ exit 1
+ ;;
+esac
Property changes on: build-aux/manconv.sh
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « TODO ('k') | build-aux/version.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698