xref: /plan9/sys/doc/prfile (revision 7dd7cddf99dd7472612f1413b4da293630e6b1bc)
1#!/bin/rc
2
3switch($#*){
4	case 1
5		outfile = $1
6		infile = $1.ms
7	case *
8		outfile = $1
9		shift
10		infile = $*
11}
12
13FONTS='.FP lucidasans'
14
15MACS ='.de BT
16.nr PX \\n(.s
17.nr PF \\n(.f
18.nr Bt 1
19.ft 1
20.ps \\n(PS
21''lt \\n(LTu
22.po \\n(POu
23.if \\n%>0 .tl \(ts\\*(LF\(ts\\*(CF\(ts\\*(RF\(ts
24.ft \\n(PF
25.ps \\n(PX
26..
27.de PT
28.lt \\n(LLu
29.pc %
30.nr PN \\n%
31.nr Ps \\n(PS-1
32.if \\n(Bt>0  .if e .tl @\\n%     \s\\n(Ps\\*(Au\s0@@@
33.if \\n(Bt>0  .if o .tl @@@\f2\\*(Tl\\f1     \\n%@
34.lt \\n(.lu
35..'
36
37
38macros = -ms
39
40switch($outfile){
41case 8½ acme gfx panel sam
42	macros = ($macros -mpictures)
43}
44
45switch($outfile){
46case 9 comp 8½ utf acme
47	macros = ($macros -mnihongo)
48}
49
50fn assemble{
51	switch($1){
52	case 9
53		pageno = 1
54		title = 'Plan 9 From Bell Labs'
55		author = 'INTRODUCTION'
56	case README
57		pageno = 23
58		title = '\s-1README\s0'
59		author = 'INTRODUCTION'
60	case names
61		pageno = 29
62		title = 'The Use of Name Spaces in Plan 9'
63		author = 'INTRODUCTION'
64	case net
65		pageno = 35
66		title = 'The Organization of Networks in Plan 9'
67		author = 'INTRODUCTION'
68	case comp
69		pageno = 49
70		title = 'How to Use the Plan 9 C Compiler'
71		author = 'PROGRAMMING'
72	case ape
73		pageno = 63
74		title = 'APE \(em The ANSI/POSIX Environment'
75		author = 'PROGRAMMING'
76	case ug
77		pageno = 67
78		title = 'Alef User''s Guide'
79		author = 'PROGRAMMING'
80	case alef
81		pageno = 103
82		title = 'Alef Language Reference Manual'
83		author = 'PROGRAMMING'
84	case acidpaper
85		pageno = 141
86		title = 'Acid: A Debugger Built From A Language'
87		author = 'PROGRAMMING'
88	case acid
89		pageno = 155
90		title = 'Acid Manual'
91		author = 'PROGRAMMING'
92	case mk
93		pageno = 181
94		title = 'Maintaining Files on Plan 9 with Mk'
95		author = 'PROGRAMMING'
96	case mkfiles
97		pageno = 195
98		title = 'Plan 9 Mkfiles'
99		author = 'PROGRAMMING'
100	case asm
101		pageno = 203
102		title = 'A Manual for the Plan 9 assembler'
103		author = 'PROGRAMMING'
104	case 8½
105		pageno = 211
106		title = '8½, the Plan 9 Window System'
107		author = 'USER INTERFACES'
108	case rc
109		pageno = 221
110		title = 'Rc \(em The Plan 9 Shell'
111		author = 'USER INTERFACES'
112	case sam
113		pageno = 237
114		title = 'The Text Editor Sam'
115		author = 'USER INTERFACES'
116	case acme	# actually done in acme/mkfile
117		pageno = 267
118		title = 'The Text Editor Sam'
119		author = 'USER INTERFACES'
120	case utf
121		pageno = 283
122		title = 'Hello World, or \f1\S''12''Καλημέρα κόσμε\fP\S''0'', or \f(Jpこんにちは 世界\fP'
123		author = 'IMPLEMENTATION'
124	case compiler
125		pageno = 295
126		title = 'Plan 9 C Compilers'
127		author = 'IMPLEMENTATION'
128	case libmach
129		pageno = 305
130		title = 'Adding Application Support for a New Architecture'
131		author = 'IMPLEMENTATION'
132	case fs
133		pageno = 313
134		title = 'The Plan 9 File Server'
135		author = 'IMPLEMENTATION'
136	case il
137		pageno = 321
138		title = 'The IL Protocol'
139		author = 'IMPLEMENTATION'
140	case sleep
141		pageno = 327
142		title = 'Process Sleep and Wakeup on a Shared-memory Multiprocessor'
143		author = 'IMPLEMENTATION'
144	case gfx
145		pageno = 333
146		title = 'Raster Graphics in Plan 9'
147		author = 'MISCELLANY'
148	case panel
149		pageno = 343
150		title = 'A Quick Introduction to the Panel Library'
151		author = 'MISCELLANY'
152	case lp
153		pageno = 363
154		title = 'A Guide to the Lp Printer Spooler'
155		author = 'MISCELLANY'
156	case troff
157		pageno = 371
158		title = 'Troff User''s Manual'
159		author = 'MISCELLANY'
160	case spin
161		pageno = 411
162		title = 'Using SPIN'
163		author = 'MISCELLANY'
164	case port
165		pageno = 439
166		title = 'The Various Ports'
167		author = 'INSTALLATION'
168	case install
169		pageno = 447
170		title = 'Installing the Plan 9 Distribution'
171		author = 'INSTALLATION'
172	case *
173		echo $1 page number not known >[2=1]
174		exit page
175	}
176	echo $FONTS
177	echo .pn $pageno
178	echo .ds Tl "$title
179	echo .ds Au "$author
180	echo $MACS
181	pic $infile | tbl | eqn
182}
183
184assemble $outfile | troff $macros | lp -m.9 -dstdout > $outfile.bs
185