Proposed changes for text versions of man pages
Olson, Arthur David (NIH/NCI)
olsona at dc37a.nci.nih.gov
Tue Nov 4 14:45:11 UTC 2003
Here are proposed changes for generating text versions of man pages.
--ado
------- Makefile -------
*** /tmp/geta17824 Tue Nov 4 09:43:09 2003
--- /tmp/getb17824 Tue Nov 4 09:43:09 2003
***************
*** 1,4 ****
! # @(#)Makefile 7.83
# Change the line below for your time zone (after finding the zone you
want in
# the time zone files, or adding it to a time zone file).
--- 1,4 ----
! # @(#)Makefile 7.85
# Change the line below for your time zone (after finding the zone you
want in
# the time zone files, or adding it to a time zone file).
***************
*** 257,262 ****
--- 257,265 ----
MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
tzfile.5 tzselect.8 zic.8 zdump.8
DOCS= README Theory $(MANS) date.1 Makefile
+ TXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \
+ time2posix.3.txt tzfile.5.txt tzselect.8.txt \
+ zic.8.txt zdump.8.txt date.1.txt
PRIMARY_YDATA= africa antarctica asia australasia \
europe northamerica southamerica
YDATA= $(PRIMARY_YDATA) pacificnew etcetera factory
backward
***************
*** 267,273 ****
DATA= $(YDATA) $(NDATA) $(SDATA) $(TABDATA) leapseconds
yearistype.sh
WEB_PAGES= tz-art.htm tz-link.htm
MISC= usno1988 usno1989 usno1989a usno1995 usno1997 usno1998 \
! $(WEB_PAGES) checktab.awk
ENCHILADA= $(DOCS) $(SOURCES) $(DATA) $(MISC)
# And for the benefit of csh users on systems that assume the user
--- 270,276 ----
DATA= $(YDATA) $(NDATA) $(SDATA) $(TABDATA) leapseconds
yearistype.sh
WEB_PAGES= tz-art.htm tz-link.htm
MISC= usno1988 usno1989 usno1989a usno1995 usno1997 usno1998 \
! $(WEB_PAGES) checktab.awk workman.sh
ENCHILADA= $(DOCS) $(SOURCES) $(DATA) $(MISC)
# And for the benefit of csh users on systems that assume the user
***************
*** 374,380 ****
clean:
rm -f core *.o *.out tzselect zdump zic yearistype date \
! ,* *.tar.gz
names:
@echo $(ENCHILADA)
--- 377,383 ----
clean:
rm -f core *.o *.out tzselect zdump zic yearistype date \
! ,* *.tar.gz $(TXTS) workman
names:
@echo $(ENCHILADA)
***************
*** 381,397 ****
# The zics below ensure that each data file can stand on its own.
! public: $(ENCHILADA) zic
-mkdir /tmp/,tzpublic
for i in $(TDATA) ; do zic -d /tmp/,tzpublic $$i ; done
rm -f -r /tmp/,tzpublic
$(AWK) -f checktab.awk $(PRIMARY_YDATA)
! tar cf - $(DOCS) $(SOURCES) $(MISC) | gzip -9 >
tzcode.tar.gz
tar cf - $(DATA) | gzip -9 > tzdata.tar.gz
zonenames: $(TDATA)
@$(AWK) '/^Zone/ { print $$2 } /^Link/ { print $$3 }'
$(TDATA)
asctime.o: private.h tzfile.h
date.o: private.h
difftime.o: private.h
--- 384,417 ----
# The zics below ensure that each data file can stand on its own.
! public: $(ENCHILADA) zic $(TXTS)
-mkdir /tmp/,tzpublic
for i in $(TDATA) ; do zic -d /tmp/,tzpublic $$i ; done
rm -f -r /tmp/,tzpublic
$(AWK) -f checktab.awk $(PRIMARY_YDATA)
! tar cf - $(DOCS) $(SOURCES) $(MISC) $(TXTS) | gzip -9 >
tzcode.tar.gz
tar cf - $(DATA) | gzip -9 > tzdata.tar.gz
zonenames: $(TDATA)
@$(AWK) '/^Zone/ { print $$2 } /^Link/ { print $$3 }'
$(TDATA)
+ newctime.3.txt: newctime.3
+ newstrftime.3.txt: newstrftime.3
+ newtzset.3.txt: newtzset.3
+ time2posix.3.txt: time2posix.3
+ tzfile.5.txt: tzfile.5
+ tzselect.8.txt: tzselect.8
+ zic.8.txt: zic.8
+ zdump.8.txt: zdump.8
+ date.1.txt: date.1
+
+ $(TXTS): workman
+ ./workman $(@:.txt=) > $@
+
+ workman: workman.sh
+ cp $? $@
+ chmod +x $@
+
asctime.o: private.h tzfile.h
date.o: private.h
difftime.o: private.h
------- workman.sh -------
*** /tmp/geta17843 Tue Nov 4 09:43:16 2003
--- /tmp/getb17843 Tue Nov 4 09:43:16 2003
***************
*** 0 ****
--- 1,40 ----
+ #! /bin/sh
+
+ # @(#)workman.sh 1.3
+
+ tty -s
+ ttyval=$?
+
+ case $# in
+ 0) nroff -man ;;
+ 1) if [ -f $1 ]
+ then
+ ( echo .hy 0; echo .na ) | nroff -man - "$1"
+ else
+ man "$1"
+ fi ;;
+ *) man ${1+"$@"} ;;
+ esac | perl -ne '
+ if (($. % 66) <= 7) {
+ next;
+ }
+ if (($. % 66) > (66 - 7)) {
+ next;
+ }
+ chomp;
+ s/.\010//g;
+ s/[ ]*$//;
+ if (/^$/) {
+ $sawblank = 1;
+ next;
+ } else {
+ if ($sawblank) {
+ print "\n";
+ $sawblank = 0;
+ }
+ print "$_\n";
+ }
+ ' | case $ttyval in
+ 0) more ;;
+ *) cat ;;
+ esac
More information about the tz
mailing list