aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff.7
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-07-28 14:17:11 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-07-28 14:17:11 +0000
commit005bcc6b1d086c580bddac2fb6d976b3388902be (patch)
tree67613d40079cd746f01ff372fed13ffefd83cfe4 /roff.7
parent596c0de84c5a8a499213ec024d61c49876b11167 (diff)
downloadmandoc-005bcc6b1d086c580bddac2fb6d976b3388902be.tar.gz
mandoc-005bcc6b1d086c580bddac2fb6d976b3388902be.tar.zst
mandoc-005bcc6b1d086c580bddac2fb6d976b3388902be.zip
An implementation of `tr'. This routes allocations of TEXT nodes
through libroff, which does the appropriate translations of `tr'. This is SLOW: it uses the backend of `ds' and `de', which is a simple linear list. However, unlike `ds' and `de', it iterates over EACH CHARACTER of the entire file looking for replacements.
Diffstat (limited to 'roff.7')
-rw-r--r--roff.723
1 files changed, 17 insertions, 6 deletions
diff --git a/roff.7 b/roff.7
index 41837a1d..1dc8c06b 100644
--- a/roff.7
+++ b/roff.7
@@ -1,4 +1,4 @@
-.\" $Id: roff.7,v 1.29 2011/05/24 15:22:14 kristaps Exp $
+.\" $Id: roff.7,v 1.30 2011/07/28 14:17:11 kristaps Exp $
.\"
.\" Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: May 24 2011 $
+.Dd $Mdocdate: July 28 2011 $
.Dt ROFF 7
.Os
.Sh NAME
@@ -584,10 +584,21 @@ This line-scoped request can take an arbitrary number of arguments.
Currently, it is ignored including its arguments.
.Ss \&tr
Output character translation.
-This request is intended to have one argument,
-consisting of an even number of characters.
-Currently, it is ignored including its arguments,
-and the number of arguments is not checked.
+Its syntax is as follows:
+.Pp
+.D1 Pf \. Cm \&tr Ar [ab]+
+.Pp
+Pairs of
+.Ar ab
+characters are replaced
+.Ar ( a
+for
+.Ar b ) .
+Replacement (or origin) characters may also be character escapes; thus,
+.Pp
+.Dl tr \e(xx\e(yy
+.Pp
+replaces all invocations of \e(xx with \e(yy.
.Ss \&T&
Re-start a table layout, retaining the options of the prior table
invocation.