Deleted Added
full compact
mdoc2man.awk (126274) mdoc2man.awk (137015)
1#!/usr/bin/awk
2#
3# Version history:
4# v3, I put the program under a proper license
5# Dan Nelson <dnelson@allantgroup.com> added .An, .Aq and fixed a typo
6# v2, fixed to work on GNU awk --posix and MacOS X
7# v1, first attempt, didn't work on MacOS X
8#

--- 18 unchanged lines hidden (view full) ---

27 nospace=0
28 synopsis=0
29 reference=0
30 block=0
31 ext=0
32 extopt=0
33 literal=0
34 prenl=0
1#!/usr/bin/awk
2#
3# Version history:
4# v3, I put the program under a proper license
5# Dan Nelson <dnelson@allantgroup.com> added .An, .Aq and fixed a typo
6# v2, fixed to work on GNU awk --posix and MacOS X
7# v1, first attempt, didn't work on MacOS X
8#

--- 18 unchanged lines hidden (view full) ---

27 nospace=0
28 synopsis=0
29 reference=0
30 block=0
31 ext=0
32 extopt=0
33 literal=0
34 prenl=0
35 breakw=0
35 line=""
36}
37
38function wtail() {
39 retval=""
40 while(w<nwords) {
41 if(length(retval))
42 retval=retval OFS

--- 250 unchanged lines hidden (view full) ---

293 optlist=3
294 else if(match(words[w+1],"-item"))
295 optlist=4
296 else if(match(words[w+1],"-bullet"))
297 optlist=1
298 w=nwords
299 } else if(match(words[w],"^El$")) {
300 optlist=oldoptlist
36 line=""
37}
38
39function wtail() {
40 retval=""
41 while(w<nwords) {
42 if(length(retval))
43 retval=retval OFS

--- 250 unchanged lines hidden (view full) ---

294 optlist=3
295 else if(match(words[w+1],"-item"))
296 optlist=4
297 else if(match(words[w+1],"-bullet"))
298 optlist=1
299 w=nwords
300 } else if(match(words[w],"^El$")) {
301 optlist=oldoptlist
302 } else if(match(words[w],"^Bk$")) {
303 if(match(words[w+1],"-words")) {
304 w++
305 breakw=1
306 }
307 } else if(match(words[w],"^Ek$")) {
308 breakw=0
301 } else if(match(words[w],"^It$")&&optlist) {
302 if(optlist==1)
303 add(".IP \\(bu")
304 else if(optlist==2)
305 add(".IP " ++enum ".")
306 else if(optlist==3) {
307 add(".TP")
308 prenl++
309 } else if(match(words[w],"^It$")&&optlist) {
310 if(optlist==1)
311 add(".IP \\(bu")
312 else if(optlist==2)
313 add(".IP " ++enum ".")
314 else if(optlist==3) {
315 add(".TP")
316 prenl++
309 if(match(words[w+1],"^Pa|Ev$")) {
317 if(match(words[w+1],"^Pa$|^Ev$")) {
310 add(".B")
311 w++
312 }
313 } else if(optlist==4)
314 add(".IP")
315 } else if(match(words[w],"^Sm$")) {
316 if(match(words[w+1],"off"))
317 nospace=2

--- 23 unchanged lines hidden ---
318 add(".B")
319 w++
320 }
321 } else if(optlist==4)
322 add(".IP")
323 } else if(match(words[w],"^Sm$")) {
324 if(match(words[w+1],"off"))
325 nospace=2

--- 23 unchanged lines hidden ---