OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [insight/] [itcl/] [iwidgets3.0.0/] [doc/] [tk2html.awk] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
#!/bin/nawk
2
 
3
 
4
$0 ~ /'[\/\\]" */ || $1 == "'"    { next }    # eat [nt]roff comments
5
 
6
# defining macros - eat them
7
/^\.de.*/ {
8
        getline
9
        while ( $0 !~ "^\.\.$" )
10
        {
11
            getline
12
        }
13
        getline
14
    }
15
 
16
$1 == ".VS" || $1 == ".VE" || $1 == ".AS"  { next }
17
 
18
 
19
# handle first .SH as special case - .SH NAME
20
/^.SH *NAME */ {
21
        getline
22
        while ( $0 ~ /\.[a-zA-Z].*/ )   # eat dot-cmd following title
23
        {
24
            getline
25
        }
26
        print "<TITLE>" $0 "</TITLE>"
27
        print "<H1>" $0 "</H1>\n"
28
        next
29
 
30
#-e 's/^.SH *NAME */{N;s#.*\n\(.*\)#<H1>\1</H1>#;}' \
31
    }
32
 
33
 
34
# Convert .IP Paragraphs upto next .cmd to hanging indents
35
#       using <UL></UL> pairs without intervening <LI>
36
 
37
/^\.IP */ {
38
        if ( inIP > 0 )
39
        {
40
            print "</UL>"
41
        }
42
        inIP = 1
43
        print "<UL>"
44
        match($0, /".*"/ )
45
        if ( RSTART > 0 )
46
        {
47
            arg = substr( $0, RSTART+1, RLENGTH-2)
48
 
49
            print arg " <BR>"
50
        }
51
        else if ( length( $2 ) > 0 )
52
        {
53
            print $2 " <BR>"
54
        }
55
        next
56
    }
57
 
58
$0 ~ /^\.[a-zA-Z]*/ && inIP > 0 {
59
        inIP = 0
60
        print "</UL>"
61
    }
62
 
63
# Convert
64
# .TP
65
# Line1
66
# line 2 - n
67
# .Any
68
#
69
# to
70
# <DL>
71
# <DT> Line1
72
# <DD> lines 2 - n
73
# <DT>
74
 
75
/^\.TP */ {
76
        if ( inTP > 0 )
77
        {
78
            print "</DL>"
79
        }
80
        inTP = 1
81
        print "<DL>"
82
        next
83
    }
84
 
85
inTP == 1 && $1 !~ /\.[a-zA-Z]*/ {
86
        print "<DT> " $0
87
        inTP = 2
88
        next
89
    }
90
 
91
inTP == 2 && $1 !~ /\.[a-zA-Z]*/{
92
        print "</I></B>"    # Belt and suspenders
93
        print "<DD> " $0
94
        inTP = 3
95
        next
96
    }
97
 
98
$0 ~ /^\.[a-zA-Z]*/ && inTP > 0 {
99
        inTP = 0
100
        print "</DL>"
101
    }
102
 
103
 
104
 
105
$1 == ".AP" {
106
        $1=""
107
        print "<DL >"
108
        print "<DT> " $2 "\t\t" $3 "\t\t("$4")"
109
        inTP = 2
110
        next
111
    }
112
 
113
# make a blank line
114
$1 == ".sp" {
115
        print "<BR>"
116
        next #        print "<BR>"
117
    }
118
 
119
 
120
$1 == ".ta"  { next }
121
 
122
 
123
# try and make links ( tk )
124
#       "See the .*  manual entry"
125
 
126
/"options"/  {
127
    if ( $0 ~ /^See the .*/ )
128
        sub("\"options\"", "<A HREF=\"http://www.sco.com/Technology/tcl/man/tk_man/options.n.html\"> \"options\" </A>")
129
    }
130
 
131
/"entry"/  {
132
    if ( $0 ~ /^See the .*/ )
133
        sub("\"entry\"", "<A HREF=\"http://www.sco.com/Technology/tcl/man/tk_man/entry.n.html\"> \"entry\" </A>")
134
    }
135
 
136
/"button"/  {
137
    if ( $0 ~ /^See the .*/ )
138
        sub("\"button\"", "<A HREF=\"http://www.sco.com/Technology/tcl/man/tk_man/button.n.html\"> \"button\" </A>")
139
    }
140
 
141
/"scrollbar"/  {
142
    if ( $0 ~ /^See the .*/ )
143
        sub("\"scrollbar\"", "<A HREF=\"http://www.sco.com/Technology/tcl/man/tk_man/scrollbar.n.html\"> \"scrollbar\" </A>")
144
    }
145
 
146
/"listbox"/  {
147
    if ( $0 ~ /^See the .*/ )
148
        sub("\"listbox\"", "<A HREF=\"http://www.sco.com/Technology/tcl/man/tk_man/listbox.n.html\"> \"listbox\" </A>")
149
    }
150
 
151
/"canvas"/  {
152
    if ( $0 ~ /^See the .*/ )
153
        sub("\"canvas\"", "<A HREF=\"http://www.sco.com/Technology/tcl/man/tk_man/canvas.n.html\"> \"canvas\" </A>")
154
    }
155
 
156
/"text"/  {
157
    if ( $0 ~ /^See the .*/ )
158
        sub("\"text\"", "<A HREF=\"http://www.sco.com/Technology/tcl/man/tk_man/text.n.html\"> \"text\" </A>")
159
    }
160
 
161
/"license.terms"/  {
162
    if ( $0 ~ /^See the .*/ )
163
        sub("\"license\".terms", "<A HREF=\"legal.html\"> license.\"terms\" </A>")
164
    }
165
 
166
/"buttonbox"/  {
167
    if ( $0 ~ /^See the .*/ )
168
        sub("\"buttonbox\"", "<A HREF=\"buttonbox.n.html\"> \"buttonbox\" </A>")
169
    }
170
 
171
/"combobox"/  {
172
    if ( $0 ~ /^See the .*/ )
173
        sub("\"combobox\"", "<A HREF=\"combobox.n.html\"> \"combobox\" </A>")
174
    }
175
 
176
/"dialog"/  {
177
    if ( $0 ~ /^See the .*/ )
178
      sub("\"dialog\"", "<A HREF=\"dialog.n.html\"> \"dialog\" </A>")
179
    }
180
 
181
/"dialogshell"/  {
182
    if ( $0 ~ /^See the .*/ )
183
      sub("\"dialogshell\"", "<A HREF=\"dialogshell.n.html\"> \"dialogshell\" </A>")
184
    }
185
 
186
/"entryfield"/  {
187
    if ( $0 ~ /^See the .*/ )
188
        sub("\"entryfield\"", "<A HREF=\"entryfield.n.html\"> \"entryfield\" </A>")
189
    }
190
 
191
/"fileselectionbox"/  {
192
    if ( $0 ~ /^See the .*/ )
193
        sub("\"fileselectionbox\"", "<A HREF=\"fileselectionbox.n.html\"> \"fileselectionbox\" </A>")
194
    }
195
 
196
/"fileselectiondialog"/  {
197
    if ( $0 ~ /^See the .*/ )
198
        sub("\"fileselectiondialog\"", "<A HREF=\"fileselectiondialog.n.html\"> \"fileselectiondialog\" </A>")
199
    }
200
 
201
/"labeledwidget"/  {
202
    if ( $0 ~ /^See the .*/ )
203
        sub("\"labeledwidget\"", "<A HREF=\"labeledwidget.n.html\"> \"labeledwidget\" </A>")
204
    }
205
 
206
/"messagedialog"/  {
207
    if ( $0 ~ /^See the .*/ )
208
        sub("\"messagedialog\"", "<A HREF=\"messagedialog.n.html\"> \"messagedialog\" </A>")
209
    }
210
 
211
/"optionmenu"/  {
212
    if ( $0 ~ /^See the .*/ )
213
        sub("\"optionmenu\"", "<A HREF=\"optionmenu.n.html\"> \"optionmenu\" </A>")
214
    }
215
 
216
/"panedwindow"/  {
217
    if ( $0 ~ /^See the .*/ )
218
        sub("\"panedwindow\"", "<A HREF=\"panedwindow.n.html\"> \"panedwindow\" </A>")
219
    }
220
 
221
/"promptdialog"/  {
222
    if ( $0 ~ /^See the .*/ )
223
        sub("\"promptdialog\"", "<A HREF=\"promptdialog.n.html\"> \"promptdialog\" </A>")
224
    }
225
 
226
/"pushbutton"/  {
227
    if ( $0 ~ /^See the .*/ )
228
        sub("\"pushbutton\"", "<A HREF=\"pushbutton.n.html\"> \"pushbutton\" </A>")
229
    }
230
 
231
/"scrolledcanvas"/  {
232
    if ( $0 ~ /^See the .*/ )
233
        sub("\"scrolledcanvas\"", "<A HREF=\"scrolledcanvas.n.html\"> \"scrolledcanvas\" </A>")
234
    }
235
 
236
/"scrolledframe"/  {
237
    if ( $0 ~ /^See the .*/ )
238
        sub("\"scrolledframe\"", "<A HREF=\"scrolledframe.n.html\"> \"scrolledframe\" </A>")
239
    }
240
 
241
/"scrolledlistbox"/  {
242
    if ( $0 ~ /^See the .*/ )
243
        sub("\"scrolledlistbox\"", "<A HREF=\"scrolledlistbox.n.html\"> \"scrolledlistbox\" </A>")
244
    }
245
 
246
/"scrolledtext"/  {
247
    if ( $0 ~ /^See the .*/ )
248
        sub("\"scrolledtext\"", "<A HREF=\"scrolledtext.n.html\"> \"scrolledtext\" </A>")
249
    }
250
 
251
/"selectionbox"/  {
252
    if ( $0 ~ /^See the .*/ )
253
        sub("\"selectionbox\"", "<A HREF=\"selectionbox.n.html\"> \"selectionbox\" </A>")
254
    }
255
 
256
/"selectiondialog"/  {
257
    if ( $0 ~ /^See the .*/ )
258
        sub("\"selectiondialog\"", "<A HREF=\"selectiondialog.n.html\"> \"selectiondialog\" </A>")
259
    }
260
 
261
/"spindate"/  {
262
    if ( $0 ~ /^See the .*/ )
263
        sub("\"spindate\"", "<A HREF=\"spindate.n.html\"> \"spindate\" </A>")
264
    }
265
 
266
/"spinint"/  {
267
    if ( $0 ~ /^See the .*/ )
268
        sub("\"spinint\"", "<A HREF=\"spinint.n.html\"> \"spinint\" </A>")
269
    }
270
 
271
/"spinner"/  {
272
    if ( $0 ~ /^See the .*/ )
273
        sub("\"spinner\"", "<A HREF=\"spinner.n.html\"> \"spinner\" </A>")
274
    }
275
 
276
/"spintime"/  {
277
    if ( $0 ~ /^See the .*/ )
278
        sub("\"spintime\"", "<A HREF=\"spintime.n.html\"> \"spintime\" </A>")
279
    }
280
 
281
/^Name: */ {
282
        print $1 "                   " $2
283
        next
284
    }
285
 
286
/^Class: */ {
287
        print $1 "                  " $2
288
        next
289
    }
290
 
291
/^Bret A. Schuhmacher*/ {
292
        print "<A HREF=\"mailto:bas@wn.com\">" $0 "</A>"
293
        next
294
    }
295
 
296
/^John S. Sigler*/ {
297
        print "<A HREF=\"mailto:jsigler@spd.dsccc.com\">" $0 "</A>"
298
        next
299
    }
300
 
301
/^Mark L. Ulferts*/ {
302
        print "<A HREF=\"mailto:mulferts@spd.dsccc.com\">" $0 "</A>"
303
        next
304
    }
305
 
306
/^Alfredo Jahn*/ {
307
        print "<A HREF=\"mailto:ajahn@spd.dsccc.com\">" $0 "</A>"
308
        next
309
    }
310
 
311
/^Sue Yockey*/ {
312
        print "<A HREF=\"mailto:syockey@spd.dsccc.com\">" $0 "</A>"
313
        next
314
    }
315
 
316
# just pass everything else on
317
 
318
    { print $0 }
319
 
320
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.