Deleted Added
full compact
mdoc2man.awk (137015) mdoc2man.awk (149749)
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#

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

135 nospace=0
136 }
137 if(match(words[w],"^Dd$")) {
138 date=wtail()
139 next
140 } else if(match(words[w],"^Dt$")) {
141 id=wtail()
142 next
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#

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

135 nospace=0
136 }
137 if(match(words[w],"^Dd$")) {
138 date=wtail()
139 next
140 } else if(match(words[w],"^Dt$")) {
141 id=wtail()
142 next
143 } else if(match(words[w],"^Ox$")) {
144 add("OpenBSD")
145 skip=1
143 } else if(match(words[w],"^Os$")) {
144 add(".TH " id " \"" date "\" \"" wtail() "\"")
145 } else if(match(words[w],"^Sh$")) {
146 add(".SH")
147 synopsis=match(words[w+1],"SYNOPSIS")
148 } else if(match(words[w],"^Xr$")) {
149 add("\\fB" words[++w] "\\fP(" words[++w] ")" words[++w])
150 } else if(match(words[w],"^Rs$")) {

--- 198 unchanged lines hidden ---
146 } else if(match(words[w],"^Os$")) {
147 add(".TH " id " \"" date "\" \"" wtail() "\"")
148 } else if(match(words[w],"^Sh$")) {
149 add(".SH")
150 synopsis=match(words[w+1],"SYNOPSIS")
151 } else if(match(words[w],"^Xr$")) {
152 add("\\fB" words[++w] "\\fP(" words[++w] ")" words[++w])
153 } else if(match(words[w],"^Rs$")) {

--- 198 unchanged lines hidden ---