aboutsummaryrefslogtreecommitdiff
path: root/list
diff options
context:
space:
mode:
Diffstat (limited to 'list')
-rwxr-xr-xlist/list17
-rw-r--r--list/list.143
2 files changed, 60 insertions, 0 deletions
diff --git a/list/list b/list/list
new file mode 100755
index 0000000..64ec8ac
--- /dev/null
+++ b/list/list
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -ps
+
+# list -- escape code listing for troff
+
+if (/^\.\s*l\(\s*$/ .. /^\.\s*l\)\s*$/) {
+ not $E and s/^\\!// and next;
+ if (/^\.\s*l\(\s*$/) {
+ print "$p\n" if $p;
+ } elsif (/^\.\s*l\)\s*$/) {
+ print "$s\n" if $s;
+ } else {
+ s/\\/\\$&/g;
+ s/^/\\&/g;
+ s/'/\\(aq/g;
+ s/\`/\\(ga/g;
+ }
+}
diff --git a/list/list.1 b/list/list.1
new file mode 100644
index 0000000..085bb20
--- /dev/null
+++ b/list/list.1
@@ -0,0 +1,43 @@
+.Dd $Mdocdate$
+.Dt list 1
+.Os
+.Sh NAME
+.Nm list
+.Nd escape code listings for troff
+.
+.Sh SYNOPSIS
+.Nm
+.Op Fl p=prefix
+.Op Fl s=suffix
+.Op Fl E
+.Op Ar file
+.Sh DESCRIPTION
+.Pp
+.Nm
+escapes text between
+.Ql .l(
+and
+.Ql .l)
+lines for
+.Xr troff 1 .
+.Pp
+Lines beginning with
+.Ql \\\\!
+are copied verbatim, unless the
+.Fl E
+flag is given.
+.Pp
+Text given to
+.Fl p
+and
+.Fl s
+is inserted on a new line before and after each code block.
+This text is not escaped and can contain arbitrary
+.Xr troff 1
+requests.
+.
+.Sh AUTHORS
+.Pp
+.Nm
+is written by John Ankarström
+.Aq Mt "john (at) ankarstrom.se" .