/
troffxml.man
179 lines (177 loc) · 3.61 KB
/
troffxml.man
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
.\"
.ig
Copyright (C) 2012-2018 Pierre Jean Fichet
<pierrejean dot fichet at posteo dot net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
..
.\" DS Utroff prexml and postxml manual
.\" DT Utroff prexml and postxml manual
.\" DK utroff prexml postxml troff nroff heirloom tmac xml
.
.
.
.TH PREXML & POSTXML 1 2018-04-14
.
.
.
.SH NAME
.PP
\fBprexml postxml\fR − \fInroff\fR processors to build xml
files.
.
.
.
.SH SYNOPSIS
.PP
\fBprexml\fR < \fIfile.tr\fR |
\fBnroff\fR \fB-m\fR\fIux\fR |
\fBpostxml\fR > \fIfile.xml\fR
.
.
.
.SH DESCRIPTION
.PP
\fIPostxml\fR provides a solution to build
an xml file from a troff document that relies on \fInroff\fR
itself. Since \fInroff\fR builds a plain text file from a troff
document, it can be used, with an appropriate macro, to
produce an intermediate file that \fIpostxml\fR
will translate to xml.
.PP
That intermediate file contains tags that \fIpostxml\fR will
transform to xml tags. If these tags are present in the
source file, and need to be printed as is, \fIprexml\fR
simply escapes these tags so that \fIpostxml\fR won't
substitute them.
.PP
Since the final xml file might contain utf-8 characters, the
\fB-T\fR\fIlocale\fR option of \fInroff\fR must be used.
\fIUtmac\fR provides the \fIux\fR macro that aims to be used with
prexml and postxml. \fITroffxml\fR comes with xsl
stylesheets to create open document and html files.
So, the command line could be:
.PP
.EX
prexml \fB<\fR file.tr \fB|\fR nroff -Tlocale \
-mux \fB|\fR postxml \fB>\fR file.xml
xsltproc utohtml.xsl file.xml \fB>\fR file.html
xsltproc utofodt.xsl file.xml \fB>\fR file.fodt
.EE
.
.
.
.SH TAGS
.
.
.
.SS Postxml
.RS 3
.PP
\fIPostxml\fR will substitute the following tags.
.TP
\&\fB#[\fR
Replaced by \fB<\fR.
.TP
\&\fB#]\fR
Replaced by \fB>\fR.
.TP
\&\fB#(\fR
Replaced by \fB&\fR.
.TP
\&\fB#)\fR
Replaced by \fB;\fR.
.TP
\&\fB#~\fR
Replaced by \fB#\fR.
.TP
\&\fB\en#-\en\fR
Removed from stream.
.PP
So the following text:
.PP
.EX
Some text
\fI#-\fR
\fB#[\fRa\fB#]\fR
\fI#-\fR
note text
\fB#[\fR/a\fB#]\fR
\fB#(lt#)\fR.
.EE
.PP
Will be transform in:
.PP
.EX
Some text\fB<\fRa\fB>\fRnote text\fB</\fRa\fB>\fR \fB<\fR.
.EE
.
.
.
.SS Prexml
.RS 3
.PP
All these tags will be escaped by \fIprexml\fR if they are
present in the original file, following these rules:
.TP
\&\fB#[\fR
Replaced by \fB#~[\fR.
.TP
\&\fB#]\fR
Replaced by \fB#~]\fR.
.TP
\&\fB#(\fR
Replaced by \fB#~(\fR.
.TP
\&\fB#)\fR
Replaced by \fB#~)\fR.
.TP
\&\fB#~\fR
Replaced by \fB#~~\fR.
.TP
\&\fB\en#-\en\fR
Replaced by \fB#~-\fR.
.
.
.
.SH FILES
.TP
\&\fI@BINDIR@/prexml\fR \fI@BINDIR@/postxml\fR
Executables.
.TP
\&\fI@XSLDIR@/utohtml.xsl\fR
XSL stylesheet to transform an utmac document to html.
.TP
\&\fI@XSLDIR@/utofodt.xsl\fR
XSL stylesheet to transform an utmac document to flat odt.
.TP
\&\fI@XSLDIR@/utmac.ott\fR
Open Document Text Template close to Utmac.
.
.
.
.SH SEE ALSO
.PP
nroff(1).
.
.
.
.SH LICENSE
.PP
\fIPrexml\fR, \fIpostxml\fR and this man page are
distributed under a
isc license.
.
.
.
.SH AUTHOR
.PP
Written by Pierre-Jean Fichet.