aboutsummaryrefslogtreecommitdiff
path: root/zh_TW.UTF-8/books/fdp-primer/book.xml
blob: 97841922e499b36aff28c79fa2b02b5103e8df5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN" "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd" [
<!ENTITY % chapters SYSTEM "chapters.ent">
<!--
     Creates entities for each chapter in the Documentation Project Primer.
     Each entity is named chap.foo, where foo is the value of the id
     attribute on that chapter, and corresponds to the name of the
      directory in which that chapter's .xml file is stored.

     Chapters should be listed in the order in which they are referenced.

     $FreeBSD$
--><!ENTITY chap.overview SYSTEM "overview/chapter.xml">
<!ENTITY chap.tools SYSTEM "tools/chapter.xml">
<!ENTITY chap.working-copy SYSTEM "working-copy/chapter.xml">
<!ENTITY chap.structure SYSTEM "structure/chapter.xml">
<!ENTITY chap.doc-build SYSTEM "doc-build/chapter.xml">
<!ENTITY chap.the-website SYSTEM "the-website/chapter.xml">
<!ENTITY chap.xml-primer SYSTEM "xml-primer/chapter.xml">
<!ENTITY chap.xhtml-markup SYSTEM "xhtml-markup/chapter.xml">
<!ENTITY chap.docbook-markup SYSTEM "docbook-markup/chapter.xml">
<!ENTITY chap.stylesheets SYSTEM "stylesheets/chapter.xml">
<!ENTITY chap.translations SYSTEM "translations/chapter.xml">
<!ENTITY chap.po-translations SYSTEM "po-translations/chapter.xml">
<!ENTITY chap.writing-style SYSTEM "writing-style/chapter.xml">
<!ENTITY chap.editor-config SYSTEM "editor-config/chapter.xml">
<!ENTITY chap.see-also SYSTEM "see-also/chapter.xml">
<!ENTITY app.examples SYSTEM "examples/appendix.xml">
<!-- ENTITY index SYSTEM "index.xml" -->]>
<!-- Copyright (c) 1998, 1999 Nik Clayton, All rights reserved.

     Redistribution and use in source (SGML DocBook) and 'compiled' forms
     (SGML, HTML, PDF, PostScript, RTF and so forth) with or without
     modification, are permitted provided that the following conditions
     are met:

      1. Redistributions of source code (SGML DocBook) must retain the above
         copyright notice, this list of conditions and the following
         disclaimer as the first lines of this file unmodified.

      2. Redistributions in compiled form (transformed to other DTDs,
         converted to PDF, PostScript, RTF and other formats) must reproduce
         the above copyright notice, this list of conditions and the
         following disclaimer in the documentation and/or other materials
         provided with the distribution.

     THIS DOCUMENTATION IS PROVIDED BY NIK CLAYTON "AS IS" AND ANY EXPRESS OR
     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL NIK CLAYTON BE LIABLE FOR ANY DIRECT,
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGE.

     $FreeBSD$
-->
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:lang="zh_TW">
  <info><title>給新貢獻人員的 FreeBSD 說明文件計畫入門書</title>
    

    <author><orgname>FreeBSD 說明文件計劃</orgname></author>

    <copyright><year>1998</year> <year>1999</year> <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year> <year>2004</year> <year>2005</year> <year>2006</year> <year>2007</year> <year>2008</year> <year>2009</year> <year>2010</year> <year>2011</year> <year>2012</year> <year>2013</year> <year>2014</year> <holder role="mailto:doceng@FreeBSD.org">DocEng</holder></copyright>

    <pubdate role="rcs" xml:lang="en">$FreeBSD$</pubdate>

    <releaseinfo xml:lang="en">$FreeBSD$</releaseinfo>

    
<legalnotice xml:id="legalnotice">
  <title>版權</title>

  <para xml:lang="en">Redistribution and use in source (XML DocBook) and 'compiled'
    forms (XML, HTML, PDF, PostScript, RTF and so forth) with or without
    modification, are permitted provided that the following conditions are
    met:</para>

  <orderedlist>
    <listitem>
      <para xml:lang="en">Redistributions of source code (XML DocBook) must retain the
        above copyright notice, this list of conditions and the following
        disclaimer as the first lines of this file unmodified.</para>
    </listitem>

    <listitem>
      <para xml:lang="en">Redistributions in compiled form (transformed to other DTDs,
        converted to PDF, PostScript, RTF and other formats) must
        reproduce the above copyright notice, this list of conditions and
        the following disclaimer in the documentation and/or other
        materials provided with the distribution.</para>
    </listitem>
  </orderedlist>

  <important>
    <para xml:lang="en">THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION
      PROJECT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
      BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
      FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
      THE FREEBSD DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT,
      INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
      BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
      OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
      TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
      USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
      DAMAGE.</para>
  </important>
</legalnotice>


    <abstract>
      <para>感謝您參與 FreeBSD 說明文件計劃,您的點滴貢獻,都相當寶貴。</para>

      <para>本入手書內容包括:如何開始著手貢獻 FreeBSD 說明文件計劃 (FreeBSD Documentation Project, <acronym>FDP</acronym>) 的各項細節,以及會用到的一些工具、軟體 ,以及文件計畫的宗旨。</para>

      <para>本入門書仍在持續撰寫中。任何修正或新增內容的建議都非常歡迎。</para>
    </abstract>
  </info>

  <preface xml:id="preface">
    <title></title>

    <sect1 xml:id="preface-prompts">
      <title>Shell 提示符號</title>

      <para>下表顯示出一般使用者帳號與 root 的提示符號,在所有的文件例子中會用提示符號(prompt) ,來提醒您該用哪種帳號才對。</para>

      <informaltable frame="none" pgwide="1">
	<tgroup cols="2">
	  <thead>
	    <row>
	      <entry>帳號</entry>
	      <entry>提示符號</entry>
	    </row>
	  </thead>

	  <tbody>
	    <row>
	      <entry>一般使用者</entry>
	      <entry><prompt>%</prompt></entry>
	    </row>

	    <row>
	      <entry><systemitem class="username">root</systemitem></entry>
	      <entry><prompt>#</prompt></entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect1>

    <sect1 xml:id="preface-conventions">
      <title>書中所用的編排風格</title>

      <para>下表為本書中所使用編排風格方式</para>

      <informaltable frame="none" pgwide="1">
	<tgroup cols="2">
	  <thead>
	    <row>
	      <entry>代表意義</entry>
	      <entry>範例</entry>
	    </row>
	  </thead>

	  <tbody>
	    <row>
	      <entry>指令</entry>
	      <entry>使用 <command>ls -l</command> 來列出所有的檔案。</entry>
	    </row>

	    <row>
	      <entry>檔名</entry>
	      <entry>編輯 <filename>.login</filename></entry>
	    </row>

	    <row>
	      <entry>螢幕上會出現的訊息</entry>
	      <entry><screen>You have mail.</screen></entry>
	    </row>

	    <row>
	      <entry>輸入指令後,螢幕上會出現的對應內容。</entry>

	      <entry><screen><prompt>%</prompt> <userinput>date +"The time is %H:%M"</userinput>
The time is 09:18</screen></entry>
	    </row>

	    <row>
	      <entry>要參考的線上手冊</entry>
	      <entry>使用 <citerefentry><refentrytitle>su</refentrytitle><manvolnum>1</manvolnum></citerefentry> 來切換帳號。</entry>
	    </row>

	    <row>
	      <entry>使用者名稱和群組名稱</entry>
	      <entry>只有  <systemitem class="username">root</systemitem> 才可以做這件事。</entry>
	    </row>

	    <row>
	      <entry>語氣的強調。</entry>
	      <entry>使用者<emphasis>必須</emphasis>這樣做</entry>
	    </row>

	    <row>
	      <entry>打指令時,可替換的部份</entry>

	      <entry>要搜尋線上手冊的關鍵字,請輸入 <command>man -k <replaceable>關鍵字</replaceable></command></entry>
	    </row>

	    <row>
	      <entry>環境變數。</entry>
	      <entry><envar>$HOME</envar> 是指帳號的家目錄所在處。</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect1>

    <sect1 xml:id="preface-notes">
      <title>注意、提示、重要、警告與範例</title>

      <para>出現在本文中的注意、警告、與範例。</para>

      <note>
	<para>注意:表示需要注意的事項,其中包括您需要注意的事情,因為這些事情可能會影響到操作結果。</para>
      </note>

      <tip>
	<para>提示:提供可能對您有用的資訊,例如簡化操作方式的技巧說明。</para>
      </tip>

      <important>
	<para>重要:表示要特別注意的事情。一般來說,它們會包括操作指令時需要加的額外參數。</para>
      </important>

      <warning>
	<para>警告:表示警告事項,比如如果您不則可能導致的損失。這些損失可能是對您或硬體造成實際傷害, 也可能是無法估計的損害,例如一時疏忽而刪除重要檔案...。</para>
      </warning>

      <example>
	<title>範例的範本</title>

	<para>這是舉例說明而已,通常包含應遵循的指令範例,或顯示某些特定動作所可能發生的結果。</para>
      </example>
    </sect1>

    <sect1 xml:id="preface-acknowledgements">
      <title>感謝</title>

      <para>在此要感謝 Sue Blake, Patrick Durusau, Jon Hamilton, Peter Flynn, Christopher Maden 這些人的協助與閱讀初期草稿,並提供許多寶貴的潤稿意見與評論。</para>
    </sect1>
  </preface>

  
<!-- Copyright (c) 1998, 1999 Nik Clayton, All rights reserved.

     Redistribution and use in source (SGML DocBook) and 'compiled' forms
     (SGML HTML, PDF, PostScript, RTF and so forth) with or without
     modification, are permitted provided that the following conditions
     are met:

      1. Redistributions of source code (SGML DocBook) must retain the above
         copyright notice, this list of conditions and the following
         disclaimer as the first lines of this file unmodified.

      2. Redistributions in compiled form (transformed to other DTDs,
         converted to PDF, PostScript, RTF and other formats) must reproduce
         the above copyright notice, this list of conditions and the
         following disclaimer in the documentation and/or other materials
         provided with the distribution.

     THIS DOCUMENTATION IS PROVIDED BY NIK CLAYTON "AS IS" AND ANY EXPRESS OR
     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL NIK CLAYTON BE LIABLE FOR ANY DIRECT,
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGE.

     $FreeBSD$
-->
<chapter version="5.0" xml:id="overview">
  <title>概論</title>

  <para>歡迎參與 FreeBSD 說明文件計劃 (FreeBSD Documentation Project, <acronym>FDP</acronym>)。維持優秀質量的文件對 FreeBSD 的成功來說十分重要,您的點滴貢獻都是十分寶貴的。</para>

  <para>本文件描述:『 <acronym>FDP</acronym> 的架構有哪些』、『如何撰寫並提交文件』、 『如何有效運用工具來協助撰稿』。</para>

  <para>歡迎大家對 <acronym>FDP</acronym> 做出貢獻。唯一的成員要求就有貢獻的意願。</para>

  <para>本入門書指出如何:</para>

  <itemizedlist>
    <listitem>
      <para>瞭解有哪些文件是由 <acronym>FDP</acronym> 所維護的。</para>
    </listitem>

    <listitem>
      <para>安裝所需的說明文件工具和檔案。</para>
    </listitem>

    <listitem>
      <para>修改說明文件。</para>
    </listitem>

    <listitem>
      <para>提交修改以供審核並納入 FreeBSD 說明文件。</para>
    </listitem>
  </itemizedlist>

  <sect1 xml:id="overview-quick-start">
    <title>快速上手</title>

    <para>在編輯 FreeBSD 說明文件之前,有一些準備工作要做。 首先,請訂閱  <link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-doc">FreeBSD 文件計劃郵件論壇</link>。 有些團隊成員也會出現在 <link xlink:href="http://www.efnet.org/">EFnet</link><literal>#bsddocs</literal> <acronym>IRC</acronym> 頻道。這些人可以幫忙解決文件相關的問題。</para>

    <procedure>
      <step>
	<para>安裝 <package>textproc/docproj</package> 套件或 Port。這個 meta-port 會安裝所有編輯和建置 FreeBSD 說明文件需要的軟體。</para>
      </step>

      <step>
	<para><filename>~/doc</filename> 安裝 FreeBSD 說明文件檔案庫的本地端工作副本 (請見 <xref linkend="working-copy"/>)。</para>

	<screen><prompt>%</prompt> <userinput>svn checkout https://svn.FreeBSD.org/doc/head <replaceable>~/doc</replaceable></userinput></screen>
      </step>

      <step>
	<para>設定文字編輯器:</para>

	<itemizedlist>
	  <listitem>
	    <para>自動換行 (Word wrap) 設為 70 個字元。</para>
	  </listitem>

	  <listitem>
	    <para>Tab 定位點 (Tab stops) 設成 2</para>
	  </listitem>

	  <listitem>
	    <para>將行首每 8 個空白取代成 1 個 Tab。</para>
	  </listitem>
	</itemizedlist>

	<para>特定編輯器的設定方式列於 <xref linkend="editor-config"/></para>
      </step>

      <step>
	<para>更新本地端工作副本</para>

	<screen><prompt>%</prompt> <userinput>svn up <replaceable>~/doc</replaceable></userinput></screen>
      </step>

      <step>
	<para>編輯需要修改的說明文件檔案。如果檔案需要大幅度的編修,請先諮詢郵件論壇。</para>

	<para>標籤 (Tag) 和 Entity 的使用方式可以參考 <xref linkend="xhtml-markup"/><xref linkend="docbook-markup"/>.  。</para>
      </step>

      <step>
	<para>編輯完後,執行以下指令來檢查是否有問題:</para>

	<screen><prompt>%</prompt> <userinput>igor -R filename.xml | less -RS</userinput></screen>

	<para>檢查輸出並重新編輯檔案來修正顯示的錯誤,然後重新執行指令來找出剩下的問題。重複執行直到所有錯誤都解決完。</para>
      </step>

      <step>
	<para><emphasis>永遠要</emphasis>送出修正前請先做建置測試 (Build-test) 。在編輯的說明文件目錄最頂層執行 <userinput>make</userinput>,將會產生分頁的 HTML 格式 (Split HTML) 的文件。例如要建置 <acronym>HTML</acronym> 格式的英文版使用手冊,請在 <filename>en_US.ISO8859-1/books/handbook/</filename> 目錄執行 <command>make</command></para>
      </step>

      <step>
	<para>修改並測試完後,產生 <quote>diff 檔</quote></para>

	<screen><prompt>%</prompt> <userinput>cd ~/doc</userinput>
<prompt>%</prompt> <userinput>svn diff &gt; <replaceable>bsdinstall</replaceable>.diff.txt</userinput></screen>

	<para>設一個可辨識的檔名。如上例中,是使用手冊的 <filename>bsdinstall</filename> 部份的修改。</para>
      </step>

      <step>
	<para>使用網頁版 <link xlink:href="@@URL_RELPREFIX@@/support.html#gnats">問題回報</link> 系統提交 diff 檔。 如果使用網頁版,請輸入 <emphasis>[patch] <replaceable>問題簡短描述</replaceable></emphasis> 的概要 。選擇 <literal>docs</literal> 分類和 <literal>doc-bug</literal>類別。在訊息的主體中,輸入修正的簡短描述和其他相關的重要的細節。使用 <guibutton>[ Browse... ]</guibutton> 按鈕來附加 diff 檔。</para>
      </step>
    </procedure>
  </sect1>

  <sect1 xml:id="overview-doc">
    <title>FreeBSD 說明文件集</title>

    <para><acronym>FDP</acronym> 負責四類 FreeBSD 說明文件。</para>

    <itemizedlist>
      <listitem>
	<para><emphasis>使用手冊 (Handbook)</emphasis>:使用手冊主要是給 FreeBSD 使用者提供詳盡的線上參考資料。</para>
      </listitem>

      <listitem>
	<para><emphasis>常見問答集 (FAQ)</emphasis>:主要是收集在各郵件論壇或論壇會常問到或有可能會問到的 FreeBSD 相關問題與答案 。 (簡單講,就是『問答集』格式) 通常會擺在這裡面的問答格式,不會放太長的詳細內容。</para>
      </listitem>

      <listitem>
	<para><emphasis>操作手冊 (Manual page)</emphasis>:英文版的系統手冊並不是由 <acronym>FDP</acronym> 所撰寫的,因為它們是屬於基礎系統 (Base system) 的部份。 然而,<acronym>FDP</acronym> 可以修改這些文件,來讓這些文件寫得更清楚,甚至是勘正錯誤的地方。</para>
      </listitem>

      <listitem>
	<para><emphasis>網站</emphasis>:這是 FreeBSD 在網路上的主要部份,位於 <link xlink:href="http://www.freebsd.org/index.html">http://www.FreeBSD.org/</link> 以及許多其他鏡像站 (Mirror)。這網站是許多人第一次接觸 FreeBSD 的地方</para>
      </listitem>
    </itemizedlist>

    <para>翻譯團隊負責翻譯使用手冊和網站到不同的語言。線上手冊目前並未翻譯</para>

    <para>FreeBSD 網站、使用手冊、和 <acronym>FAQ</acronym> 的文件原始碼可以在 <literal>https://svn.FreeBSD.org/doc/</literal> 的文件檔案庫取得。</para>

    <para>線上手冊的原始碼則是在 <literal>https://svn.FreeBSD.org/base/</literal> 的原始碼庫可以取得。</para>

    <para>說明文件提交訊息可以用 <command>svn log</command> 察看。 提交訊息也會封存在 <uri xlink:href="http://lists.FreeBSD.org/mailman/listinfo/svn-doc-all">http://lists.FreeBSD.org/mailman/listinfo/svn-doc-all</uri></para>

    <para>這些儲存庫的網頁版位於 <link xlink:href="https://svnweb.FreeBSD.org/doc/"/><link xlink:href="https://svnweb.FreeBSD.org/base/"/></para>

    <para>許多人會寫 FreeBSD 的教學文件或是 how-to 文章。有些保存在 <acronym>FDP</acronym> 的檔案中。其他一些說明文件則是作者希望放在他處。<acronym>FDP</acronym> 會盡力提供這些說明文件的連結。</para>
  </sect1>
</chapter>

  
<!-- Copyright (c) 1998, 1999 Nik Clayton, All rights reserved.

     Redistribution and use in source (SGML DocBook) and 'compiled' forms
     (SGML, HTML, PDF, PostScript, RTF and so forth) with or without
     modification, are permitted provided that the following conditions
     are met:

      1. Redistributions of source code (SGML DocBook) must retain the above
         copyright notice, this list of conditions and the following
         disclaimer as the first lines of this file unmodified.

      2. Redistributions in compiled form (transformed to other DTDs,
         converted to PDF, PostScript, RTF and other formats) must reproduce
         the above copyright notice, this list of conditions and the
         following disclaimer in the documentation and/or other materials
         provided with the distribution.

     THIS DOCUMENTATION IS PROVIDED BY NIK CLAYTON "AS IS" AND ANY EXPRESS OR
     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL NIK CLAYTON BE LIABLE FOR ANY DIRECT,
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGE.

     $FreeBSD$
-->
<chapter version="5.0" xml:id="tools">
  <title>工具</title>

  <para>有些工具軟體用來管理 FreeBSD 說明文件,並將他轉換成不同的輸出格式。 有些則是在使用接下來章節的範例之前一定要安裝。有些工具是選擇性安裝的,但是裝了之後會更容易進行文件製作工作。</para>

  <sect1 xml:id="tools-required">
    <title>必備工具</title>

    <para>從 Port 套件集安裝 <package>textproc/docproj</package>。這個  <emphasis>meta-port</emphasis> 會安裝處理 FreeBSD 說明文件需要的所有應用程式。以下列出特定元件的進一步說明。</para>

    <sect2>
      <title><acronym>DTD</acronym>s 與 <acronym>Entities</acronym></title>

      <para>FreeBSD 說明文件使用幾種文件類型定義  (<acronym>DTD</acronym>s) 與 <acronym>XML</acronym> entities 集合。這些都會經由 <package>textproc/docproj</package> Port 來安裝。</para>

      <variablelist>
	<varlistentry>
	  <term><acronym>XHTML</acronym> <acronym>DTD</acronym> (<package>textproc/xhtml</package>)</term>

	  <listitem>
	    <para><acronym>XHTML</acronym> 是全球資訊網的一種標記語言,也是整個 FreeBSD 網站所使用的格式。</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term xml:lang="en">DocBook <acronym>DTD</acronym> (<package>textproc/docbook-xml</package>)</term>

	  <listitem>
	    <para>DocBook 設計來製作技術說明文件的標記語言版本。FreeBSD 說明文件是以 DocBook 來撰寫。</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term>ISO 8879 entities (<package>textproc/iso8879</package>)</term>

	  <listitem>
	    <para>在 ISO 8879:1986 之中的 entity 被許多 <acronym>DTD</acronym> 所大量使用, 包括了數學符號、拉丁字母符號(尖重音等音節符號也是)以及希臘符號。</para>
	  </listitem>
	</varlistentry>
      </variablelist>
    </sect2>
  </sect1>

  <sect1 xml:id="tools-optional">
    <title>選用工具</title>

    <para>以下應用程式並非必要,但有了可讓在說明文件的作業上更簡單或提升能力。</para>

    <sect2>
      <title>軟體</title>

      <variablelist>

	<varlistentry>
	  <term><application>Vim</application> (<package>editors/vim</package>)</term>

	  <listitem>
	    <para>一個很受歡迎的編輯器,可以處理 <acronym>XML</acronym> 和他的衍生相關文件,例如 DocBook <acronym>XML</acronym></para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><application>Emacs</application><application>XEmacs</application> (<package>editors/emacs</package><package>editors/xemacs</package>)</term>

	  <listitem>
	    <para>這兩個編輯器都包含特別模式來編輯用 <acronym>XML</acronym> <acronym>DTD</acronym> 標記的文件。這個模式包含指令來減少打字量,並可以幫忙減少錯誤的發生。</para>
	  </listitem>
	</varlistentry>
      </variablelist>
    </sect2>
  </sect1>
</chapter>

  
<!-- Copyright (c) 2013 Warren Block
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
    1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above
    copyright notice, this list of conditions and the following
    disclaimer in the documentation and/or other materials provided
    with the distribution.

    THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS
    IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
    FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
    AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    $FreeBSD$
-->
<chapter version="5.0" xml:id="working-copy">
  <title>工作副本</title>

  <para><emphasis>工作副本 (Working copy)</emphasis> 指的是已下載到本地電腦的 FreeBSD 說明文件樹檔案庫,所有對工作副本的更改會經過測試後再以修補檔 (Patch) 的格式提交到主要檔案庫。</para>

  <para>完整的說明文件樹副本會佔據 700 MB 的磁碟空間,要有空間能夠儲存暫存檔及各種輸出格式的測試版本需要 1 GB 的空間。</para>

  <para>FreeBSD 說明文件檔案使用 <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/svn.html"><application>Subversion</application></link> 來管理,由於 <application>Subversion</application><package>textproc/docproj</package> 的必要應用程式之一,所以會隨著 <package>textproc/docproj</package> 一併安裝。</para>

  <sect1 xml:id="working-copy-doc-and-src">
    <title>說明文件與操作手冊</title>

    <para>FreeBSD 說明文件不只有書籍與文章,還有所有指令與設定檔的操作手冊 (Manual page) 也是文件的一部份,其中也有一部份是 <acronym>FDP</acronym> 的地盤。相關的檔案庫有兩個:<literal>doc</literal> 中有書籍與文章,而 <literal>base</literal> 中有作業系統以及操作手冊。要編輯操作手冊則必須另外取出 (Checkout) <literal>base</literal> 檔案庫。</para>

    <para>檔案庫中可能會含有數個版本的說明文件與原始碼。新的修改幾乎都只對最新版本 <literal>head</literal>  做更新。</para>
  </sect1>

  <sect1 xml:id="working-copy-choosing-directory">
    <title>選擇一個目錄</title>

    <para>FreeBSD 說明文件一般會儲存在 <filename>/usr/doc/</filename>,而系統原始碼及操作手冊則會存在 <filename>/usr/src/</filename>。這些目錄樹可改放在其他地方,使用者可能會為了避免與現有在主要目錄的資料搞混,把工作副本放在其他的地方。以下的例子會放在 <filename>~/doc</filename> 以及 <filename>~/src</filename> 兩個在使用者家目錄下的目錄。</para>
  </sect1>

  <sect1 xml:id="working-copy-checking-out">
    <title>取出一份副本</title>

    <para>從檔案庫下載工作副本的動作稱作 <emphasis>取出 (Checkout)</emphasis>,使用 <command>svn checkout</command> 來完成。本範例會取出主要說明文件樹最新版本的副本:</para>

    <screen><prompt>%</prompt> <userinput>svn checkout https://svn.FreeBSD.org/doc/head <replaceable>~/doc</replaceable></userinput></screen>

    <para>取出原始碼編輯操作手冊的動作非常相似:</para>

    <screen xml:lang="en"><prompt>%</prompt> <userinput>svn checkout https://svn.FreeBSD.org/base/head <replaceable>~/src</replaceable></userinput></screen>
  </sect1>

  <sect1 xml:id="working-copy-updating">
    <title>更新工作副本</title>

    <para>在 FreeBSD 檔案庫中的文件與檔案每天都會更改,人們會修改檔案與提交變更的頻率非常快,即使取出 (Checkout) 只過小一段時間,本地的工作副本可能就與主要 FreeBSD 檔案庫有差異了。要更新本地版本以同步對主要檔案庫的變更可在有本地工作副本的目錄下使用 <command>svn update</command></para>

    <screen><prompt>%</prompt> <userinput>svn update <replaceable>~/doc</replaceable></userinput></screen>

    <para>養成良好的習慣在編輯文件檔前先執行 <command>svn update</command>,可能會有其他人才剛編輯完該檔案,本地工作副本在尚未更新前不會有最後的變更內容,編輯最新版本的檔案會比將舊版本地檔案與新版檔案庫檔案合併來的簡單多了。</para>
  </sect1>

  <sect1 xml:id="working-copy-revert">
    <title>還原變更</title>

    <para>有時才做完的變更可能就變的不需要了,或者作者剛想要重新搛寫。檔案可使以使用 <command>svn revert</command><quote>重設</quote>成尚未被修改刪的狀態,舉例來說,要清除所有對 <filename>chapter.xml</filename> 的修改然後還原到未修改的版本可:</para>

    <screen xml:lang="en"><prompt>%</prompt> <userinput>svn revert chapter.xml</userinput></screen>
  </sect1>

  <sect1 xml:id="working-copy-making-diff">
    <title>比對差異</title>

    <para>在編輯一個檔案或數個檔案完成之後,需將本地工作副本與 FreeBSD 檔案庫的差異儲存到一個檔案然後提交。這些 <emphasis>差異 (Diff)</emphasis> 檔可透過將 <command>svn diff</command> 的輸出轉向到檔案來建立: </para>

    <screen xml:lang="en"><prompt>%</prompt> <userinput>cd <replaceable>~/doc</replaceable></userinput>
<prompt>%</prompt> <userinput>svn diff &gt; <replaceable>doc-fix-spelling.diff</replaceable></userinput></screen>

    <para>給檔案取一個有意義的名字來辨識這次修改的內容,上述範例為例則是要修正整個說明文件樹的拼寫。</para>

    <para>若 diff 檔要使用網站的 <quote><link xlink:href="https://bugs.FreeBSD.org/bugzilla/enter_bug.cgi">Submit a FreeBSD problem report</link></quote> 介面來提交,請加上 <filename>.txt</filename> 副檔名來給認真又單純的網頁表單可以辨識其內容為純文字的線索。</para>

    <para>請小心:<command>svn diff</command> 會產生所有在目前目錄及其子目錄的變更差異,若在該工作副本中有已經編輯過的檔案還沒有要提交,請列出需要比較差異的檔案清單:</para>

    <screen xml:lang="en"><prompt>%</prompt> <userinput>cd <replaceable>~/doc</replaceable></userinput>
<prompt>%</prompt> <userinput>svn diff <replaceable>disks/chapter.xml printers/chapter.xml</replaceable> &gt; <replaceable>disks-printers.diff</replaceable></userinput></screen>
  </sect1>

  <sect1 xml:id="working-copy-subversion-references">
    <title><application>Subversion</application> 參考文獻</title>

    <para>以下範例會示範 <application>Subversion</application> 的基本用法,要取得更多資訊可至 <link xlink:href="http://svnbook.red-bean.com/">Subversion Book</link><link xlink:href="http://subversion.apache.org/docs/">Subversion 說明文件</link></para>
  </sect1>
</chapter>

  
<!-- Copyright (c) 1998, 1999 Nik Clayton, All rights reserved.

     Redistribution and use in source (SGML DocBook) and 'compiled' forms
     (SGML HTML, PDF, PostScript, RTF and so forth) with or without
     modification, are permitted provided that the following conditions
     are met:

      1. Redistributions of source code (SGML DocBook) must retain the above
         copyright notice, this list of conditions and the following
         disclaimer as the first lines of this file unmodified.

      2. Redistributions in compiled form (transformed to other DTDs,
         converted to PDF, PostScript, RTF and other formats) must reproduce
         the above copyright notice, this list of conditions and the
         following disclaimer in the documentation and/or other materials
         provided with the distribution.

     THIS DOCUMENTATION IS PROVIDED BY NIK CLAYTON "AS IS" AND ANY EXPRESS OR
     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL NIK CLAYTON BE LIABLE FOR ANY DIRECT,
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGE.

     $FreeBSD$
-->
<chapter version="5.0" xml:id="structure">
  <title>說明文件目錄結構</title>

  <para><filename>doc/</filename> 樹中的檔案與目錄需要遵守特定結構是因為:</para>

  <orderedlist>
    <listitem>
      <para>讓自動轉換說明文件到各種格式更簡單。</para>
    </listitem>

    <listitem>
      <para>促進不同說明文件組織之間的一致性,以便更輕鬆的在不同說明文件之間切換。</para>
    </listitem>

    <listitem>
      <para>可以很容易的決定新的說明文件應該放在文件樹中的哪個位置。</para>
    </listitem>
  </orderedlist>

  <para>除此之外,說明文件樹必須能容納各種不同語言與編碼的說明文件。很重要的一點是,說明文件樹結構不應強制任何特定默認或文化的偏好。</para>

  <sect1 xml:id="structure-top">
    <title>最上層,<filename>doc/</filename></title>

    <para><filename>doc/</filename> 底下有兩種類型的目錄,兩種都有非常明確的目錄名稱與意義。</para>

    <informaltable pgwide="1" frame="none">
      <tgroup cols="2">
	<thead>
	  <row>
	    <entry>目錄</entry>
	    <entry>用途</entry>
	  </row>
	</thead>

	<tbody>
	  <row>
	    <entry valign="top" xml:lang="en">
	      <filename>share</filename></entry>

	    <entry>含有未特定用於各說明文件翻譯與編碼的檔案。其子目錄更進一步將不同資訊的分類,例如,構成 <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry> 基礎設施的檔案放置於 <filename>share/mk</filename>,而額外的 <acronym>XML</acronym> 支援檔 (如 FreeBSD 延伸的 DocBook <acronym>DTD</acronym>) 則放在 <filename>share/xml</filename></entry>
	  </row>

	  <row>
	    <entry valign="top" xml:lang="en">
		<filename><replaceable>lang</replaceable>.<replaceable>encoding</replaceable></filename></entry>

	    <entry>每一個目錄代表可用的說明文件翻譯與編碼,例如 <filename>en_US.ISO8859-1/</filename><filename>zh_TW.UTF-8/</filename>。名稱雖然長,但完整表達語言與編碼可以避免未來當一個翻譯團隊要以不同編碼提供同一個語言的說明文件造成的問題,這也同時避免往後要切換成萬國碼 (Unicode) 可能造成的問題。</entry>
	  </row>
	</tbody>
      </tgroup>
    </informaltable>
  </sect1>

  <sect1 xml:id="structure-locale">
    <title><filename><replaceable>lang</replaceable>.<replaceable>encoding</replaceable>/</filename> 目錄</title>

    <para>這些目錄中含有說明文件。在此階層說明文件分成三個分類,使用不同的目錄名稱來代表。</para>

    <informaltable pgwide="1" frame="none">
      <tgroup cols="2">
	<thead>
	  <row>
	    <entry>目錄</entry>
	    <entry>用途</entry>
	  </row>
	</thead>

	<tbody>
	  <row>
	    <entry valign="top" xml:lang="en">
	      <filename>articles</filename></entry>

	    <entry>以 DocBook  <tag>article</tag> (或同等級) 標記的說明文件。非常短,且會分成幾個小節,通常取得時只會有一個 <acronym>XHTML</acronym> 檔案。</entry>
	  </row>

	  <row>
	    <entry valign="top" xml:lang="en"><filename>books</filename></entry>

	    <entry>以 DocBook  <tag>book</tag> (或同等級) 標記的說明文件。有跟書籍一樣的長度,會分成數個章。通常取得時會包含一個大型的 <acronym>XHTML</acronym> 檔 (供有較快連線速度的人使用,或者那些想直接在瀏覽器列印的人) 與數個連結的較小的檔案。</entry>
	  </row>

	  <row>
	    <entry valign="top" xml:lang="en">
	      <filename>man</filename></entry>

	    <entry>供系統操作手冊 (Manual page) 翻譯使用。這個目錄會包含一個或多個 <filename role="directory">man<replaceable>n</replaceable></filename> 目錄來對應已經翻譯的章節。</entry>
	  </row>
	</tbody>
      </tgroup>
    </informaltable>

    <para>並非所有 <filename role="directory"><replaceable>lang</replaceable>.<replaceable>encoding</replaceable></filename> 的目錄都會有這些子目錄,這要看該翻譯團隊已經完成了多少翻譯來決定。</para>
  </sect1>

  <sect1 xml:id="structure-document">
    <title>文件特定資訊</title>

    <para>本節內含有關由 FDP 所管理的特定文件的特定注意事項。</para>

    <sect2>
      <title>使用手冊 (Handbook)</title>

      <subtitle xml:lang="en"><filename>books/handbook/</filename></subtitle>

      <para>操作手冊是以使用 FreeBSD DocBook 擴充 <acronym>DTD</acronym> 的 DocBook <acronym>XML</acronym> 所撰寫。</para>

      <para>使用手冊使用 DocBook <tag>book</tag> 來組織,整個手冊區分成數個部份 (<tag>part</tag>),每個部份中內含數個章 (<tag>chapter</tag>),而章 (<tag>chapter</tag>) 又更進一步的細分成數個節 (<tag>sect1</tag>) 與小節 (<tag>sect2</tag>, <tag>sect3</tag>) 以此類推。</para>

      <sect3>
	<title>實體組織結構</title>

	<para><filename>handbook</filename> 目錄中有數個檔案及目錄。</para>

	<note>
	  <para>使用手冊的組織結構可能會隨時改變,本文件所詳述的組織結構可能會與現況不盡相同。有關使用手冊組織結構的問題可張貼到 <link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-doc">FreeBSD documentation project mailing list</link></para>
	</note>

	<sect4>
	  <title xml:lang="en"><filename>Makefile</filename></title>

	  <para><filename>Makefile</filename> 定義了一些會影響 <acronym>XML</acronym> 原始碼要如何轉換至其他格式的變數,並列出產生使用手冊所需的各原始檔,接著會引用可處理在各種文件格式轉換的標準 <filename>doc.project.mk</filename> 程式碼。</para>
	</sect4>

	<sect4>
	  <title xml:lang="en"><filename>book.xml</filename></title>

	  <para>此為使用手冊的最上層文件,其中包含了使用手冊的 <link linkend="xml-primer-doctype-declaration">DOCTYPE 宣告</link>以及用來描述使用手冊結構的元素。</para>

	  <para><filename>book.xml</filename> 會使用 <link linkend="xml-primer-parameter-entities">參數 Entities</link> 來載入 <filename>.ent</filename> 副檔名的檔案。這些檔案 (稍後會詳述) 接著會定義使用手冊剩下篇幅會使用的 <link linkend="xml-primer-general-entities">一般 Entities</link></para>
	</sect4>

	<sect4>
	  <title xml:lang="en"><filename role="directory"><replaceable>directory</replaceable>/chapter.xml</filename></title>

	  <para>每個在使用手冊的章會儲存成名稱為 <filename>chapter.xml</filename> 的檔案,分別放在不同的目錄中。每個目錄均是以在 <tag>chapter</tag> 元素中 <literal>id</literal> 屬性中的值來命名。</para>

	  <para>例如,若有一章的檔案內容為:</para>

	  <programlisting xml:lang="en"><tag class="starttag">chapter id="kernelconfig"</tag>
...
<tag class="endtag">chapter</tag></programlisting>

	  <para>那麼放置這個 <filename>chapter.xml</filename> 的目錄則會命名為 <filename>kernelconfig</filename>。一般來說一章的所有內容會存放在這一個檔案。</para>

	  <para>當有 <acronym>XHTML</acronym> 版本的使用手冊之後,也會用這個檔產出 <filename>kernelconfig.html</filename>,這個名稱是根據 <literal>id</literal> 的值而定,與目錄名稱無關。</para>

	  <para>在早期版本的使用手冊,檔案皆儲存在與 <filename>book.xml</filename> 相同的目錄中,而名稱會以 <tag>chapter</tag> 元素中的 <literal>id</literal> 屬性的值來命名。現在可在每個章節之中引用圖片,每個使用手冊章節的圖片會儲存在 <filename>share/images/books/handbook</filename>,而在地化版本的圖片應放在與每個章節 <acronym>XML</acronym> 原始碼相同的目錄。命名空間會衝突是必然的,但以目錄多、檔案少與目錄少、檔案多的結構相比,目錄多、檔案少會較容易處理命名空間衝突的問題。</para>

	  <para>簡單來說會有很多個內含 <filename>chapter.xml</filename> 檔案的目錄,例如 <filename>basics/chapter.xml</filename>, <filename>introduction/chapter.xml</filename> 以及 <filename>printing/chapter.xml</filename></para>

	  <important>
	    <para>請勿以在使用手冊中的章節順序來命名章節或目錄,因為順序是會隨使用手冊重新組織後的內容改變的。重新組織結構應不需要去重新命名檔案,除非整個章節的階層被提升或下降。</para>
	  </important>

	  <para><filename>chapter.xml</filename> 檔案並不是可以被單獨建置的完整 <acronym>XML</acronym> 文件,只能做為使用手冊的一部份來建置。</para>
	</sect4>
      </sect3>
    </sect2>
  </sect1>
</chapter>

  
<!-- Copyright (c) 1999 Neil Blakey-Milner, All rights reserved.

     Redistribution and use in source (SGML DocBook) and 'compiled' forms
     (SGML HTML, PDF, PostScript, RTF and so forth) with or without
     modification, are permitted provided that the following conditions
     are met:

      1. Redistributions of source code (SGML DocBook) must retain the above
         copyright notice, this list of conditions and the following
         disclaimer as the first lines of this file unmodified.

      2. Redistributions in compiled form (transformed to other DTDs,
         converted to PDF, PostScript, RTF and other formats) must reproduce
         the above copyright notice, this list of conditions and the
         following disclaimer in the documentation and/or other materials
         provided with the distribution.

     THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL NIK CLAYTON BE LIABLE FOR ANY DIRECT,
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGE.

     $FreeBSD$
-->
<chapter version="5.0" xml:id="doc-build">
  <title>說明文件建置流程</title>

  <para>本章內容涵蓋了說明文件建置流程以及如何使用 <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry> 來控制如何建置。</para>

  <sect1 xml:id="doc-build-rendering">
    <title>繪製 Docbook 為其他格式</title>

    <para>從單一個 DocBook 原始檔可以產生各種不同類型的輸出,想要輸出的類型可用 <varname>FORMATS</varname> 變數來設定。已知的格式清單列在 <varname>KNOWN_FORMATS</varname> 中:</para>

    <screen xml:id="doc-build-rendering-known-formats" xml:lang="en"><prompt>%</prompt> <userinput>cd ~/doc/en_US.ISO8859-1/books/handbook</userinput>
<prompt>%</prompt> <userinput>make -V KNOWN_FORMATS</userinput></screen>

    <table xml:id="doc-build-rendering-common-formats" frame="none">
      <title>常見輸出格式</title>

      <tgroup cols="3">
	<thead>
	  <row>
	    <entry><varname>FORMATS</varname></entry>
	    <entry>檔案類型</entry>
	    <entry>說明</entry>
	  </row>
	</thead>

	<tbody>
	  <row>
	    <entry xml:lang="en"><literal>html</literal></entry>
	    <entry><acronym>HTML</acronym>,單檔</entry>
	    <entry>單一 <filename>book.html</filename><filename>article.html</filename></entry>
	  </row>

	  <row>
	    <entry xml:lang="en"><literal>html-split</literal></entry>
	    <entry><acronym>HTML</acronym>,多檔</entry>
	    <entry>多個 <acronym>HTML</acronym> 檔案,每個章或節一個檔案,供一般網站使用。</entry>
	  </row>

	  <row>
	    <entry xml:lang="en"><literal>pdf</literal></entry>
	    <entry xml:lang="en"><acronym>PDF</acronym></entry>
	    <entry>可攜的文件格式</entry>
	  </row>
	</tbody>
      </tgroup>
    </table>

    <para>預設輸出的格式會依文件而有所不同,但同常是 <literal>html-split</literal>。其他格式可設定 <varname>FORMATS</varname> 為特定值來選擇。在 <varname>FORMATS</varname> 設定所需格式的清單可一次輸出多個格式。</para>

    <example xml:id="doc-build-formats-example-html">
      <title>建置單頁 HTML 輸出檔</title>

      <screen xml:lang="en"><prompt>%</prompt> <userinput>cd ~/doc/en_US.ISO8859-1/books/handbook</userinput>
<prompt>%</prompt> <userinput>make FORMATS=html</userinput></screen>
    </example>

    <example xml:id="doc-build-formats-example-html-split-pdf">
      <title>建置分頁 HTML 及 <acronym>PDF</acronym> 輸出檔</title>

      <screen xml:lang="en"><prompt>%</prompt> <userinput>cd ~/doc/en_US.ISO8859-1/books/handbook</userinput>
<prompt>%</prompt> <userinput>make FORMATS="html-split pdf"</userinput></screen>
    </example>
  </sect1>

  <sect1 xml:id="doc-build-toolset">
    <title>FreeBSD 說明文件建置工具集</title>

    <para>建置與安裝 <acronym>FDP</acronym> 說明文件會使用到以下工具。</para>

    <itemizedlist>
      <listitem>
	<para>主要的建置工具為 <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry>,特別是 <application>Berkeley Make</application></para>
      </listitem>

      <listitem>
	<para>套件建置會使用 FreeBSD 的 <citerefentry><refentrytitle>pkg-create</refentrytitle><manvolnum>8</manvolnum></citerefentry> 來處理。</para>
      </listitem>

      <listitem>
	<para><citerefentry><refentrytitle>gzip</refentrytitle><manvolnum>1</manvolnum></citerefentry> 用來建立壓縮版的文件,也支援 <citerefentry><refentrytitle>bzip2</refentrytitle><manvolnum>1</manvolnum></citerefentry> 封存。<citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry> 則用在套件建置。</para>
      </listitem>

      <listitem>
	<para><citerefentry><refentrytitle>install</refentrytitle><manvolnum>1</manvolnum></citerefentry> 用來安裝說明文件。</para>
      </listitem>
    </itemizedlist>
  </sect1>

  <sect1 xml:id="doc-build-makefiles">

    <title>了解在說明文件樹中的 <filename>Makefile</filename></title>

    <para>在 FreeBSD 說明文件計劃樹底下的 <filename>Makefile</filename> 主要有三個類型。</para>

    <itemizedlist>
      <listitem>
	<para><link linkend="sub-make">子目錄的 <filename>Makefile</filename></link> 傳遞指令給在其所在目錄底下的目錄。</para>
      </listitem>

      <listitem>
	<para><link linkend="doc-make">說明文件的 <filename>Makefile</filename>s</link> 用來描述要如何在其所在目錄產生文件。</para>
      </listitem>

      <listitem>
	<para><link linkend="make-includes"><application>Make</application> 引用檔</link> 會連結一些產生文件所需的程式,通常為 <filename>doc.<replaceable>xxx</replaceable>.mk</filename></para>
      </listitem>
    </itemizedlist>

    <sect2 xml:id="sub-make">
      <title>子目錄的 <filename>Makefile</filename></title>

      <para xml:lang="en">These <filename>Makefile</filename>s usually take the form
	of:</para>

      <programlisting xml:lang="en">SUBDIR =articles
SUBDIR+=books

COMPAT_SYMLINK = en

DOC_PREFIX?= ${.CURDIR}/..
.include "${DOC_PREFIX}/share/mk/doc.project.mk"</programlisting>

      <para xml:lang="en">The first four non-empty lines define the <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry>
	variables <varname>SUBDIR</varname>,
	<varname>COMPAT_SYMLINK</varname>, and
	<varname>DOC_PREFIX</varname>.</para>

      <para xml:lang="en">The <varname>SUBDIR</varname> statement and
	<varname>COMPAT_SYMLINK</varname> statement show how to
	assign a value to a variable, overriding any previous
	value.</para>

      <para xml:lang="en">The second <varname>SUBDIR</varname> statement shows how a
	value is appended to the current value of a variable.  The
	<varname>SUBDIR</varname> variable is now <literal>articles
	  books</literal>.</para>

      <para xml:lang="en">The <varname>DOC_PREFIX</varname> assignment shows how a
	value is assigned to the variable, but only if it is not
	already defined.  This is useful if
	<varname>DOC_PREFIX</varname> is not where this
	<filename>Makefile</filename> thinks it is - the user can
	override this and provide the correct value.</para>

      <para xml:lang="en">What does it all mean?  <varname>SUBDIR</varname>
	mentions which subdirectories below this one the build process
	should pass any work on to.</para>

      <para xml:lang="en"><varname>COMPAT_SYMLINK</varname> is specific to
	compatibility symlinks (amazingly enough) for languages to
	their official encoding (<filename>doc/en</filename> would
	point to <filename>en_US.ISO-8859-1</filename>).</para>

      <para xml:lang="en"><varname>DOC_PREFIX</varname> is the path to the root of
	the FreeBSD Document Project tree.  This is not always that easy
	to find, and is also easily overridden, to allow for
	flexibility.  <varname>.CURDIR</varname> is a <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry>
	builtin variable with the path to the current
	directory.</para>

      <para xml:lang="en">The final line includes the FreeBSD Documentation Project's
	project-wide <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry> system file
	<filename>doc.project.mk</filename> which is the glue which
	converts these variables into build instructions.</para>
    </sect2>

    <sect2 xml:id="doc-make">
      <title>說明文件的 <filename>Makefile</filename></title>

      <para>這些 <filename>Makefile</filename> 用來設定 <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry> 變數來描述要如何建置在該目錄中的說明文件。</para>

      <para>這裡有一個例子:</para>

      <programlisting xml:lang="en">MAINTAINER=nik@FreeBSD.org

DOC?= book

FORMATS?= html-split html

INSTALL_COMPRESSED?= gz
INSTALL_ONLY_COMPRESSED?=

# SGML content
SRCS=  book.xml

DOC_PREFIX?= ${.CURDIR}/../../..

.include "$(DOC_PREFIX)/share/mk/docproj.docbook.mk"</programlisting>

      <para><varname>MAINTAINER</varname> 變數讓提交者可以聲明文件在 FreeBSD 說明文件計劃中的所有權,並負責維護該文件。</para>

      <para><varname>DOC</varname> 是由此目錄會建立的主要文件的名稱 (不需要 <filename>.xml</filename> 副檔名)。<varname>SRCS</varname> 會列出產生文件所需的各別檔案,此處也應引用要在重新建置 (Rebuild) 使用的重要的檔案。</para>

      <para><varname>FORMATS</varname> 用來指定此份文件建置時預設應採用的格式。<varname>INSTALL_COMPRESSED</varname> 是為在文件建置時預設要使用的壓縮技術清單。<varname>INSTALL_ONLY_COMPRESS</varname> 預設為空值的,若在建置時只想要產生壓縮後的文件則改成非空值。</para>

      <para><varname>DOC_PREFIX</varname> 以及 include 敘述句應不需再說明了。</para>
    </sect2>
  </sect1>

  <sect1 xml:id="make-includes">
    <title>FreeBSD 說明文件計劃 <application>Make</application> 引用檔</title>

    <para xml:lang="en"><citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry> includes are best explained by inspection of
      the code.  Here are the system include files:</para>

    <itemizedlist>
      <listitem>
	<para xml:lang="en"><filename>doc.project.mk</filename> is the main project
	  include file, which includes all the following include
	  files, as necessary.</para>
      </listitem>

      <listitem>
	<para xml:lang="en"><filename>doc.subdir.mk</filename> handles traversing of
	  the document tree during the build and install
	  processes.</para>
      </listitem>

      <listitem>
	<para xml:lang="en"><filename>doc.install.mk</filename> provides variables
	  that affect ownership and installation of documents.</para>
      </listitem>

      <listitem>
	<para xml:lang="en"><filename>doc.docbook.mk</filename> is included if
	  <varname>DOCFORMAT</varname> is <literal>docbook</literal>
	  and <varname>DOC</varname> is set.</para>
      </listitem>
    </itemizedlist>

    <sect2>
      <title xml:lang="en"><filename>doc.project.mk</filename></title>

      <para xml:lang="en">By inspection:</para>

      <programlisting xml:lang="en">DOCFORMAT?=	docbook
MAINTAINER?=	doc@FreeBSD.org

PREFIX?=	/usr/local
PRI_LANG?=	en_US.ISO8859-1

.if defined(DOC)
.if ${DOCFORMAT} == "docbook"
.include "doc.docbook.mk"
.endif
.endif

.include "doc.subdir.mk"
.include "doc.install.mk"</programlisting>

      <sect3>

	<title>變數</title>

	<para xml:lang="en"><varname>DOCFORMAT</varname> and
	  <varname>MAINTAINER</varname> are assigned default values,
	  if these are not set by the document make file.</para>

	<para xml:lang="en"><varname>PREFIX</varname> is the prefix under which the
	  <link linkend="tools">documentation building tools</link>
	  are installed.  For normal package and port installation,
	  this is <filename>/usr/local</filename>.</para>

	<para xml:lang="en"><varname>PRI_LANG</varname> should be set to whatever
	  language and encoding is natural amongst users these
	  documents are being built for.  US English is the
	  default.</para>

	<note>
	  <para xml:lang="en"><varname>PRI_LANG</varname> does not affect which
	    documents can, or even will, be built.  Its main use is
	    creating links to commonly referenced documents into the
	    FreeBSD documentation install root.</para>
	</note>
      </sect3>

      <sect3>
	<title>條件</title>

	<para xml:lang="en">The <literal>.if defined(DOC)</literal> line is an
	  example of a <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry> conditional which, like in other
	  programs, defines behavior if some condition is true or if
	  it is false.  <literal>defined</literal> is a function which
	  returns whether the variable given is defined or not.</para>

	<para xml:lang="en"><literal>.if ${DOCFORMAT} == "docbook"</literal>, next,
	  tests whether the <varname>DOCFORMAT</varname> variable is
	  <literal>"docbook"</literal>, and in this case, includes
	  <filename>doc.docbook.mk</filename>.</para>

	<para xml:lang="en">The two <literal>.endif</literal>s close the two above
	  conditionals, marking the end of their application.</para>
      </sect3>
    </sect2>

    <sect2>
      <title xml:lang="en"><filename>doc.subdir.mk</filename></title>

      <para xml:lang="en">This file is too long to explain in detail.  These notes
	describe the most important features.</para>

      <sect3>
	<title>變數</title>

	<itemizedlist>
	  <listitem>
	    <para xml:lang="en"><varname>SUBDIR</varname> is a list of
	      subdirectories that the build process should go further
	      down into.</para>
	  </listitem>

	  <listitem>
	    <para xml:lang="en"><varname>ROOT_SYMLINKS</varname> is the name of
	      directories that should be linked to the document
	      install root from their actual locations, if the current
	      language is the primary language (specified by
	      <varname>PRI_LANG</varname>).</para>
	  </listitem>

	  <listitem>
	    <para xml:lang="en"><varname>COMPAT_SYMLINK</varname> is described in
	      the
	      <link linkend="sub-make">Subdirectory Makefile</link>
	      section.</para>
	  </listitem>
	</itemizedlist>
      </sect3>

      <sect3>
	<title>目標與巨集</title>

	<para xml:lang="en">Dependencies are described by
	  <literal><replaceable>target</replaceable>:
	      <replaceable>dependency1 dependency2
	      ...</replaceable></literal> tuples, where to build
	  <literal>target</literal>, the given
	  dependencies must be built first.</para>

	<para xml:lang="en">After that descriptive tuple, instructions on how to
	  build the target may be given, if the conversion process
	  between the target and its dependencies are not previously
	  defined, or if this particular conversion is not the same as
	  the default conversion method.</para>

	<para xml:lang="en">A special dependency <literal>.USE</literal> defines
	  the equivalent of a macro.</para>

	<programlisting xml:lang="en">_SUBDIRUSE: .USE
.for entry in ${SUBDIR}
	@${ECHO} "===&gt; ${DIRPRFX}${entry}"
	@(cd ${.CURDIR}/${entry} &amp;&amp; \
	${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ )
.endfor</programlisting>

	<para xml:lang="en">In the above, <buildtarget xml:lang="en">_SUBDIRUSE</buildtarget> is now
	  a macro which will execute the given commands when it is
	  listed as a dependency.</para>

	<para xml:lang="en">What sets this macro apart from other targets?
	  Basically, it is executed <emphasis>after</emphasis> the
	  instructions given in the build procedure it is listed as a
	  dependency to, and it does not adjust
	  <varname>.TARGET</varname>, which is the variable which
	  contains the name of the target currently being
	  built.</para>

	<programlisting xml:lang="en">clean: _SUBDIRUSE
	rm -f ${CLEANFILES}</programlisting>

	<para xml:lang="en">In the above, <buildtarget xml:lang="en">clean</buildtarget> will use
	  the <buildtarget xml:lang="en">_SUBDIRUSE</buildtarget> macro after it has
	  executed the instruction
	  <command>rm -f ${CLEANFILES}</command>.  In effect, this
	  causes <buildtarget xml:lang="en">clean</buildtarget> to go further and
	  further down the directory tree, deleting built files as it
	  goes <emphasis>down</emphasis>, not on the way back
	  up.</para>

	<sect4>
	  <title>已提供的目標</title>

	  <itemizedlist>
	    <listitem>
	      <para xml:lang="en"><buildtarget xml:lang="en">install</buildtarget> and
		<buildtarget xml:lang="en">package</buildtarget> both go down the
		directory tree calling the real versions of themselves
		in the subdirectories
		(<buildtarget xml:lang="en">realinstall</buildtarget> and
		<buildtarget xml:lang="en">realpackage</buildtarget>
		respectively).</para>
	    </listitem>

	    <listitem>
	      <para xml:lang="en"><buildtarget xml:lang="en">clean</buildtarget> removes files
		created by the build process (and goes down the
		directory tree too).
		<buildtarget xml:lang="en">cleandir</buildtarget> does the same, and
		also removes the object directory, if any.</para>
	    </listitem>
	  </itemizedlist>
	</sect4>
      </sect3>

      <sect3>
	<title>更多條件</title>

	<itemizedlist>
	  <listitem>
	    <para xml:lang="en"><literal>exists</literal> is another condition
	      function which returns true if the given file
	      exists.</para>
	  </listitem>

	  <listitem>
	    <para xml:lang="en"><literal>empty</literal> returns true if the given
	      variable is empty.</para>
	  </listitem>

	  <listitem>
	    <para xml:lang="en"><literal>target</literal> returns true if the given
	      target does not already exist.</para>
	  </listitem>
	</itemizedlist>
      </sect3>

      <sect3>
	<title><command>make (.for)</command> 中的迴圈結構</title>

	<para xml:lang="en"><literal>.for</literal> provides a way to repeat a set
	  of instructions for each space-separated element in a
	  variable.  It does this by assigning a variable to contain
	  the current element in the list being examined.</para>

	<programlisting xml:lang="en">_SUBDIRUSE: .USE
.for entry in ${SUBDIR}
	@${ECHO} "===&gt; ${DIRPRFX}${entry}"
	@(cd ${.CURDIR}/${entry} &amp;&amp; \
	${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ )
.endfor</programlisting>

	<para xml:lang="en">In the above, if <varname>SUBDIR</varname> is empty, no
	  action is taken; if it has one or more elements, the
	  instructions between <literal>.for</literal> and
	  <literal>.endfor</literal> would repeat for every element,
	  with <varname>entry</varname> being replaced with the value
	  of the current element.</para>
      </sect3>
    </sect2>
  </sect1>
</chapter>

  
<!-- Copyright (c) 1998, 1999 Nik Clayton, All rights reserved.

     Redistribution and use in source (SGML DocBook) and 'compiled' forms
     (SGML HTML, PDF, PostScript, RTF and so forth) with or without
     modification, are permitted provided that the following conditions
     are met:

      1. Redistributions of source code (SGML DocBook) must retain the above
         copyright notice, this list of conditions and the following
         disclaimer as the first lines of this file unmodified.

      2. Redistributions in compiled form (transformed to other DTDs,
         converted to PDF, PostScript, RTF and other formats) must reproduce
         the above copyright notice, this list of conditions and the
         following disclaimer in the documentation and/or other materials
         provided with the distribution.

     THIS DOCUMENTATION IS PROVIDED BY NIK CLAYTON "AS IS" AND ANY EXPRESS OR
     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL NIK CLAYTON BE LIABLE FOR ANY DIRECT,
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGE.

     $FreeBSD$
-->
<chapter version="5.0" xml:id="the-website">
  <title>網站</title>

  <para>FreeBSD 網站是 FreeBSD 文件的一部份。網站的檔案儲存在文件樹目錄,此例中是 <filename>~/doc</filename>,的 <filename>en_US.ISO8859-1/htdocs</filename> 子目錄。</para>

  <sect1 xml:id="the-website-env">
    <title>環境變數</title>

    <para xml:lang="en">Several environment variables control which parts of the
      web site are built or installed, and to which
      directories.</para>

    <tip>
      <para xml:lang="en">The web build system uses <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry>, and considers
	variables to be set when they have been defined, even if they
	are empty.  The examples here show the recommended ways of
	defining and using these variables.  Setting or defining these
	variables with other values or methods might lead to
	unexpected surprises.</para>
    </tip>

    <variablelist>
      <varlistentry xml:id="the-website-env-destdir">
	<term xml:lang="en"><varname>DESTDIR</varname></term>

	<listitem>
	  <para xml:lang="en">DESTDIR specifies the path where the web site files
	    are to be installed.</para>

	  <para xml:lang="en">This variable is best set with <citerefentry><refentrytitle>env</refentrytitle><manvolnum>1</manvolnum></citerefentry> or the user
	    shell's method of setting environment variables,
	    <command>setenv</command> for <citerefentry><refentrytitle>csh</refentrytitle><manvolnum>1</manvolnum></citerefentry> or
	    <command>export</command> for <citerefentry><refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
	</listitem>
      </varlistentry>
    </variablelist>

    <variablelist>
      <varlistentry xml:id="the-website-env-englishonly">
	<term xml:lang="en"><varname>ENGLISH_ONLY</varname></term>

	<listitem>
	  <para xml:lang="en">Default: undefined.  Build and include all
	    translations.</para>

	  <para xml:lang="en"><userinput>ENGLISH_ONLY=yes</userinput>: use only
	    the English documents and ignore all translations.</para>
	</listitem>
      </varlistentry>

      <varlistentry xml:id="the-website-env-webonly">
	<term xml:lang="en"><varname>WEB_ONLY</varname></term>

	<listitem>
	  <para xml:lang="en">Default: undefined.  Build both the web site
	    and all the books and articles.</para>

	  <para xml:lang="en"><userinput>WEB_ONLY=yes</userinput>: build or install
	    only <acronym>HTML</acronym> pages from the
	    <filename>en_US.ISO8859-1/htdocs</filename> directory.
	    Other directories and documents, including books and
	    articles, will be ignored.</para>
	</listitem>
      </varlistentry>

      <varlistentry xml:id="the-website-env-weblang">
	<term xml:lang="en"><varname>WEB_LANG</varname></term>

	<listitem>
	  <para xml:lang="en">Default: undefined.  Build and include all the
	    available languages on the web site.</para>

	  <para xml:lang="en">Set to a space-separated list of languages to be
	    included in the build
	    or install.  The formats are the same as the directory
	    names in the document root directory.  For example, to
	    include the German and French documents:</para>

	  <screen xml:lang="en"><userinput>WEB_LANG="de_DE.ISO8859-1 fr_FR.ISO8859-1"</userinput></screen>
	</listitem>
      </varlistentry>
    </variablelist>

    <para xml:lang="en"><varname>WEB_ONLY</varname>, <varname>WEB_LANG</varname>,
      and <varname>ENGLISH_ONLY</varname> are <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry> variables
      and can be set in <filename>/etc/make.conf</filename>,
      <filename>Makefile.inc</filename>, as environment variables on
      the command line, or in dot files.</para>
  </sect1>

  <sect1 xml:id="the-website-build">
    <title>建置並安裝網頁</title>

    <para xml:lang="en">Having obtained the documentation and web site source files,
      the web site can be built.</para>

    <para xml:lang="en">An actual installation of the web site is run as the <systemitem class="username">root</systemitem>
      user because the permissions on the web server directory will
      not allow files to be installed by an unprivileged user.
      For testing, it can be useful to install the files as a normal
      user to a temporary directory.</para>

    <para xml:lang="en">In these examples, the web site files are built by user
      <systemitem class="username">jru</systemitem> in their home
      directory, <filename>~/doc</filename>, with a full path of
      <filename>/usr/home/jru/doc</filename>.</para>

    <tip>
      <para xml:lang="en">The web site build uses the <filename>INDEX</filename>
	from the Ports Collection and might fail if that file or
	<filename>/usr/ports</filename> is not
	present.  The simplest approach is to install the <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/ports.html#ports-tree">Ports
	Collection</link>.</para>
    </tip>

    <example xml:id="the-website-examples-build">
      <title>建置完整網站與所有說明文件</title>

      <para xml:lang="en">Build the web site and all documents.  The resulting files
	are left in the document tree:</para>

      <screen xml:lang="en"><prompt>%</prompt> <userinput>cd ~/doc/en_US.ISO8859-1/htdocs/</userinput>
<prompt>%</prompt> <userinput>make all</userinput></screen>
    </example>

    <example xml:id="the-website-examples-buildinstall-englishonly">
      <title>只建置英文版網站</title>

      <para xml:lang="en">Build the web site only, in English, as user
	<systemitem class="username">jru</systemitem>, and install
	the resulting files into <filename>/tmp/www</filename> for
	testing:</para>

      <screen xml:lang="en"><prompt>%</prompt> <userinput>cd ~/doc/en_US.ISO8859-1/htdocs/</userinput>
<prompt>%</prompt> <userinput>env DESTDIR=/tmp/www make ENGLISH_ONLY=yes WEB_ONLY=yes all install</userinput></screen>

      <para xml:lang="en">Changes to static files can usually be tested by viewing
	the modified files directly with a web browser.  If the site
	has been built as shown above, a modified main page can be
	viewed with:</para>

      <screen xml:lang="en"><prompt>%</prompt> <userinput>firefox /tmp/www/data/index.html</userinput></screen>

      <para xml:lang="en">Modifications to dynamic files can be tested with a web
	server running on the local system.  After building the site
	as shown above, this
	<filename>/usr/local/etc/apache24/httpd.conf</filename> can be
	used with <package>www/apache24</package>:</para>

      <programlisting xml:lang="en"># httpd.conf for testing the FreeBSD website
Define TestRoot "/tmp/www/data"

# directory for configuration files
ServerRoot "/usr/local"

Listen 80

# minimum required modules
LoadModule authz_core_module libexec/apache24/mod_authz_core.so
LoadModule mime_module libexec/apache24/mod_mime.so
LoadModule unixd_module libexec/apache24/mod_unixd.so
LoadModule cgi_module libexec/apache24/mod_cgi.so
LoadModule dir_module libexec/apache24/mod_dir.so

# run the webserver as user and group
User www
Group www

ServerAdmin you@example.com
ServerName fbsdtest

# deny access to all files
&lt;Directory /&gt;
    AllowOverride none
    Require all denied
&lt;/Directory&gt;

# allow access to the website directory
DocumentRoot "${TestRoot}"
&lt;Directory "${TestRoot}"&gt;
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
&lt;/Directory&gt;

# prevent access to .htaccess and .htpasswd files
&lt;Files ".ht*"&gt;
    Require all denied
&lt;/Files&gt;

ErrorLog "/var/log/httpd-error.log"
LogLevel warn

# set up the CGI script directory
&lt;Directory "${TestRoot}/cgi"&gt;
    AllowOverride None
    Options None
    Require all granted
    Options +ExecCGI
    AddHandler cgi-script .cgi
&lt;/Directory&gt;

Include etc/apache24/Includes/*.conf</programlisting>

      <para xml:lang="en">Start the web server with</para>

      <screen xml:lang="en"><prompt>#</prompt> <userinput>service apache24 onestart</userinput></screen>

      <para xml:lang="en">The	web site can be viewed at
	<link xlink:href="http://localhost"/>.  Be aware that many
	links refer to the real FreeBSD site by name, and those links
	will still go to the external site instead of the local test
	version.  Fully testing the local site will require
	temporarily setting <acronym>DNS</acronym> so
	<literal>www.FreeBSD.org</literal> resolves to
	<literal>localhost</literal> or the local
	<acronym>IP</acronym> address.</para>
    </example>

    <example xml:id="the-website-examples-buildinstall">
      <title>建置並安裝網站</title>

      <para xml:lang="en">Build the web site and all documents as user
	<systemitem class="username">jru</systemitem>.  Install the
	resulting files as
	<systemitem class="username">root</systemitem> into the
	default directory,
	<filename>/root/public_html</filename>:</para>

      <screen xml:lang="en"><prompt>%</prompt> <userinput>cd ~/doc/en_US.ISO8859-1/htdocs</userinput>
<prompt>%</prompt> <userinput>make all</userinput>
<prompt>%</prompt> <userinput>su -</userinput>
Password:
<prompt>#</prompt> <userinput>cd /usr/home/jru/doc/en_US.ISO8859-1/htdocs</userinput>
<prompt>#</prompt> <userinput>make install</userinput></screen>
    </example>

    <para xml:lang="en">The install process does not delete any old or outdated
      files that existed previously in the same directory.  If a new
      copy of the site is built and installed every day, this command
      will find and delete all files that have not been updated in
      three days:</para>

    <screen xml:lang="en"><prompt>#</prompt> <userinput>find <replaceable>/usr/local/www</replaceable> -ctime 3 -delete</userinput></screen>
  </sect1>
</chapter>

  
<!-- Copyright (c) 1998, 1999 Nik Clayton, All rights reserved.

     Redistribution and use in source (SGML DocBook) and 'compiled' forms
     (SGML, HTML, PDF, PostScript, RTF and so forth) with or without
     modification, are permitted provided that the following conditions
     are met:

      1. Redistributions of source code (SGML DocBook) must retain the above
         copyright notice, this list of conditions and the following
         disclaimer as the first lines of this file unmodified.

      2. Redistributions in compiled form (transformed to other DTDs,
         converted to PDF, PostScript, RTF and other formats) must reproduce
         the above copyright notice, this list of conditions and the
         following disclaimer in the documentation and/or other materials
         provided with the distribution.

     THIS DOCUMENTATION IS PROVIDED BY NIK CLAYTON "AS IS" AND ANY EXPRESS OR
     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL NIK CLAYTON BE LIABLE FOR ANY DIRECT,
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGE.

     $FreeBSD$
-->
<chapter version="5.0" xml:id="xml-primer">
  <title>XML 入門</title>

  <para xml:lang="en">Most <acronym>FDP</acronym> documentation is written with
    markup languages based on <acronym>XML</acronym>.  This chapter
    explains what that means, how to read and understand the
    documentation source, and the <acronym>XML</acronym> techniques
    used.</para>

  <para xml:lang="en">Portions of this section were inspired by Mark Galassi's
    <link xlink:href="http://www.galassi.org/mark/mydocs/docbook-intro/docbook-intro.html">Get
      Going With DocBook</link>.</para>

  <sect1 xml:id="xml-primer-overview">
    <title>概論</title>

    <para xml:lang="en">In the original days of computers, electronic text was
      simple.  There were a few character sets like
      <acronym>ASCII</acronym> or <acronym>EBCDIC</acronym>, but that
      was about it.  Text was text, and what you saw really was what
      you got.  No frills, no formatting, no intelligence.</para>

    <para xml:lang="en">Inevitably, this was not enough.  When text is in a
      machine-usable format, machines are expected to be able to use
      and manipulate it intelligently.  Authors want to indicate that
      certain phrases should be emphasized, or added to a glossary, or
      made into hyperlinks.  Filenames could be shown in a
      <quote>typewriter</quote> style font for viewing on screen, but
      as <quote>italics</quote> when printed, or any of a myriad of
      other options for presentation.</para>

    <para xml:lang="en">It was once hoped that Artificial Intelligence (AI) would
      make this easy.  The computer would read the document and
      automatically identify key phrases, filenames, text that the
      reader should type in, examples, and more.  Unfortunately, real
      life has not happened quite like that, and computers still
      require assistance before they can meaningfully process
      text.</para>

    <para xml:lang="en">More precisely, they need help identifying what is what.
      Consider this text:</para>

    <blockquote>
      <para xml:lang="en">To remove <filename>/tmp/foo</filename>, use
	<citerefentry><refentrytitle>rm</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>

      <screen xml:lang="en"><prompt>%</prompt> <userinput>rm /tmp/foo</userinput></screen>
    </blockquote>

    <para xml:lang="en">It is easy to see which parts are filenames, which are
      commands to be typed in, which parts are references to manual
      pages, and so on.  But the computer processing the document
      cannot.  For this we need markup.</para>

    <para xml:lang="en"><quote>Markup</quote> is commonly used to describe
      <quote>adding value</quote> or <quote>increasing cost</quote>.
      The term takes on both these meanings when applied to text.
      Markup is additional text included in the document,
      distinguished from the document's content in some way, so that
      programs that process the document can read the markup and use
      it when making decisions about the document.  Editors can hide
      the markup from the user, so the user is not distracted by
      it.</para>

    <para xml:lang="en">The extra information stored in the markup
      <emphasis>adds value</emphasis> to the document.  Adding the
      markup to the document must typically be done by a
      person—after all, if computers could recognize the text
      sufficiently well to add the markup then there would be no need
      to add it in the first place.  This
      <emphasis>increases the cost</emphasis> (the effort required) to
      create the document.</para>

    <para xml:lang="en">The previous example is actually represented in this
      document like this:</para>

    <programlisting xml:lang="en"><tag class="starttag">para</tag>To remove <tag class="starttag">filename</tag>/tmp/foo<tag class="endtag">filename</tag>, use &amp;man.rm.1;.<tag class="endtag">para</tag>

<tag class="starttag">screen</tag>&amp;prompt.user; <tag class="starttag">userinput</tag>rm /tmp/foo<tag class="endtag">userinput</tag><tag class="endtag">screen</tag></programlisting>

    <para xml:lang="en">The markup is clearly separate from the content.</para>

    <para xml:lang="en">Markup languages define what the markup means and how it
      should be interpreted.</para>

    <para xml:lang="en">Of course, one markup language might not be enough.  A
      markup language for technical documentation has very different
      requirements than a markup language that is intended for cookery
      recipes.  This, in turn, would be very different from a markup
      language used to describe poetry.  What is really needed is a
      first language used to write these other markup languages.  A
      <emphasis>meta markup language</emphasis>.</para>

    <para xml:lang="en">This is exactly what the eXtensible Markup
      Language (<acronym>XML</acronym>) is.  Many markup languages
      have been written in <acronym>XML</acronym>, including the two
      most used by the <acronym>FDP</acronym>,
      <acronym>XHTML</acronym> and DocBook.</para>

    <para xml:lang="en">Each language definition is more properly called a grammar,
      vocabulary, schema or Document Type Definition
      (<acronym>DTD</acronym>).  There are various languages to
      specify an <acronym>XML</acronym> grammar, or
      <emphasis>schema</emphasis>.</para>

    <para xml:id="xml-primer-validating" xml:lang="en">A schema is a
      <emphasis>complete</emphasis> specification of all the elements
      that are allowed to appear, the order in which they should
      appear, which elements are mandatory, which are optional, and so
      forth.  This makes it possible to write an
      <acronym>XML</acronym> <emphasis>parser</emphasis> which reads
      in both the schema and a document which claims to conform to the
      schema.  The parser can then confirm whether or not all the
      elements required by the vocabulary are in the document in the
      right order, and whether there are any errors in the markup.
      This is normally referred to as
      <quote>validating the document</quote>.</para>

    <note>
      <para xml:lang="en">Validation confirms that the choice of
	elements, their ordering, and so on, conforms to that listed
	in the grammar.  It does <emphasis>not</emphasis> check
	whether <emphasis>appropriate</emphasis> markup has been used
	for the content.  If all the filenames in a document were
	marked up as function names, the parser would not flag this as
	an error (assuming, of course, that the schema defines
	elements for filenames and functions, and that they are
	allowed to appear in the same place).</para>
    </note>

    <para xml:lang="en">Most contributions to the Documentation
      Project will be content marked up in either
      <acronym>XHTML</acronym> or DocBook, rather than alterations to
      the schemas.  For this reason, this book will not touch on how
      to write a vocabulary.</para>
  </sect1>

  <sect1 xml:id="xml-primer-elements">
    <title>元素、標籤與屬性</title>

    <para xml:lang="en">All the vocabularies written in <acronym>XML</acronym> share
      certain characteristics.  This is hardly surprising, as the
      philosophy behind <acronym>XML</acronym> will inevitably show
      through.  One of the most obvious manifestations of this
      philosophy is that of <emphasis>content</emphasis> and
      <emphasis>elements</emphasis>.</para>

    <para xml:lang="en">Documentation, whether it is a single web page, or a lengthy
      book, is considered to consist of content.  This content is then
      divided and further subdivided into elements.  The purpose of
      adding markup is to name and identify the boundaries of these
      elements for further processing.</para>

    <para xml:lang="en">For example, consider a typical book.  At the very top
      level, the book is itself an element.  This <quote>book</quote>
      element obviously contains chapters, which can be considered to
      be elements in their own right.  Each chapter will contain more
      elements, such as paragraphs, quotations, and footnotes.  Each
      paragraph might contain further elements, identifying content
      that was direct speech, or the name of a character in the
      story.</para>

    <para xml:lang="en">It may be helpful to think of this as
      <quote>chunking</quote> content.  At the very top level is one
      chunk, the book.  Look a little deeper, and there are more
      chunks, the individual chapters.  These are chunked further into
      paragraphs, footnotes, character names, and so on.</para>

    <para xml:lang="en">Notice how this differentiation between different elements
      of the content can be made without resorting to any
      <acronym>XML</acronym> terms.  It really is surprisingly
      straightforward.  This could be done with a highlighter pen and
      a printout of the book, using different colors to indicate
      different chunks of content.</para>

    <para xml:lang="en">Of course, we do not have an electronic highlighter pen, so
      we need some other way of indicating which element each piece of
      content belongs to.  In languages written in
      <acronym>XML</acronym> (<acronym>XHTML</acronym>, DocBook, et
      al) this is done by means of <emphasis>tags</emphasis>.</para>

    <para xml:lang="en">A tag is used to identify where a particular element starts,
      and where the element ends.  <emphasis>The tag is not part of
      the element itself</emphasis>.  Because each grammar was
      normally written to mark up specific types of information, each
      one will recognize different elements, and will therefore have
      different names for the tags.</para>

    <para xml:lang="en">For an element called
      <replaceable>element-name</replaceable> the start tag will
      normally look like <tag class="starttag"><replaceable>element-name</replaceable></tag>.
      The corresponding closing tag for this element is <tag class="endtag"><replaceable>element-name</replaceable></tag>.</para>

    <example>
      <title>使用元素 (開始與結束標籤)</title>

      <para xml:lang="en"><acronym>XHTML</acronym> has an element for indicating
	that the content enclosed by the element is a paragraph,
	called <tag>p</tag>.</para>

      <programlisting xml:lang="en"><tag class="starttag">p</tag>This is a paragraph.  It starts with the start tag for
  the 'p' element, and it will end with the end tag for the 'p'
  element.<tag class="endtag">p</tag>

<tag class="starttag">p</tag>This is another paragraph.  But this one is much shorter.<tag class="endtag">p</tag></programlisting>
    </example>

    <para xml:lang="en">Some elements have no content.  For example, in
      <acronym>XHTML</acronym>, a horizontal line can be included in
      the document.  For these <quote>empty</quote> elements,
      <acronym>XML</acronym> introduced a shorthand form that is
      completely equivalent to the two-tag version:</para>

    <example>
      <title>使用沒有內容的元素</title>

      <para xml:lang="en"><acronym>XHTML</acronym> has an element for indicating a
	horizontal rule, called <tag>hr</tag>.  This element
	does not wrap content, so it looks like this:</para>

      <programlisting xml:lang="en"><tag class="starttag">p</tag>One paragraph.<tag class="endtag">p</tag>
<tag class="starttag">hr</tag><tag class="endtag">hr</tag>

<tag class="starttag">p</tag>This is another paragraph.  A horizontal rule separates this
  from the previous paragraph.<tag class="endtag">p</tag></programlisting>

      <para xml:lang="en">The shorthand version consists of a single tag:</para>

      <programlisting xml:lang="en"><tag class="starttag">p</tag>One paragraph.<tag class="endtag">p</tag>
<tag class="emptytag">hr</tag>

<tag class="starttag">p</tag>This is another paragraph.  A horizontal rule separates this
  from the previous paragraph.<tag class="endtag">p</tag></programlisting>
    </example>

    <para xml:lang="en">As shown above, elements can contain other elements.  In the
      book example earlier, the book element contained all the chapter
      elements, which in turn contained all the paragraph elements,
      and so on.</para>

    <example>
      <title>在元素中的元素; <tag>em</tag></title>

      <programlisting xml:lang="en"><tag class="starttag">p</tag>This is a simple <tag class="starttag">em</tag>paragraph<tag class="endtag">em</tag> where some
  of the <tag class="starttag">em</tag>words<tag class="endtag">em</tag> have been <tag class="starttag">em</tag>emphasized<tag class="endtag">em</tag>.<tag class="endtag">p</tag></programlisting>
    </example>

    <para xml:lang="en">The grammar consists of rules that describe which elements
      can contain other elements, and exactly what they can
      contain.</para>

    <important>
      <para xml:lang="en">People often confuse the terms tags and elements, and use
	the terms as if they were interchangeable.  They are
	not.</para>

      <para xml:lang="en">An element is a conceptual part of your document.  An
	element has a defined start and end.  The tags mark where the
	element starts and ends.</para>

      <para xml:lang="en">When this document (or anyone else knowledgeable about
	<acronym>XML</acronym>) refers to
	<quote>the <tag class="starttag">p</tag> tag</quote>
	they mean the literal text consisting of the three characters
	<literal>&lt;</literal>, <literal>p</literal>, and
	<literal>&gt;</literal>.  But the phrase
	<quote>the <tag>p</tag> element</quote> refers to the
	whole element.</para>

      <para xml:lang="en">This distinction <emphasis>is</emphasis> very subtle.  But
	keep it in mind.</para>
    </important>

    <para xml:lang="en">Elements can have attributes.  An attribute has a name and a
      value, and is used for adding extra information to the element.
      This might be information that indicates how the content should
      be rendered, or might be something that uniquely identifies that
      occurrence of the element, or it might be something else.</para>

    <para xml:lang="en">An element's attributes are written
      <emphasis>inside</emphasis> the start tag for that element, and
      take the form
      <literal><replaceable>attribute-name</replaceable>="<replaceable>attribute-value</replaceable>"</literal>.</para>

    <para xml:lang="en">In <acronym>XHTML</acronym>, the <tag>p</tag>
      element has an attribute called
      <tag class="attribute">align</tag>, which suggests an
      alignment (justification) for the paragraph to the program
      displaying the <acronym>XHTML</acronym>.</para>

    <para xml:lang="en">The <tag class="attribute">align</tag> attribute can
      take one of four defined values, <literal>left</literal>,
      <literal>center</literal>, <literal>right</literal> and
      <literal>justify</literal>.  If the attribute is not specified
      then the default is <literal>left</literal>.</para>

    <example>
      <title>使用元素的屬性</title>

      <programlisting xml:lang="en"><tag class="starttag">p align="left"</tag>The inclusion of the align attribute
  on this paragraph was superfluous, since the default is left.<tag class="endtag">p</tag>

<tag class="starttag">p align="center"</tag>This may appear in the center.<tag class="endtag">p</tag></programlisting>
    </example>

    <para xml:lang="en">Some attributes only take specific values, such as
      <literal>left</literal> or <literal>justify</literal>.  Others
      allow any value.</para>

    <example>
      <title>屬性的單引號</title>

      <programlisting xml:lang="en"><tag class="starttag">p align='right'</tag>I am on the right!<tag class="endtag">p</tag></programlisting>
    </example>

    <para xml:lang="en">Attribute values in <acronym>XML</acronym> must be enclosed
      in either single or double quotes.  Double quotes are
      traditional.  Single quotes are useful when the attribute value
      contains double quotes.</para>

    <para xml:lang="en">Information about attributes, elements, and tags is stored
      in catalog files.  The Documentation Project uses standard
      DocBook catalogs and includes additional catalogs for
      FreeBSD-specific features.  Paths to the catalog files are defined
      in an environment variable so they can be found by the document
      build tools.</para>

    <sect2>
      <title>待辦事項...</title>

      <para xml:lang="en">Before running the examples in this document, install
	    <package>textproc/docproj</package> from
	    the FreeBSD Ports Collection.  This is a
	    <emphasis>meta-port</emphasis> that downloads and installs
	    the standard programs and supporting files needed by the
	    Documentation Project.  <citerefentry><refentrytitle>csh</refentrytitle><manvolnum>1</manvolnum></citerefentry> users must use
	    <command>rehash</command> for the shell to recognize new
	    programs after they have been installed, or log out
	    and then log back in again.</para>

      <procedure>
	<step>
	  <para xml:lang="en">Create <filename>example.xml</filename>, and enter
	    this text:</para>

	  <programlisting xml:lang="en"><tag class="starttag">!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</tag>

<tag class="starttag">html xmlns="http://www.w3.org/1999/xhtml"</tag>
  <tag class="starttag">head</tag>
    <tag class="starttag">title</tag>An Example XHTML File<tag class="endtag">title</tag>
  <tag class="endtag">head</tag>

  <tag class="starttag">body</tag>
    <tag class="starttag">p</tag>This is a paragraph containing some text.<tag class="endtag">p</tag>

    <tag class="starttag">p</tag>This paragraph contains some more text.<tag class="endtag">p</tag>

    <tag class="starttag">p align="right"</tag>This paragraph might be right-justified.<tag class="endtag">p</tag>
  <tag class="endtag">body</tag>
<tag class="endtag">html</tag></programlisting>
	</step>

	<step>
	  <para xml:lang="en">Try to validate this file using an
	    <acronym>XML</acronym> parser.</para>

	  <para xml:lang="en"><package>textproc/docproj</package>
	    includes the <command>xmllint</command>
	    <link linkend="xml-primer-validating">validating
	      parser</link>.</para>

	  <para xml:lang="en">Use <command>xmllint</command> to validate the
	    document:</para>

	  <screen xml:lang="en"><prompt>%</prompt> <userinput>xmllint --valid --noout example.xml</userinput></screen>

	  <para xml:lang="en"><command>xmllint</command> returns without displaying
	    any output, showing that the document validated
	    successfully.</para>
	</step>

	<step>
	  <para xml:lang="en">See what happens when required elements are omitted.
	    Delete the line with the
	    <tag class="starttag">title</tag> and
	    <tag class="endtag">title</tag> tags, and re-run
	    the validation.</para>

	  <screen xml:lang="en"><prompt>%</prompt> <userinput>xmllint --valid --noout example.xml</userinput>
example.xml:5: element head: validity error : Element head content does not follow the DTD, expecting ((script | style | meta | link | object | isindex)* , ((title , (script | style | meta | link | object | isindex)* , (base , (script | style | meta | link | object | isindex)*)?) | (base , (script | style | meta | link | object | isindex)* , title , (script | style | meta | link | object | isindex)*))), got ()</screen>

	  <para xml:lang="en">This shows that the validation error comes from the
	    <replaceable>fifth</replaceable> line of the
	    <replaceable>example.xml</replaceable> file and that the
	    content of the <tag class="starttag">head</tag> is
	    the part which does not follow the rules of the
	    <acronym>XHTML</acronym> grammar.</para>

	  <para xml:lang="en">Then <command>xmllint</command> shows the line where
	    the error was found and marks the exact character position
	    with a <literal>^</literal> sign.</para>
	</step>

	<step>
	  <para xml:lang="en">Replace the <tag>title</tag> element.</para>
	</step>
      </procedure>
    </sect2>
  </sect1>

  <sect1 xml:id="xml-primer-doctype-declaration">
    <title>DOCTYPE 宣告</title>

    <para xml:lang="en">The beginning of each document can specify the name of the
      <acronym>DTD</acronym> to which the document conforms.  This
      DOCTYPE declaration is used by <acronym>XML</acronym> parsers to
      identify the <acronym>DTD</acronym> and ensure that the document
      does conform to it.</para>

    <para xml:lang="en">A typical declaration for a document written to conform with
      version 1.0 of the <acronym>XHTML</acronym>
      <acronym>DTD</acronym> looks like this:</para>

    <programlisting xml:lang="en"><tag class="starttag">!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</tag></programlisting>

    <para xml:lang="en">That line contains a number of different components.</para>

    <variablelist>
      <varlistentry>
	<term xml:lang="en"><literal>&lt;!</literal></term>

	<listitem>
	  <para xml:lang="en">The <emphasis>indicator</emphasis> shows
	    this is an <acronym>XML</acronym> declaration.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term xml:lang="en"><literal>DOCTYPE</literal></term>

	<listitem>
	  <para xml:lang="en">Shows that this is an <acronym>XML</acronym>
	    declaration of the document type.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term xml:lang="en"><literal>html</literal></term>

	<listitem>
	  <para xml:lang="en">Names the first
	    <link linkend="xml-primer-elements">element</link> that
	    will appear in the document.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term xml:lang="en"><literal>PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"</literal></term>

	<listitem>
	  <para xml:lang="en">Lists the Formal Public Identifier
	    (<acronym>FPI</acronym>)
	    <indexterm xml:lang="en">
	      <primary>Formal Public Identifier</primary>
	    </indexterm>
	    for the <acronym>DTD</acronym> to which this document
	    conforms.  The <acronym>XML</acronym> parser uses this to
	    find the correct <acronym>DTD</acronym> when processing
	    this document.</para>

	  <para xml:lang="en"><literal>PUBLIC</literal> is not a part of the
	    <acronym>FPI</acronym>, but indicates to the
	    <acronym>XML</acronym> processor how to find the
	    <acronym>DTD</acronym> referenced in the
	    <acronym>FPI</acronym>.  Other ways of telling the
	    <acronym>XML</acronym> parser how to find the
	    <acronym>DTD</acronym> are shown <link linkend="xml-primer-fpi-alternatives">later</link>.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term xml:lang="en"><literal>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</literal></term>

	<listitem>
	  <para xml:lang="en">A local filename or a <acronym>URL</acronym> to find
	    the <acronym>DTD</acronym>.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term xml:lang="en"><literal>&gt;</literal></term>

	<listitem>
	  <para xml:lang="en">Ends the declaration and returns to the
	    document.</para>
	</listitem>
      </varlistentry>
    </variablelist>

    <sect2>
      <title>正式公用識別碼 (<acronym>FPI</acronym>)</title>

      <indexterm significance="preferred" xml:lang="en">
	<primary>Formal Public Identifier</primary>
      </indexterm>

      <note>
	<para xml:lang="en">It is not necessary to know this, but it is useful
	  background, and might help debug problems when the
	  <acronym>XML</acronym> processor can not locate the
	  <acronym>DTD</acronym>.</para>
      </note>

      <para xml:lang="en"><acronym>FPI</acronym>s must follow a specific
	syntax:</para>

      <programlisting xml:lang="en">"<replaceable>Owner</replaceable>//<replaceable>Keyword</replaceable> <replaceable>Description</replaceable>//<replaceable>Language</replaceable>"</programlisting>

      <variablelist>
	<varlistentry>
	  <term xml:lang="en"><replaceable>Owner</replaceable></term>

	  <listitem>
	    <para xml:lang="en">The owner of the <acronym>FPI</acronym>.</para>

	    <para xml:lang="en">The beginning of the string identifies the owner of
	      the <acronym>FPI</acronym>.  For example, the
	      <acronym>FPI</acronym>
	      <literal>"ISO 8879:1986//ENTITIES Greek
		Symbols//EN"</literal> lists
	      <literal>ISO 8879:1986</literal> as being the owner for
	      the set of entities for Greek symbols.
	      <acronym>ISO</acronym> 8879:1986 is the International
	      Organization for Standardization
	      (<acronym>ISO</acronym>) number for the
	      <acronym>SGML</acronym> standard, the predecessor (and a
	      superset) of <acronym>XML</acronym>.</para>

	    <para xml:lang="en">Otherwise, this string will either look like
	      <literal>-//<replaceable>Owner</replaceable></literal>
	      or
	      <literal>+//<replaceable>Owner</replaceable></literal>
	      (notice the only difference is the leading
	      <literal>+</literal> or <literal>-</literal>).</para>

	    <para xml:lang="en">If the string starts with <literal>-</literal> then
	      the owner information is unregistered, with a
	      <literal>+</literal> identifying it as
	      registered.</para>

	    <para xml:lang="en"><acronym>ISO</acronym> 9070:1991 defines how
	      registered names are generated.  It might be derived
	      from the number of an <acronym>ISO</acronym>
	      publication, an <acronym>ISBN</acronym> code, or an
	      organization code assigned according to
	      <acronym>ISO</acronym> 6523.  Additionally, a
	      registration authority could be created in order to
	      assign registered names.  The <acronym>ISO</acronym>
	      council delegated this to the American National
	      Standards Institute (<acronym>ANSI</acronym>).</para>

	    <para xml:lang="en">Because the FreeBSD Project has not been registered,
	      the owner string is <literal>-//FreeBSD</literal>.  As seen
	      in the example, the <acronym>W3C</acronym> are not a
	      registered owner either.</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term xml:lang="en"><replaceable>Keyword</replaceable></term>

	  <listitem>
	    <para xml:lang="en">There are several keywords that indicate the type of
	      information in the file.  Some of the most common
	      keywords are <literal>DTD</literal>,
	      <literal>ELEMENT</literal>, <literal>ENTITIES</literal>,
	      and <literal>TEXT</literal>.  <literal>DTD</literal> is
	      used only for <acronym>DTD</acronym> files,
	      <literal>ELEMENT</literal> is usually used for
	      <acronym>DTD</acronym> fragments that contain only
	      entity or element declarations.  <literal>TEXT</literal>
	      is used for <acronym>XML</acronym> content (text and
	      tags).</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term xml:lang="en"><replaceable>Description</replaceable></term>

	  <listitem>
	    <para xml:lang="en">Any description can be given for the contents
	      of this file.  This may include version numbers or any
	      short text that is meaningful and unique for the
	      <acronym>XML</acronym> system.</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term xml:lang="en"><replaceable>Language</replaceable></term>

	  <listitem>
	    <para xml:lang="en">An <acronym>ISO</acronym> two-character code that
	      identifies the native language for the file.
	      <literal>EN</literal> is used for English.</para>
	  </listitem>
	</varlistentry>
      </variablelist>

      <sect3>
	<title><filename>catalog</filename> 檔案</title>

	<para xml:lang="en">With the syntax above, an <acronym>XML</acronym>
	  processor needs to have some way of turning the
	  <acronym>FPI</acronym> into the name of the file containing
	  the <acronym>DTD</acronym>.  A catalog file (typically
	  called <filename>catalog</filename>) contains lines that map
	  <acronym>FPI</acronym>s to filenames.  For example, if the
	  catalog file contained the line:</para>

<!-- XXX: mention XML catalog or maybe replace this totally and only cover XML catalog -->

	<programlisting xml:lang="en">PUBLIC  "-//W3C//DTD XHTML 1.0 Transitional//EN"             "1.0/transitional.dtd"</programlisting>

	<para xml:lang="en">The <acronym>XML</acronym> processor knows that the
	  <acronym>DTD</acronym> is called
	  <filename>transitional.dtd</filename> in the
	  <filename>1.0</filename> subdirectory of the directory that
	  held <filename>catalog</filename>.</para>

	<para xml:lang="en">Examine the contents of
	  <filename>/usr/local/share/xml/dtd/xhtml/catalog.xml</filename>.
	  This is the catalog file for the <acronym>XHTML</acronym>
	  <acronym>DTD</acronym>s that were installed as part of the
	  <package>textproc/docproj</package> port.</para>
      </sect3>
    </sect2>

    <sect2 xml:id="xml-primer-fpi-alternatives">
      <title><acronym>FPI</acronym> 的替代方案</title>

      <para xml:lang="en">Instead of using an <acronym>FPI</acronym> to indicate the
	<acronym>DTD</acronym> to which the document conforms (and
	therefore, which file on the system contains the
	<acronym>DTD</acronym>), the filename can be explicitly
	specified.</para>

      <para xml:lang="en">The syntax is slightly different:</para>

      <programlisting xml:lang="en"><tag class="starttag">!DOCTYPE html SYSTEM "/path/to/file.dtd"</tag></programlisting>

      <para xml:lang="en">The <literal>SYSTEM</literal> keyword indicates that the
	<acronym>XML</acronym> processor should locate the
	<acronym>DTD</acronym> in a system specific fashion.  This
	typically (but not always) means the <acronym>DTD</acronym>
	will be provided as a filename.</para>

      <para xml:lang="en">Using <acronym>FPI</acronym>s is preferred for reasons of
	portability.  If the <literal>SYSTEM</literal> identifier is
	used, then the <acronym>DTD</acronym> must be provided and
	kept in the same location for everyone.</para>
    </sect2>
  </sect1>

  <sect1 xml:id="xml-primer-xml-escape">
    <title>跳脫回 <acronym>XML</acronym></title>

    <para xml:lang="en">Some of the underlying <acronym>XML</acronym> syntax can be
      useful within documents.  For example, comments can be included
      in the document, and will be ignored by the parser.  Comments
      are entered using <acronym>XML</acronym> syntax.  Other uses for
      <acronym>XML</acronym> syntax will be shown later.</para>

    <para xml:lang="en"><acronym>XML</acronym> sections begin with a
      <literal>&lt;!</literal> tag and end with a
      <literal>&gt;</literal>.  These sections contain instructions
      for the parser rather than elements of the document.  Everything
      between these tags is <acronym>XML</acronym> syntax.  The
      <link linkend="xml-primer-doctype-declaration">DOCTYPE
	declaration</link> shown earlier is an example of
      <acronym>XML</acronym> syntax included in the document.</para>

  </sect1>

  <sect1 xml:id="xml-primer-comments">
    <title>註解</title>

    <para xml:lang="en">An <acronym>XML</acronym> document may contain comments.
      They may appear anywhere as long as they are not inside tags.
      They are even allowed in some locations inside the
      <acronym>DTD</acronym> (e.g., between <link linkend="xml-primer-entities">entity
	declarations</link>).</para>

    <para xml:lang="en"><acronym>XML</acronym> comments start with the string
      <quote><literal>&lt;!--</literal></quote> and end with the
      string <quote><literal>--&gt;</literal></quote>.</para>

    <para xml:lang="en">Here are some examples of valid <acronym>XML</acronym>
      comments:</para>

    <example>
      <title><acronym>XML</acronym> 通用註解</title>

      <programlisting xml:lang="en">&lt;!-- This is inside the comment --&gt;

&lt;!--This is another comment--&gt;

&lt;!-- This is how you
     write multiline comments --&gt;

&lt;p&gt;A simple &lt;!-- Comment inside an element's content --&gt; paragraph.&lt;/p&gt;</programlisting>
    </example>

    <para xml:lang="en"><acronym>XML</acronym> comments may contain any strings
      except <quote><literal>--</literal></quote>:</para>

    <example>
      <title>錯誤的<acronym>XML</acronym> 註解</title>

      <programlisting xml:lang="en">&lt;!-- This comment--is wrong --&gt;</programlisting>
    </example>

    <sect2>
      <title>待辦事項...</title>

      <procedure>
	<step>
	  <para xml:lang="en">Add some comments to
	    <filename>example.xml</filename>, and check that the file
	    still validates using <command>xmllint</command>.</para>
	</step>

	<step>
	  <para xml:lang="en">Add some invalid comments to
	    <filename>example.xml</filename>, and see the error
	    messages that <command>xmllint</command> gives when it
	    encounters an invalid comment.</para>
	</step>
      </procedure>
    </sect2>
  </sect1>

  <sect1 xml:id="xml-primer-entities">
    <title>Entities</title>

    <para xml:lang="en">Entities are a mechanism for assigning names to chunks of
      content.  As an <acronym>XML</acronym> parser processes a
      document, any entities it finds are replaced by the content of
      the entity.</para>

    <para xml:lang="en">This is a good way to have re-usable, easily changeable
      chunks of content in <acronym>XML</acronym> documents.  It is
      also the only way to include one marked up file inside another
      using <acronym>XML</acronym>.</para>

    <para xml:lang="en">There are two types of entities for two different
      situations: <emphasis>general entities</emphasis> and
      <emphasis>parameter entities</emphasis>.</para>

    <sect2 xml:id="xml-primer-general-entities">
      <title>一般 Entities</title>

      <para xml:lang="en">General entities are used to assign names to reusable
	chunks of text.  These entities can only be used in the
	document.  They cannot be used in an
	<acronym>XML</acronym> context.</para>

      <para xml:lang="en">To include the text of a general entity in the document,
	include
	<literal>&amp;<replaceable>entity-name</replaceable>;</literal>
	in the text.  For example, consider a general entity called
	<literal>current.version</literal> which expands to the
	current version number of a product.  To use it in the
	document, write:</para>

      <programlisting xml:lang="en"><tag class="starttag">para</tag>The current version of our product is
  &amp;current.version;.<tag class="endtag">para</tag></programlisting>

      <para xml:lang="en">When the version number changes, edit the definition of
	the general entity, replacing the value.  Then reprocess the
	document.</para>

      <para xml:lang="en">General entities can also be used to enter characters that
	could not otherwise be included in an <acronym>XML</acronym>
	document.  For example, <literal>&lt;</literal> and
	<literal>&amp;</literal> cannot normally appear in an
	<acronym>XML</acronym> document.  The <acronym>XML</acronym>
	parser sees the <literal>&lt;</literal> symbol as the start of
	a tag.  Likewise, when the <literal>&amp;</literal> symbol is
	seen, the next text is expected to be an entity name.</para>

      <para xml:lang="en">These symbols can be included by using two predefined
	general entities: <literal>&amp;lt;</literal> and
	<literal>&amp;amp;</literal>.</para>

      <para xml:lang="en">General entities can only be defined within an
	<acronym>XML</acronym> context.  Such definitions are usually
	done immediately after the DOCTYPE declaration.</para>

      <example>
	<title>定義一般 Entities</title>

	<programlisting xml:lang="en">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
&lt;!ENTITY current.version    "3.0-RELEASE"&gt;
&lt;!ENTITY last.version       "2.2.7-RELEASE"&gt;
]&gt;</programlisting>

	<para xml:lang="en">The DOCTYPE declaration has been extended by adding a
	  square bracket at the end of the first line.  The two
	  entities are then defined over the next two lines, the
	  square bracket is closed, and then the DOCTYPE declaration
	  is closed.</para>

	<para xml:lang="en">The square brackets are necessary to indicate that the
	  DTD indicated by the DOCTYPE declaration is being
	  extended.</para>
      </example>
    </sect2>

    <sect2 xml:id="xml-primer-parameter-entities">
      <title>參數 Entities</title>

      <para xml:lang="en">Parameter entities, like
	<link linkend="xml-primer-general-entities">general
	  entities</link>, are used to assign names to reusable chunks
	of text.  But parameter entities can only be used within an
	<link linkend="xml-primer-xml-escape">XML
	  context</link>.</para>

      <para xml:lang="en">Parameter entity definitions are similar to those for
	general entities.  However, parameter entries are included
	with
	<literal>%<replaceable>entity-name</replaceable>;</literal>.
	The definition also includes the <literal>%</literal> between
	the <literal>ENTITY</literal> keyword and the name of the
	entity.</para>

      <para xml:lang="en">For a mnemonic, think
	<quote><emphasis>P</emphasis>arameter entities use the
	  <emphasis>P</emphasis>ercent symbol</quote>.</para>

      <example>
	<title>定義參數 Entities</title>

	<programlisting xml:lang="en">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
&lt;!ENTITY % param.some "some"&gt;
&lt;!ENTITY % param.text "text"&gt;
&lt;!ENTITY % param.new  "%param.some more %param.text"&gt;

&lt;!-- %param.new now contains "some more text" --&gt;
]&gt;</programlisting>
      </example>
    </sect2>

    <sect2>
      <title>待辦事項...</title>

      <procedure>
	<step>
	  <para xml:lang="en">Add a general entity to
	    <filename>example.xml</filename>.</para>

	  <programlisting xml:lang="en">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
&lt;!ENTITY version "1.1"&gt;
]&gt;

<tag class="starttag">html xmlns="http://www.w3.org/1999/xhtml"</tag>
  <tag class="starttag">head</tag>
    <tag class="starttag">title</tag>An Example XHTML File<tag class="endtag">title</tag>
  <tag class="endtag">head</tag>

  &lt;!-- There may be some comments in here as well --&gt;

  <tag class="starttag">body</tag>
    <tag class="starttag">p</tag>This is a paragraph containing some text.<tag class="endtag">p</tag>

    <tag class="starttag">p</tag>This paragraph contains some more text.<tag class="endtag">p</tag>

    <tag class="starttag">p align="right"</tag>This paragraph might be right-justified.<tag class="endtag">p</tag>

    <tag class="starttag">p</tag>The current version of this document is: &amp;version;<tag class="endtag">p</tag>
  <tag class="endtag">body</tag>
<tag class="endtag">html</tag></programlisting>
	</step>

	<step>
	  <para xml:lang="en">Validate the document using
	    <command>xmllint</command>.</para>
	</step>

	<step>
	  <para xml:lang="en">Load <filename>example.xml</filename> into a web
	    browser.  It may have to be copied to
	    <filename>example.html</filename> before the browser
	    recognizes it as an <acronym>XHTML</acronym>
	    document.</para>

	  <para xml:lang="en">Older browsers with simple parsers may not render this
	    file as expected.  The entity reference
	    <literal>&amp;version;</literal> may not be replaced by
	    the version number, or the <acronym>XML</acronym> context
	    closing <literal>]&gt;</literal> may not be recognized and
	    instead shown in the output.</para>
	</step>

	<step>
	  <para xml:lang="en">The solution is to <emphasis>normalize</emphasis> the
	    document with an <acronym>XML</acronym> normalizer.  The
	    normalizer reads valid <acronym>XML</acronym> and writes
	    equally valid <acronym>XML</acronym> which has been
	    transformed in some way.  One way the normalizer
	    transforms the input is by expanding all the entity
	    references in the document, replacing the entities with
	    the text that they represent.</para>

	  <para xml:lang="en"><command>xmllint</command> can be used for this.  It
	    also has an option to drop the initial
	    <acronym>DTD</acronym> section so that the closing
	    <literal>]&gt;</literal> does not confuse browsers:</para>

	  <screen xml:lang="en"><prompt>%</prompt> <userinput>xmllint --noent --dropdtd example.xml &gt; example.html</userinput></screen>

	  <para xml:lang="en">A normalized copy of the document with entities
	    expanded is produced in <filename>example.html</filename>,
	    ready to load into a web browser.</para>
	</step>
      </procedure>
    </sect2>
  </sect1>

  <sect1 xml:id="xml-primer-include">
    <title>在引用檔使用 Entities</title>

    <para xml:lang="en">Both
      <link linkend="xml-primer-general-entities">general</link> and
      <link linkend="xml-primer-parameter-entities">parameter</link>
      entities are particularly useful for including one file inside
      another.</para>

    <sect2 xml:id="xml-primer-include-using-gen-entities">
      <title>在引用檔使用一般 Entities</title>

      <para xml:lang="en">Consider some content for an <acronym>XML</acronym> book
	organized into files, one file per chapter, called
	<filename>chapter1.xml</filename>,
	<filename>chapter2.xml</filename>, and so forth, with a
	<filename>book.xml</filename> that will contain these
	chapters.</para>

      <para xml:lang="en">In order to use the contents of these files as the values
	for entities, they are declared with the
	<literal>SYSTEM</literal> keyword.  This directs the
	<acronym>XML</acronym> parser to include the contents of the
	named file as the value of the entity.</para>

      <example>
	<title>在引用檔使用一般 Entities</title>

	<programlisting xml:lang="en">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
&lt;!ENTITY chapter.1 SYSTEM "chapter1.xml"&gt;
&lt;!ENTITY chapter.2 SYSTEM "chapter2.xml"&gt;
&lt;!ENTITY chapter.3 SYSTEM "chapter3.xml"&gt;
&lt;!-- And so forth --&gt;
]&gt;

<tag class="starttag">html xmlns="http://www.w3.org/1999/xhtml"</tag>
  &lt;!-- Use the entities to load in the chapters --&gt;

  &amp;chapter.1;
  &amp;chapter.2;
  &amp;chapter.3;
<tag class="endtag">html</tag></programlisting>
      </example>

      <warning>
	<para xml:lang="en">When using general entities to include other files
	  within a document, the files being included
	  (<filename>chapter1.xml</filename>,
	  <filename>chapter2.xml</filename>, and so on)
	  <emphasis>must not</emphasis> start with a DOCTYPE
	  declaration.  This is a syntax error because entities are
	  low-level constructs and they are resolved before any
	  parsing happens.</para>
      </warning>
    </sect2>

    <sect2>
      <title>在引用檔使用參數 Entities</title>

      <para xml:lang="en">Parameter entities can only be used inside an
	<acronym>XML</acronym> context.  Including a file in an
	<acronym>XML</acronym> context can be used
	to ensure that general entities are reusable.</para>

      <para xml:lang="en">Suppose that there are many chapters in the document, and
	these chapters were reused in two different books, each book
	organizing the chapters in a different fashion.</para>

      <para xml:lang="en">The entities could be listed at the top of each book, but
	that quickly becomes cumbersome to manage.</para>

      <para xml:lang="en">Instead, place the general entity definitions inside one
	file, and use a parameter entity to include that file within
	the document.</para>

      <example>
	<title>在引用檔使用參數 Entities</title>

	<para xml:lang="en">Place the entity definitions in a separate file
	  called <filename>chapters.ent</filename> and
	  containing this text:</para>

	<programlisting xml:lang="en">&lt;!ENTITY chapter.1 SYSTEM "chapter1.xml"&gt;
&lt;!ENTITY chapter.2 SYSTEM "chapter2.xml"&gt;
&lt;!ENTITY chapter.3 SYSTEM "chapter3.xml"&gt;</programlisting>

	<para xml:lang="en">Create a parameter entity to refer to the contents
	  of the file.  Then use the parameter entity to load the file
	  into the document, which will then make all the general
	  entities available for use.  Then use the general entities
	  as before:</para>

	<programlisting xml:lang="en">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
&lt;!-- Define a parameter entity to load in the chapter general entities --&gt;
&lt;!ENTITY % chapters SYSTEM "chapters.ent"&gt;

&lt;!-- Now use the parameter entity to load in this file --&gt;
%chapters;
]&gt;

<tag class="starttag">html xmlns="http://www.w3.org/1999/xhtml"</tag>
  &amp;chapter.1;
  &amp;chapter.2;
  &amp;chapter.3;
<tag class="endtag">html</tag></programlisting>
      </example>
    </sect2>

    <sect2>
      <title>待辦事項...</title>

      <sect3>
	<title>在引用檔使用一般 Entities</title>

	<procedure>
	  <step>
	    <para xml:lang="en">Create three files, <filename>para1.xml</filename>,
	      <filename>para2.xml</filename>, and
	      <filename>para3.xml</filename>.</para>

	    <para xml:lang="en">Put content like this in each file:</para>

	    <programlisting xml:lang="en"><tag class="starttag">p</tag>This is the first paragraph.<tag class="endtag">p</tag></programlisting>
	  </step>

	  <step>
	    <para xml:lang="en">Edit <filename>example.xml</filename> so that it
	      looks like this:</para>

	    <programlisting xml:lang="en">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
&lt;!ENTITY version "1.1"&gt;
&lt;!ENTITY para1 SYSTEM "para1.xml"&gt;
&lt;!ENTITY para2 SYSTEM "para2.xml"&gt;
&lt;!ENTITY para3 SYSTEM "para3.xml"&gt;
]&gt;

<tag class="starttag">html xmlns="http://www.w3.org/1999/xhtml"</tag>
  <tag class="starttag">head</tag>
    <tag class="starttag">title</tag>An Example XHTML File<tag class="endtag">title</tag>
  <tag class="endtag">head</tag>

  <tag class="starttag">body</tag>
    <tag class="starttag">p</tag>The current version of this document is: &amp;version;<tag class="endtag">p</tag>

    &amp;para1;
    &amp;para2;
    &amp;para3;
  <tag class="endtag">body</tag>
<tag class="endtag">html</tag></programlisting>
	  </step>

	  <step>
	    <para xml:lang="en">Produce <filename>example.html</filename> by
	      normalizing <filename>example.xml</filename>.</para>

	    <screen xml:lang="en"><prompt>%</prompt> <userinput>xmllint --dropdtd --noent example.xml &gt; example.html</userinput></screen>
	  </step>

	  <step>
	    <para xml:lang="en">Load <filename>example.html</filename> into the web
	      browser and confirm that the
	      <filename>para<replaceable>n</replaceable>.xml</filename>
	      files have been included in
	      <filename>example.html</filename>.</para>
	  </step>
	</procedure>
      </sect3>

      <sect3>
	<title>在引用檔使用參數 Entities</title>

	<note>
	  <para xml:lang="en">The previous steps must have completed before this
	    step.</para>
	</note>

	<procedure>
	  <step>
	    <para xml:lang="en">Edit <filename>example.xml</filename> so that it
	      looks like this:</para>

	    <programlisting xml:lang="en">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
&lt;!ENTITY % entities SYSTEM "entities.ent"&gt; %entities;
]&gt;

<tag class="starttag">html xmlns="http://www.w3.org/1999/xhtml"</tag>
  <tag class="starttag">head</tag>
    <tag class="starttag">title</tag>An Example XHTML File<tag class="endtag">title</tag>
  <tag class="endtag">head</tag>

  <tag class="starttag">body</tag>
    <tag class="starttag">p</tag>The current version of this document is: &amp;version;<tag class="endtag">p</tag>

    &amp;para1;
    &amp;para2;
    &amp;para3;
  <tag class="endtag">body</tag>
<tag class="endtag">html</tag></programlisting>
	  </step>

	  <step>
	    <para xml:lang="en">Create a new file called
	      <filename>entities.ent</filename> with this
	      content:</para>

	    <programlisting xml:lang="en">&lt;!ENTITY version "1.1"&gt;
&lt;!ENTITY para1 SYSTEM "para1.xml"&gt;
&lt;!ENTITY para2 SYSTEM "para2.xml"&gt;
&lt;!ENTITY para3 SYSTEM "para3.xml"&gt;</programlisting>
	  </step>

	  <step>
	    <para xml:lang="en">Produce <filename>example.html</filename> by
	      normalizing <filename>example.xml</filename>.</para>

	    <screen xml:lang="en"><prompt>%</prompt> <userinput>xmllint --dropdtd --noent example.xml &gt; example.html</userinput></screen>
	  </step>

	  <step>
	    <para xml:lang="en">Load <filename>example.html</filename> into the web
	      browser and confirm that the
	      <filename>para<replaceable>n</replaceable>.xml</filename>
	      files have been included in
	      <filename>example.html</filename>.</para>
	  </step>
	</procedure>
      </sect3>
    </sect2>
  </sect1>

  <sect1 xml:id="xml-primer-marked-sections">
    <title>已標記小節</title>

    <para xml:lang="en"><acronym>XML</acronym> provides a mechanism to indicate that
      particular pieces of the document should be processed in a
      special way.  These are called
      <quote>marked sections</quote>.</para>

    <example>
      <title>已標記的結構</title>

      <programlisting xml:lang="en">&lt;![<replaceable>KEYWORD</replaceable>[
  Contents of marked section
]]&gt;</programlisting>
    </example>

    <para xml:lang="en">As expected of an <acronym>XML</acronym> construct, a marked
      section starts with <literal>&lt;!</literal>.</para>

    <para xml:lang="en">The first square bracket begins the marked section.</para>

    <para xml:lang="en"><replaceable>KEYWORD</replaceable> describes how this marked
      section is to be processed by the parser.</para>

    <para xml:lang="en">The second square bracket indicates the start of the
      marked section's content.</para>

    <para xml:lang="en">The marked section is finished by closing the two square
      brackets, and then returning to the document context from the
      <acronym>XML</acronym> context with
      <literal>&gt;</literal>.</para>

    <sect2 xml:id="xml-primer-marked-section-keywords">
      <title>已標記關鍵字</title>

      <sect3 xml:id="xml-primer-cdata">
	<title xml:lang="en"><literal>CDATA</literal></title>

	<para xml:lang="en">These keywords denote the marked sections
	  <emphasis>content model</emphasis>, and allow you to change
	  it from the default.</para>

	<para xml:lang="en">When an <acronym>XML</acronym> parser is processing a
	  document, it keeps track of the
	  <quote>content model</quote>.</para>

	<para xml:lang="en">The content model describes the
	  content the parser is expecting to see and what it will do
	  with that content.</para>

	<para xml:lang="en">The <literal>CDATA</literal> content model is one of the
	  most useful.</para>

	<para xml:lang="en"><literal>CDATA</literal> is for
	  <quote>Character Data</quote>.  When the parser is in this
	  content model, it expects to see only characters.  In this
	  model the <literal>&lt;</literal> and
	  <literal>&amp;</literal> symbols lose their special status,
	  and will be treated as ordinary characters.</para>

	<note>
	  <para xml:lang="en">When using <literal>CDATA</literal> in examples of
	    text marked up in <acronym>XML</acronym>, remember that
	    the content of <literal>CDATA</literal> is not validated.
	    The included text must be check with other means.  For
	    example, the content could be written in another document,
	    validated, and then pasted into the
	    <literal>CDATA</literal> section.</para>
	</note>

	<example>
	  <title>使用 <literal>CDATA</literal> 已標記小節</title>

	  <programlisting xml:lang="en"><tag class="starttag">para</tag>Here is an example of how to include some text that contains
  many <tag class="starttag">literal</tag>&amp;lt;<tag class="endtag">literal</tag> and <tag class="starttag">literal</tag>&amp;amp;<tag class="endtag">literal</tag>
  symbols.  The sample text is a fragment of
  <tag class="starttag">acronym</tag>XHTML<tag class="endtag">acronym</tag>.  The surrounding text (<tag class="starttag">para</tag> and
  <tag class="starttag">programlisting</tag>) are from DocBook.<tag class="endtag">para</tag>

<tag class="starttag">programlisting</tag>&lt;![CDATA[<tag class="starttag">p</tag>This is a sample that shows some of the
  elements within <tag class="starttag">acronym</tag>XHTML<tag class="endtag">acronym</tag>.  Since the angle
  brackets are used so many times, it is simpler to say the whole
  example is a CDATA marked section than to use the entity names for
  the left and right angle brackets throughout.<tag class="endtag">p</tag>

    <tag class="starttag">ul</tag>
      <tag class="starttag">li</tag>This is a listitem<tag class="endtag">li</tag>
      <tag class="starttag">li</tag>This is a second listitem<tag class="endtag">li</tag>
      <tag class="starttag">li</tag>This is a third listitem<tag class="endtag">li</tag>
    <tag class="endtag">ul</tag>

    <tag class="starttag">p</tag>This is the end of the example.<tag class="endtag">p</tag>]]&gt;<tag class="endtag">programlisting</tag></programlisting>
	</example>
      </sect3>

      <sect3 xml:id="xml-primer-include-ignore">
	<title><literal>INCLUDE</literal><literal>IGNORE</literal></title>

	<para xml:lang="en">When the keyword is <literal>INCLUDE</literal>, then the
	  contents of the marked section will be processed.  When the
	  keyword is <literal>IGNORE</literal>, the marked section
	  is ignored and will not be processed.  It will not appear in
	  the output.</para>

	<example>
	  <title>在已標記小節中使用 <literal>INCLUDE</literal><literal>IGNORE</literal></title>

	  <programlisting xml:lang="en">&lt;![INCLUDE[
  This text will be processed and included.
]]&gt;

&lt;![IGNORE[
  This text will not be processed or included.
]]&gt;</programlisting>
	</example>

	<para xml:lang="en">By itself, this is not too useful.  Text to be
	  removed from the document could be cut out, or wrapped
	  in comments.</para>

	<para xml:lang="en">It becomes more useful when controlled by
	  <link linkend="xml-primer-parameter-entities">parameter
	    entities</link>, yet this usage is limited
	  to entity files.</para>

	<para xml:lang="en">For example, suppose that documentation was produced in
	  a hard-copy version and an electronic version.  Some extra
	  text is desired in the electronic version content that was
	  not to appear in the hard-copy.</para>

	<para xml:lang="en">Create an entity file that defines general entities to
	  include each chapter and guard these definitions with a
	  parameter entity that can be set to either
	  <literal>INCLUDE</literal> or <literal>IGNORE</literal> to
	  control whether the entity is defined.  After these
	  conditional general entity definitions, place one more
	  definition for each general entity to set them to an empty
	  value.  This technique makes use of the fact that entity
	  definitions cannot be overridden but the first definition
	  always takes effect.  So the inclusion of the chapter is
	  controlled with the corresponding parameter entity.  Set to
	  <literal>INCLUDE</literal>, the first general entity
	  definition will be read and the second one will be ignored.
	  Set to <literal>IGNORE</literal>, the first definition will
	  be ignored and the second one will take effect.</para>

	<example>
	  <title>使用參數 Entities 來控制已標記小節</title>

	  <programlisting xml:lang="en">&lt;!ENTITY % electronic.copy "INCLUDE"&gt;

&lt;![%electronic.copy;[
&lt;!ENTITY chap.preface	SYSTEM "preface.xml"&gt;
]]&gt;

&lt;!ENTITY chap.preface ""&gt;</programlisting>

	  <para xml:lang="en">When producing the hard-copy version, change the
	    parameter entity's definition to:</para>

	  <programlisting xml:lang="en">&lt;!ENTITY % electronic.copy "IGNORE"&gt;</programlisting>
	</example>
      </sect3>
    </sect2>

    <sect2>
      <title>待辦事項...</title>

      <procedure>
	<step>
	  <para xml:lang="en">Modify <filename>entities.ent</filename> to
	    contain the following:</para>

	  <programlisting xml:lang="en">&lt;!ENTITY version "1.1"&gt;
&lt;!ENTITY % conditional.text "IGNORE"&gt;

&lt;![%conditional.text;[
&lt;!ENTITY para1 SYSTEM "para1.xml"&gt;
]]&gt;

&lt;!ENTITY para1 ""&gt;

&lt;!ENTITY para2 SYSTEM "para2.xml"&gt;
&lt;!ENTITY para3 SYSTEM "para3.xml"&gt;</programlisting>
	</step>

	<step>
	  <para xml:lang="en">Normalize <filename>example.xml</filename>
	    and notice that the conditional text is not present in the
	    output document.  Set the parameter entity
	    guard to <literal>INCLUDE</literal> and regenerate the
	    normalized document and the text will appear again.
	    This method makes sense if there are more
	    conditional chunks depending on the same condition.  For
	    example, to control generating printed or online
	    text.</para>
	</step>
      </procedure>
    </sect2>
  </sect1>

  <sect1 xml:id="xml-primer-conclusion">
    <title>結論</title>

    <para xml:lang="en">That is the conclusion of this <acronym>XML</acronym>
      primer.  For reasons of space and complexity, several things
      have not been covered in depth (or at all).  However, the
      previous sections cover enough <acronym>XML</acronym> to
      introduce the organization of the <acronym>FDP</acronym>
      documentation.</para>
  </sect1>
</chapter>

  
<!-- Copyright (c) 1998, 1999 Nik Clayton, All rights reserved.

     Redistribution and use in source (SGML DocBook) and 'compiled' forms
     (SGML HTML, PDF, PostScript, RTF and so forth) with or without
     modification, are permitted provided that the following conditions
     are met:

      1. Redistributions of source code (SGML DocBook) must retain the above
         copyright notice, this list of conditions and the following
         disclaimer as the first lines of this file unmodified.

      2. Redistributions in compiled form (transformed to other DTDs,
         converted to PDF, PostScript, RTF and other formats) must reproduce
         the above copyright notice, this list of conditions and the
         following disclaimer in the documentation and/or other materials
         provided with the distribution.

     THIS DOCUMENTATION IS PROVIDED BY NIK CLAYTON "AS IS" AND ANY EXPRESS OR
     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL NIK CLAYTON BE LIABLE FOR ANY DIRECT,
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGE.

     $FreeBSD$
-->
<chapter version="5.0" xml:id="xhtml-markup">
  <title><acronym>XHTML</acronym> 標籤</title>

  <sect1 xml:id="xhtml-markup-introduction">
    <title>簡介</title>

    <para xml:lang="en">This chapter describes usage of the <acronym>XHTML</acronym>
      markup language used for the FreeBSD web site.</para>

    <para xml:lang="en"><acronym>XHTML</acronym> is the <acronym>XML</acronym>
      version of the HyperText Markup Language, the markup language of
      choice on the World Wide Web.  More information can be found at
      <uri xlink:href="http://www.w3.org/">http://www.w3.org/</uri>.</para>

    <para xml:lang="en"><acronym>XHTML</acronym> is used to mark up pages on the
      FreeBSD web site.  It is usually not used to mark up other
      documentation, since DocBook offers a far richer set of elements
      from which to choose.  Consequently, <acronym>XHTML</acronym>
      pages will normally only be encountered when writing for the web
      site.</para>

    <para xml:lang="en"><acronym>HTML</acronym> has gone through a number of
      versions.  The <acronym>XML</acronym>-compliant version
      described here is called <acronym>XHTML</acronym>.  The latest
      widespread version is <acronym>XHTML</acronym> 1.0, available in
      both <emphasis>strict</emphasis> and
      <emphasis>transitional</emphasis> variants.</para>

    <para xml:lang="en">The <acronym>XHTML</acronym> <acronym>DTDs</acronym> are
      available from the Ports Collection in
      <package>textproc/xhtml</package>.  They are
      automatically installed by the <package>textproc/docproj</package> port.</para>

    <note>
      <para xml:lang="en">This is <emphasis>not</emphasis> an exhaustive list of
	elements, since that would just repeat the documentation for
	<acronym>XHTML</acronym>.  The aim is to list those elements
	most commonly used.  Please post questions about elements or
	uses not covered here to the <link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-doc">FreeBSD documentation project mailing list</link>.</para>
    </note>

    <note>
      <title xml:lang="en">Inline Versus Block</title>

      <para xml:lang="en">In the remainder of this document, when describing
	elements, <emphasis>inline</emphasis> means that the element
	can occur within a block element, and does not cause a line
	break.  A <emphasis>block</emphasis> element, by comparison,
	will cause a line break (and other processing) when it is
	encountered.</para>
    </note>
  </sect1>

  <sect1 xml:id="xhtml-markup-fpi">
    <title>正式公用識別碼 (<acronym>FPI</acronym>)</title>

    <para xml:lang="en">There are a number of <acronym>XHTML</acronym>
      <acronym>FPI</acronym>s, depending upon the version, or
      <emphasis>level</emphasis> of <acronym>XHTML</acronym> to which
      a document conforms.  Most <acronym>XHTML</acronym> documents on
      the FreeBSD web site comply with the transitional version of
      <acronym>XHTML</acronym> 1.0.</para>

    <programlisting xml:lang="en">PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"</programlisting>
  </sect1>

  <sect1 xml:id="xhtml-markup-sectional-elements">
    <title>分節元素</title>

    <para xml:lang="en">An <acronym>XHTML</acronym> document is normally split into
      two sections.  The first section, called the
      <emphasis>head</emphasis>, contains meta-information about the
      document, such as its title, the name of the author, the parent
      document, and so on.  The second section, the
      <emphasis>body</emphasis>, contains content that will be
      displayed to the user.</para>

    <para xml:lang="en">These sections are indicated with <tag>head</tag>
      and <tag>body</tag> elements respectively.  These
      elements are contained within the top-level
      <tag>html</tag> element.</para>

    <example>
      <title>一般的 <acronym>XHTML</acronym> 文件結構</title>

      <programlisting xml:lang="en"><tag class="starttag">html xmlns="http://www.w3.org/1999/xhtml"</tag>
  <tag class="starttag">head</tag>
	  <tag class="starttag">title</tag><replaceable>The Document's Title</replaceable><tag class="endtag">title</tag>
  <tag class="endtag">head</tag>

  <tag class="starttag">body</tag><tag class="endtag">body</tag>
<tag class="endtag">html</tag></programlisting>
    </example>
  </sect1>

  <sect1 xml:id="xhtml-markup-block-elements">
    <title>區塊元素</title>

    <sect2 xml:id="xhtml-markup-block-elements-headings">
      <title>標題</title>

      <para xml:lang="en"><acronym>XHTML</acronym> has tags to denote headings in
	the document at up to six different levels.</para>

      <para xml:lang="en">The largest and most prominent heading is
	<tag>h1</tag>, then <tag>h2</tag>,
	continuing down to <tag>h6</tag>.</para>

      <para xml:lang="en">The element's content is the text of the heading.</para>

      <example>
	<title><tag>h1</tag>, <tag>h2</tag>, 以及其他標題標籤</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">h1</tag>First section<tag class="endtag">h1</tag>

&lt;!-- Document introduction goes here --&gt;

<tag class="starttag">h2</tag>This is the heading for the first section<tag class="endtag">h2</tag>

&lt;!-- Content for the first section goes here --&gt;

<tag class="starttag">h3</tag>This is the heading for the first sub-section<tag class="endtag">h3</tag>

&lt;!-- Content for the first sub-section goes here --&gt;

<tag class="starttag">h2</tag>This is the heading for the second section<tag class="endtag">h2</tag>

&lt;!-- Content for the second section goes here --&gt;</programlisting>
      </example>

      <para xml:lang="en">Generally, an <acronym>XHTML</acronym> page should have
	one first level heading (<tag>h1</tag>).  This can
	contain many second level headings (<tag>h2</tag>),
	which can in turn contain many third level headings.  Do not
	leave gaps in the numbering.</para>
    </sect2>

    <sect2 xml:id="xhtml-markup-block-elements-paragraphs">
      <title>段落</title>

      <para xml:lang="en"><acronym>XHTML</acronym> supports a single paragraph
	element, <tag>p</tag>.</para>

      <example>
	<title><tag>p</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">p</tag>This is a paragraph.  It can contain just about any
  other element.<tag class="endtag">p</tag></programlisting>
      </example>
    </sect2>

    <sect2 xml:id="xhtml-markup-block-elements-block-quotations">
      <title>區塊引言</title>

      <para xml:lang="en">A block quotation is an extended quotation from another
	document that will appear in a separate paragraph.</para>

      <example>
	<title><tag>blockquote</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">p</tag>A small excerpt from the US Constitution:<tag class="endtag">p</tag>

<tag class="starttag">blockquote</tag>We the People of the United States, in Order to form
  a more perfect Union, establish Justice, insure domestic
  Tranquility, provide for the common defence, promote the general
  Welfare, and secure the Blessings of Liberty to ourselves and our
  Posterity, do ordain and establish this Constitution for the
  United States of America.<tag class="endtag">blockquote</tag></programlisting>
      </example>
    </sect2>

    <sect2 xml:id="xhtml-markup-block-elements-lists">
      <title>清單</title>

      <para xml:lang="en"><acronym>XHTML</acronym> can present the user with three
	types of lists: ordered, unordered, and definition.</para>

      <para xml:lang="en">Entries in an ordered list will be numbered, while entries
	in an unordered list will be preceded by bullet points.
	Definition lists have two sections for each entry.  The first
	section is the term being defined, and the second section is
	the definition.</para>

      <para xml:lang="en">Ordered lists are indicated by the <tag>ol</tag>
	element, unordered lists by the <tag>ul</tag>
	element, and definition lists by the <tag>dl</tag>
	element.</para>

      <para xml:lang="en">Ordered and unordered lists contain listitems, indicated
	by the <tag>li</tag> element.  A listitem can
	contain textual content, or it may be further wrapped in one
	or more <tag>p</tag> elements.</para>

      <para xml:lang="en">Definition lists contain definition terms
	(<tag>dt</tag>) and definition descriptions
	(<tag>dd</tag>).  A definition term can only contain
	inline elements.  A definition description can contain other
	block elements.</para>

      <example>
	<title><tag>ul</tag><tag>ol</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">p</tag>An unordered list.  Listitems will probably be
  preceded by bullets.<tag class="endtag">p</tag>

<tag class="starttag">ul</tag>
  <tag class="starttag">li</tag>First item<tag class="endtag">li</tag>

  <tag class="starttag">li</tag>Second item<tag class="endtag">li</tag>

  <tag class="starttag">li</tag>Third item<tag class="endtag">li</tag>
<tag class="endtag">ul</tag>

<tag class="starttag">p</tag>An ordered list, with list items consisting of multiple
  paragraphs.  Each item (note: not each paragraph) will be
  numbered.<tag class="endtag">p</tag>

<tag class="starttag">ol</tag>
  <tag class="starttag">li</tag><tag class="starttag">p</tag>This is the first item.  It only has one paragraph.<tag class="endtag">p</tag><tag class="endtag">li</tag>

  <tag class="starttag">li</tag><tag class="starttag">p</tag>This is the first paragraph of the second item.<tag class="endtag">p</tag>

    <tag class="starttag">p</tag>This is the second paragraph of the second item.<tag class="endtag">p</tag><tag class="endtag">li</tag>

  <tag class="starttag">li</tag><tag class="starttag">p</tag>This is the first and only paragraph of the third
    item.<tag class="endtag">p</tag><tag class="endtag">li</tag>
<tag class="endtag">ol</tag></programlisting>
      </example>

      <example>
	<title>使用 <tag>dl</tag> 列定義清單</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">dl</tag>
  <tag class="starttag">dt</tag>Term 1<tag class="endtag">dt</tag>

  <tag class="starttag">dd</tag><tag class="starttag">p</tag>Paragraph 1 of definition 1.<tag class="endtag">p</tag>

    <tag class="starttag">p</tag>Paragraph 2 of definition 1.<tag class="endtag">p</tag><tag class="endtag">dd</tag>

  <tag class="starttag">dt</tag>Term 2<tag class="endtag">dt</tag>

  <tag class="starttag">dd</tag><tag class="starttag">p</tag>Paragraph 1 of definition 2.<tag class="endtag">p</tag><tag class="endtag">dd</tag>

  <tag class="starttag">dt</tag>Term 3<tag class="endtag">dt</tag>

  <tag class="starttag">dd</tag><tag class="starttag">p</tag>Paragraph 1 of definition 3.<tag class="endtag">p</tag><tag class="endtag">dd</tag>
<tag class="endtag">dl</tag></programlisting>
      </example>
    </sect2>

    <sect2 xml:id="xhtml-markup-block-elements-preformatted-text">
      <title>已預排文字</title>

      <para xml:lang="en">Pre-formatted text is shown to the user exactly as it is
	in the file.  Text is shown in a fixed font.  Multiple spaces
	and line breaks are shown exactly as they are in the
	file.</para>

      <para xml:lang="en">Wrap pre-formatted text in the <tag>pre</tag>
	element.</para>

      <example>
	<title><tag>pre</tag> 範例</title>

	<para xml:lang="en">For example, the <tag>pre</tag> tags could be
	  used to mark up an email message:</para>

	<programlisting xml:lang="en"><tag class="starttag">pre</tag>  From: nik@FreeBSD.org
  To: freebsd-doc@FreeBSD.org
  Subject: New documentation available

  There is a new copy of my primer for contributors to the FreeBSD
  Documentation Project available at

    &amp;lt;URL:http://people.FreeBSD.org/~nik/primer/index.html&amp;gt;

  Comments appreciated.

  N<tag class="endtag">pre</tag></programlisting>

	<para xml:lang="en">Keep in mind that <literal>&lt;</literal> and
	  <literal>&amp;</literal> still are recognized as special
	  characters in pre-formatted text.  This is why the example
	  shown had to use <literal>&amp;lt;</literal> instead of
	  <literal>&lt;</literal>.  For consistency,
	  <literal>&amp;gt;</literal> was used in place of
	  <literal>&gt;</literal>, too.  Watch out for the special
	  characters that may appear in text copied from a plain-text
	  source, like an email message or program code.</para>
      </example>
    </sect2>

    <sect2 xml:id="xhtml-markup-block-elements-tables">
      <title>表格</title>

      <para xml:lang="en">Mark up tabular information using the
	<tag>table</tag> element.  A table consists of one or
	more table rows (<tag>tr</tag>), each containing one
	or more cells of table data (<tag>td</tag>).  Each
	cell can contain other block elements, such as paragraphs or
	lists.  It can also contain another table (this nesting can
	repeat indefinitely).  If the cell only contains one paragraph
	then the <tag>p</tag>element is not needed.</para>

      <example>
	<title><tag>table</tag> 的簡單用法</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">p</tag>This is a simple 2x2 table.<tag class="endtag">p</tag>

<tag class="starttag">table</tag>
  <tag class="starttag">tr</tag>
    <tag class="starttag">td</tag>Top left cell<tag class="endtag">td</tag>

    <tag class="starttag">td</tag>Top right cell<tag class="endtag">td</tag>
  <tag class="endtag">tr</tag>

  <tag class="starttag">tr</tag>
    <tag class="starttag">td</tag>Bottom left cell<tag class="endtag">td</tag>

    <tag class="starttag">td</tag>Bottom right cell<tag class="endtag">td</tag>
  <tag class="endtag">tr</tag>
<tag class="endtag">table</tag></programlisting>
      </example>

      <para xml:lang="en">A cell can span multiple rows and columns by adding the
	<tag class="attribute">rowspan</tag> or
	<tag class="attribute">colspan</tag> attributes with
	values for the number of rows or columns to be spanned.</para>

      <example>
	<title>使用 <tag class="attribute">rowspan</tag></title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">p</tag>One tall thin cell on the left, two short cells next to
  it on the right.<tag class="endtag">p</tag>

<tag class="starttag">table</tag>
  <tag class="starttag">tr</tag>
    <tag class="starttag">td rowspan="2"</tag>Long and thin<tag class="endtag">td</tag>
  <tag class="endtag">tr</tag>

  <tag class="starttag">tr</tag>
    <tag class="starttag">td</tag>Top cell<tag class="endtag">td</tag>

    <tag class="starttag">td</tag>Bottom cell<tag class="endtag">td</tag>
  <tag class="endtag">tr</tag>
<tag class="endtag">table</tag></programlisting>
      </example>

      <example>
	<title>使用 <tag class="attribute">colspan</tag></title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">p</tag>One long cell on top, two short cells below it.<tag class="endtag">p</tag>

<tag class="starttag">table</tag>
  <tag class="starttag">tr</tag>
    <tag class="starttag">td colspan="2"</tag>Top cell<tag class="endtag">td</tag>
  <tag class="endtag">tr</tag>

  <tag class="starttag">tr</tag>
    <tag class="starttag">td</tag>Bottom left cell<tag class="endtag">td</tag>

    <tag class="starttag">td</tag>Bottom right cell<tag class="endtag">td</tag>
  <tag class="endtag">tr</tag>
<tag class="endtag">table</tag></programlisting>
      </example>

      <example>
	<title><tag class="attribute">rowspan</tag><tag class="attribute">colspan</tag> 一起使用</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">p</tag>On a 3x3 grid, the top left block is a 2x2 set of
  cells merged into one.  The other cells are normal.<tag class="endtag">p</tag>

<tag class="starttag">table</tag>
  <tag class="starttag">tr</tag>
    <tag class="starttag">td colspan="2" rowspan="2"</tag>Top left large cell<tag class="endtag">td</tag>

    <tag class="starttag">td</tag>Top right cell<tag class="endtag">td</tag>
  <tag class="endtag">tr</tag>

  <tag class="starttag">tr</tag>
    &lt;!-- Because the large cell on the left merges into
         this row, the first &lt;td&gt; will occur on its
         right --&gt;

    <tag class="starttag">td</tag>Middle right cell<tag class="endtag">td</tag>
  <tag class="endtag">tr</tag>

  <tag class="starttag">tr</tag>
    <tag class="starttag">td</tag>Bottom left cell<tag class="endtag">td</tag>

    <tag class="starttag">td</tag>Bottom middle cell<tag class="endtag">td</tag>

    <tag class="starttag">td</tag>Bottom right cell<tag class="endtag">td</tag>
  <tag class="endtag">tr</tag>
<tag class="endtag">table</tag></programlisting>
      </example>
    </sect2>
  </sect1>

  <sect1 xml:id="xhtml-markup-inline-elements">
    <title>行內元素</title>

    <sect2 xml:id="xhtml-markup-inline-elements-emphasizing-information">
      <title>強調資訊</title>

      <para xml:lang="en">Two levels of emphasis are available in
	<acronym>XHTML</acronym>, <tag>em</tag> and
	<tag>strong</tag>.  <tag>em</tag> is for a
	normal level of emphasis and <tag>strong</tag>
	indicates stronger emphasis.</para>

      <para xml:lang="en"><tag>em</tag> is typically rendered in italic
	and <tag>strong</tag> is rendered in bold.  This is
	not always the case, and should not be relied upon.  According
	to best practices, web pages only hold structural and
	semantical information, and stylesheets are later applied to
	them.  Think of semantics, not formatting, when using these
	tags.</para>

      <example>
	<title><tag>em</tag><tag>strong</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">p</tag><tag class="starttag">em</tag>This<tag class="endtag">em</tag> has been emphasized, while
  <tag class="starttag">strong</tag>this<tag class="endtag">strong</tag> has been strongly emphasized.<tag class="endtag">p</tag></programlisting>
      </example>
    </sect2>

    <sect2 xml:id="xhtml-markup-inline-elements-fixed-pitch-text">
      <title>標示等寬文字</title>

      <para xml:lang="en">Content that should be rendered in a fixed pitch
	(typewriter) typeface is tagged with <tag>tt</tag>
	(for <quote>teletype</quote>).</para>

      <example>
	<title><tag>tt</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">p</tag>Many system settings are stored in
  <tag class="starttag">tt</tag>/etc<tag class="endtag">tt</tag>.<tag class="endtag">p</tag></programlisting>
      </example>
    </sect2>

    <sect2 xml:id="xhtml-markup-inline-elements-links">
      <title>連結</title>

      <note>
	<para xml:lang="en">Links are also inline elements.</para>
      </note>

      <sect3 xml:id="xhtml-markup-inline-elements-linking">
	<title>連結在網站上的其他文件</title>

	<para xml:lang="en">A link points to the <acronym>URL</acronym> of a
	  document on the web.  The link is indicated with
	  <tag>a</tag>, and the
	  <tag class="attribute">href</tag> attribute contains
	  the <acronym>URL</acronym> of the target document.  The
	  content of the element becomes the link, indicated to the
	  user by showing it in a different color or with an
	  underline.</para>

	<example>
	  <title>使用 <tag class="starttag">a href="..."</tag></title>

	  <para>用法:</para>

	  <programlisting xml:lang="en"><tag class="starttag">p</tag>More information is available at the
  <tag class="starttag">a href="http://www.&amp;os;.org/"</tag>&amp;os; web site<tag class="endtag">a</tag>.<tag class="endtag">p</tag></programlisting>
	</example>

	<para xml:lang="en">This link always takes the user to the top of the linked
	  document.</para>
      </sect3>

      <sect3 xml:id="xhtml-markup-inline-elements-specific-parts">
	<title>連結說明文件的特定章節</title>

	<para xml:lang="en">To link to a specific point within a document, that
	  document must include an <emphasis>anchor</emphasis> at the
	  desired point.  Anchors are included by setting the
	  <tag class="attribute">id</tag> attribute of an
	  element to a name.  This example creates an anchor by
	  setting the <tag class="attribute">id</tag>
	  attribute of a <tag class="element">p</tag>
	  element.</para>

	<example>
	  <title>建立錨點</title>

	  <para>用法:</para>

	  <programlisting xml:lang="en"><tag class="starttag">p id="samplepara"</tag>This paragraph can be referenced
  in other links with the name <tag class="starttag">tt</tag>samplepara<tag class="endtag">tt</tag>.<tag class="endtag">p</tag></programlisting>
	</example>

	<para xml:lang="en">Links to anchors are similar to plain links, but include
	  a <literal>#</literal> symbol and the anchor's
	  <acronym>ID</acronym> at the end of the
	  <acronym>URL</acronym>.</para>

	<example>
	  <title>連結到另一份文件中已命名的段落</title>

	  <para xml:lang="en">The <literal>samplepara</literal> example is part of a
	    document called <filename>foo.html</filename>.  A link to
	    that specific paragraph in the document is constructed in
	    this example.</para>

	  <programlisting xml:lang="en"><tag class="starttag">p</tag>More information can be found in the
  <tag class="starttag">a href="foo.html#samplepara"</tag>sample paragraph<tag class="endtag">a</tag> of
  <tag class="starttag">tt</tag>foo.html<tag class="endtag">tt</tag>.<tag class="endtag">p</tag></programlisting>
	</example>

	<para xml:lang="en">To link to a named anchor within the same document, omit
	  the document's <acronym>URL</acronym>, and just use the
	  <literal>#</literal> symbol followed by the name of the
	  anchor.</para>

	<example>
	  <title>連結到同一份文件已命名的段茖</title>

	  <para xml:lang="en">The <literal>samplepara</literal> example
	    resides in this document.  To link to it:</para>

	  <programlisting xml:lang="en"><tag class="starttag">p</tag>More information can be found in the
  <tag class="starttag">a href="#samplepara"</tag>sample paragraph<tag class="endtag">a</tag> of this
  document.<tag class="endtag">p</tag></programlisting>
	</example>
      </sect3>
    </sect2>
  </sect1>
</chapter>

  
<!-- Copyright (c) 1998, 1999 Nik Clayton, All rights reserved.

     Redistribution and use in source (SGML DocBook) and 'compiled' forms
     (SGML HTML, PDF, PostScript, RTF and so forth) with or without
     modification, are permitted provided that the following conditions
     are met:

      1. Redistributions of source code (SGML DocBook) must retain the above
         copyright notice, this list of conditions and the following
         disclaimer as the first lines of this file unmodified.

      2. Redistributions in compiled form (transformed to other DTDs,
         converted to PDF, PostScript, RTF and other formats) must reproduce
         the above copyright notice, this list of conditions and the
         following disclaimer in the documentation and/or other materials
         provided with the distribution.

     THIS DOCUMENTATION IS PROVIDED BY NIK CLAYTON "AS IS" AND ANY EXPRESS OR
     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL NIK CLAYTON BE LIABLE FOR ANY DIRECT,
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGE.

     $FreeBSD$
-->

<chapter version="5.0" xml:id="docbook-markup">

  <title>DocBook 標籤</title>

  <sect1 xml:id="docbook-markup-introduction">
    <title>簡介</title>

    <para xml:lang="en">This chapter is an introduction to DocBook as it is used for
      FreeBSD documentation.  DocBook is a large and complex markup
      system, but the subset described here covers the parts that are
      most widely used for FreeBSD documentation.  While a moderate
      subset is covered, it is impossible to anticipate every
      situation.  Please post questions that this document does
      not answer to the <link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-doc">FreeBSD documentation project mailing list</link>.</para>

    <para xml:lang="en">DocBook was originally developed by HaL Computer Systems and
      O'Reilly &amp; Associates to be a Document Type Definition
      (<acronym>DTD</acronym>) for writing technical documentation
      <footnote><para xml:lang="en">A short history can be found under <link xlink:href="http://www.oasis-open.org/docbook/intro.shtml#d0e41">http://www.oasis-open.org/docbook/intro.shtml#d0e41</link>.</para></footnote>.
      Since 1998 it is maintained by the <link xlink:href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=docbook">
	DocBook Technical Committee</link>.  As such, and unlike
      LinuxDoc and <acronym>XHTML</acronym>, DocBook is very heavily
      oriented towards markup that describes <emphasis>what</emphasis>
      something is, rather than describing <emphasis>how</emphasis> it
      should be presented.</para>

    <para xml:lang="en">The DocBook <acronym>DTD</acronym> is available from the
      Ports Collection in the
      <package>textproc/docbook-xml</package>
      port.  It is automatically installed as part of the
      <package>textproc/docproj</package>
      port.</para>

    <note>
      <title xml:lang="en">Formal Versus Informal</title>

      <para xml:lang="en">Some elements may exist in two forms,
	<emphasis>formal</emphasis> and <emphasis>informal</emphasis>.
	Typically, the formal version of the element will consist of a
	title followed by the informal version of the element.  The
	informal version will not have a title.</para>
    </note>

    <note>
      <title xml:lang="en">Inline Versus Block</title>

      <para xml:lang="en">In the remainder of this document, when describing
	elements, <emphasis>inline</emphasis> means that the element
	can occur within a block element, and does not cause a line
	break.  A <emphasis>block</emphasis> element, by comparison,
	will cause a line break (and other processing) when it is
	encountered.</para>
    </note>
  </sect1>

  <sect1 xml:id="docbook-markup-freebsd-extensions">
    <title>FreeBSD 擴充項目</title>

    <para xml:lang="en">The FreeBSD Documentation Project has extended the DocBook
      <acronym>DTD</acronym> with additional elements and entities.
      These additions serve to make some of the markup easier or more
      precise.</para>

    <para xml:lang="en">Throughout the rest of this document, the term
      <quote>DocBook</quote> is used to mean the FreeBSD-extended
      DocBook <acronym>DTD</acronym>.</para>

    <note>
      <para xml:lang="en">Most of these extensions are not unique to FreeBSD, it was
	just felt that they were useful enhancements for this
	particular project.  Should anyone from any of the other *nix
	camps (NetBSD, OpenBSD, Linux, …) be interested in
	collaborating on a standard DocBook extension set, please
	contact Documentation Engineering Team <email>doceng@FreeBSD.org</email>.</para>
    </note>

    <sect2 xml:id="docbook-markup-freebsd-extensions-elements">
      <title>FreeBSD 元素</title>

      <para xml:lang="en">The additional FreeBSD elements are not (currently) in the
	Ports Collection.  They are stored in the FreeBSD Subversion
	tree, as <link xlink:href="http://svnweb.FreeBSD.org/doc/head/share/xml/freebsd.dtd">head/share/xml/freebsd.dtd</link>.</para>

      <para xml:lang="en">FreeBSD-specific elements used in the examples below are
	clearly marked.</para>
    </sect2>

    <sect2 xml:id="docbook-markup-freebsd-extensions-entities">
      <title>FreeBSD Entities</title>

      <para xml:lang="en">This table shows some of the most useful entities
	available in the <acronym>FDP</acronym>.  For a complete list,
	see the <filename>*.ent</filename> files in
	<filename>doc/share/xml</filename>.</para>

      <informaltable frame="none" pgwide="1">
	<tgroup cols="3">
	  <colspec colname="entity"/>
	  <colspec colname="expandsto"/>
	  <colspec colname="notes"/>
	  <thead>
	    <row>
	      <entry/>
	      <entry/>
	      <entry/>
	    </row>
	  </thead>

	  <tbody valign="top">
	    <row>
	      <entry namest="entity" nameend="notes" xml:lang="en"><emphasis>FreeBSD
		  Name Entities</emphasis></entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;os;</literal></entry>
	      <entry xml:lang="en"><literal>FreeBSD</literal></entry>
	      <entry/>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;os.stable;</literal></entry>
	      <entry xml:lang="en"><literal>FreeBSD-STABLE</literal></entry>
	      <entry/>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;os.current;</literal></entry>
	      <entry xml:lang="en"><literal>FreeBSD-CURRENT</literal></entry>
	      <entry/>
	    </row>

	    <row>
	      <entry/>
	      <entry/>
	      <entry/>
	    </row>

	    <row>
	      <entry namest="entity" nameend="notes" xml:lang="en">Manual Page
		Entities</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;man.ls.1;</literal></entry>
	      <entry xml:lang="en"><citerefentry><refentrytitle>ls</refentrytitle><manvolnum>1</manvolnum></citerefentry></entry>
	      <entry xml:lang="en">Usage: <literal>&amp;man.ls.1; is the manual page
		  for
		  &lt;command&gt;ls&lt;/command&gt;.</literal></entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;man.cp.1;</literal></entry>
	      <entry xml:lang="en"><citerefentry><refentrytitle>cp</refentrytitle><manvolnum>1</manvolnum></citerefentry></entry>
	      <entry xml:lang="en">Usage: <literal>The manual page for
		  &lt;command&gt;cp&lt;/command&gt; is
		  &amp;man.cp.1;.</literal></entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;man.<replaceable>command</replaceable>.<replaceable>sectionnumber</replaceable>;</literal></entry>
	      <entry xml:lang="en"><emphasis>link to
		  <replaceable>command</replaceable> manual page in
		  section
		  <replaceable>sectionnumber</replaceable></emphasis></entry>
	      <entry xml:lang="en">Entities are defined for all the
		<link xlink:href="@@URL_RELPREFIX@@/cgi/man.cgi">FreeBSD manual
		  pages</link>.</entry>
	    </row>

	    <row>
	      <entry/>
	      <entry/>
	      <entry/>
	    </row>

	    <row>
	      <entry namest="entity" nameend="notes" xml:lang="en">FreeBSD Mailing List
		Entities</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;a.doc;</literal></entry>
	      <entry xml:lang="en"><literal><link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-doc">FreeBSD documentation project mailing list</link></literal></entry>
	      <entry xml:lang="en">Usage: <literal>A link to the
		  &amp;a.doc;.</literal></entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;a.questions;</literal></entry>
	      <entry xml:lang="en"><literal><link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-questions">FreeBSD general questions mailing list</link></literal></entry>
	      <entry xml:lang="en">Usage: <literal>A link to the
		  &amp;a.questions;.</literal></entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;a.<replaceable>listname</replaceable>;</literal></entry>
	      <entry xml:lang="en"><emphasis>link to
		  <replaceable>listname</replaceable></emphasis></entry>
	      <entry xml:lang="en">Entities are defined for all the <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/eresources.html#eresources-mail">FreeBSD
		  mailing lists</link>.</entry>
	    </row>

	    <row>
	      <entry/>
	      <entry/>
	      <entry/>
	    </row>

	    <row>
	      <entry namest="entity" nameend="notes" xml:lang="en">FreeBSD Document
		Link Entities</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;url.books.handbook;</literal></entry>
	      <entry xml:lang="en"><literal>@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook</literal></entry>
	      <entry xml:lang="en">Usage: <literal>A link to the &lt;link
		  xlink:href="&amp;url.books.handbook;/advanced-networking.html"&gt;Advanced
		  Networking&lt;/link&gt; chapter of the
		  Handbook.</literal></entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;url.books.<replaceable>bookname</replaceable>;</literal></entry>
	      <entry xml:lang="en"><emphasis>relative path to
		  <replaceable>bookname</replaceable></emphasis></entry>
	      <entry xml:lang="en">Entities are defined for all the <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/">FreeBSD
		  books</link>.</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;url.articles.committers-guide;</literal></entry>
	      <entry xml:lang="en"><literal>@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/articles/committers-guide</literal></entry>
	      <entry xml:lang="en">Usage: <literal>A link to the &lt;link
		  xlink:href="&amp;url.articles.committers-guide;"&gt;Committer's
		  Guide&lt;/link&gt;
		  article.</literal></entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;url.articles.<replaceable>articlename</replaceable>;</literal></entry>
	      <entry xml:lang="en"><emphasis>relative path to
		  <replaceable>articlename</replaceable></emphasis></entry>
	      <entry xml:lang="en">Entities are defined for all the <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/articles/">FreeBSD
		  articles</link>.</entry>
	    </row>

	    <row>
	      <entry/>
	      <entry/>
	      <entry/>
	    </row>

	    <row>
	      <entry namest="entity" nameend="notes" xml:lang="en">Other Operating
		System Name Entities</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;linux;</literal></entry>
	      <entry xml:lang="en"><trademark class="registered">Linux</trademark></entry>
	      <entry xml:lang="en">The <trademark class="registered">Linux</trademark> operating system.</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;unix;</literal></entry>
	      <entry xml:lang="en"><trademark class="registered">UNIX</trademark></entry>
	      <entry xml:lang="en">The <trademark class="registered">UNIX</trademark> operating system.</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;windows;</literal></entry>
	      <entry xml:lang="en"><trademark class="registered">Windows</trademark></entry>
	      <entry xml:lang="en">The <trademark class="registered">Windows</trademark> operating system.</entry>
	    </row>

	    <row>
	      <entry/>
	      <entry/>
	      <entry/>
	    </row>

	    <row>
	      <entry namest="entity" nameend="notes" xml:lang="en">Miscellaneous
		Entities</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;prompt.root;</literal></entry>
	      <entry><prompt>#</prompt></entry>
	      <entry xml:lang="en">The <systemitem class="username">root</systemitem> user
		prompt.</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;prompt.user;</literal></entry>
	      <entry><prompt>%</prompt></entry>
	      <entry xml:lang="en">A prompt for an unprivileged user.</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;postscript;</literal></entry>
	      <entry xml:lang="en"><trademark class="registered">PostScript</trademark></entry>
	      <entry xml:lang="en">The
		<trademark class="registered">PostScript</trademark> programming language.</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;tex;</literal></entry>
	      <entry xml:lang="en"><application>TeX</application></entry>
	      <entry xml:lang="en">The
		<application>TeX</application> typesetting language.</entry>
	    </row>

	    <row>
	      <entry xml:lang="en"><literal>&amp;xorg;</literal></entry>
	      <entry xml:lang="en">Xorg</entry>
	      <entry xml:lang="en">The Xorg open source X
		Window System.</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>
  </sect1>

  <sect1 xml:id="docbook-markup-fpi">
    <title>正式公用識別碼 (FPI)</title>

    <para xml:lang="en">In compliance with the DocBook guidelines for writing
      <acronym>FPI</acronym>s for DocBook customizations, the
      <acronym>FPI</acronym> for the FreeBSD extended DocBook
      <acronym>DTD</acronym> is:</para>

      <programlisting xml:lang="en">PUBLIC "-//FreeBSD//DTD DocBook V4.2-Based Extension//EN"</programlisting>
  </sect1>

  <sect1 xml:id="docbook-markup-document-structure">
    <title>文件結構</title>

    <para xml:lang="en">DocBook allows structuring documentation in several ways.
      The FreeBSD Documentation Project uses two primary types of DocBook
      document: the book and the article.</para>

    <para xml:lang="en">Books are organized into <tag>chapter</tag>s.
      This is a mandatory requirement.  There may be
      <tag>part</tag>s between the book and the chapter to
      provide another layer of organization.  For example, the
      Handbook is arranged in this way.</para>

    <para xml:lang="en">A chapter may (or may not) contain one or more sections.
      These are indicated with the <tag>sect1</tag> element.
      If a section contains another section then use the
      <tag>sect2</tag> element, and so on, up to
      <tag>sect5</tag>.</para>

    <para xml:lang="en">Chapters and sections contain the remainder of the
      content.</para>

    <para xml:lang="en">An article is simpler than a book, and does not use
      chapters.  Instead, the content of an article is organized into
      one or more sections, using the same <tag>sect1</tag>
      (and <tag>sect2</tag> and so on) elements that are used
      in books.</para>

    <para xml:lang="en">The nature of the document being written should be used to
      determine whether it is best marked up as a book or an article.
      Articles are well suited to information that does not need to be
      broken down into several chapters, and that is, relatively
      speaking, quite short, at up to 20-25 pages of content.  Books
      are best suited to information that can be broken up into
      several chapters, possibly with appendices and similar content
      as well.</para>

    <para xml:lang="en">The <link xlink:href="@@URL_RELPREFIX@@/docs.html">FreeBSD
	tutorials</link> are all marked up as articles, while this
      document, the <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/faq/index.html">FAQ</link>,
      and the <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/index.html">Handbook</link> are all marked up as books, for
      example.</para>

    <sect2 xml:id="docbook-markup-starting-a-book">
      <title>開始撰寫書籍</title>

      <para xml:lang="en">The content of a book is contained within the
	<tag>book</tag> element.  As well as containing
	structural markup, this element can contain elements that
	include additional information about the book.  This is either
	meta-information, used for reference purposes, or additional
	content used to produce a title page.</para>

      <para xml:lang="en">This additional information is contained within
	<tag>info</tag>.</para>

      <example>
	<title>使用 <tag>info</tag><tag>book</tag> 樣板</title>

	<!-- Cannot put this in a marked section because of the
	  replaceable elements -->

	<programlisting xml:lang="en"><tag class="starttag">book</tag>
  <tag class="starttag">info</tag>
    <tag class="starttag">title</tag><replaceable>Your Title Here</replaceable><tag class="endtag">title</tag>

    <tag class="starttag">author</tag>
      <tag class="starttag">personname</tag>
        <tag class="starttag">firstname</tag><replaceable>Your first name</replaceable><tag class="endtag">firstname</tag>
        <tag class="starttag">surname</tag><replaceable>Your surname</replaceable><tag class="endtag">surname</tag>
      <tag class="endtag">personname</tag>

      <tag class="starttag">affiliation</tag>
	<tag class="starttag">address</tag>
          <tag class="starttag">email</tag><replaceable>Your email address</replaceable><tag class="endtag">email</tag>
	<tag class="endtag">address</tag>
      <tag class="endtag">affiliation</tag>
    <tag class="endtag">author</tag>

    <tag class="starttag">copyright</tag>
      <tag class="starttag">year</tag><replaceable>1998</replaceable><tag class="endtag">year</tag>
      <tag class="starttag">holder role="mailto:<replaceable>your email address</replaceable>"</tag><replaceable>Your name</replaceable><tag class="endtag">holder</tag>
    <tag class="endtag">copyright</tag>

    <tag class="starttag">releaseinfo</tag>$FreeBSD$<tag class="endtag">releaseinfo</tag>

    <tag class="starttag">abstract</tag>
      <tag class="starttag">para</tag><replaceable>Include an abstract of the book's contents here.</replaceable><tag class="endtag">para</tag>
    <tag class="endtag">abstract</tag>
  <tag class="endtag">info</tag><tag class="endtag">book</tag></programlisting>
      </example>
    </sect2>

    <sect2 xml:id="docbook-markup-starting-an-article">
      <title>開始撰寫文章</title>

      <para xml:lang="en">The content of the article is contained within the
	<tag>article</tag> element.  As well as containing
	structural markup, this element can contain elements that
	include additional information about the article.  This is
	either meta-information, used for reference purposes, or
	additional content used to produce a title page.</para>

      <para xml:lang="en">This additional information is contained within
	<tag>info</tag>.</para>

      <example>
	<title>使用 <tag>info</tag><tag>article</tag> 樣板</title>

	<!-- Cannot put this in a marked section because of the
	  replaceable elements -->

	<programlisting xml:lang="en"><tag class="starttag">article</tag>
  <tag class="starttag">info</tag>
    <tag class="starttag">title</tag><replaceable>Your title here</replaceable><tag class="endtag">title</tag>

    <tag class="starttag">author</tag>
      <tag class="starttag">personname</tag>
	<tag class="starttag">firstname</tag><replaceable>Your first name</replaceable><tag class="endtag">firstname</tag>
	<tag class="starttag">surname</tag><replaceable>Your surname</replaceable><tag class="endtag">surname</tag>
      <tag class="endtag">personname</tag>

      <tag class="starttag">affiliation</tag>
	<tag class="starttag">address</tag>
	  <tag class="starttag">email</tag><replaceable>Your email address</replaceable><tag class="endtag">email</tag><tag class="endtag">address</tag>
	<tag class="endtag">address</tag>
      <tag class="endtag">affiliation</tag>
    <tag class="endtag">author</tag>

    <tag class="starttag">copyright</tag>
      <tag class="starttag">year</tag><replaceable>1998</replaceable><tag class="endtag">year</tag>
      <tag class="starttag">holder role="mailto:<replaceable>your email address</replaceable>"</tag><replaceable>Your name</replaceable><tag class="endtag">holder</tag>
    <tag class="endtag">copyright</tag>

    <tag class="starttag">releaseinfo</tag>$FreeBSD$<tag class="endtag">releaseinfo</tag>

    <tag class="starttag">abstract</tag>
      <tag class="starttag">para</tag><replaceable>Include an abstract of the article's contents here.</replaceable><tag class="endtag">para</tag>
    <tag class="endtag">abstract</tag>
  <tag class="endtag">info</tag><tag class="endtag">article</tag></programlisting>
      </example>
    </sect2>

    <sect2 xml:id="docbook-markup-indicating-chapters">
      <title>標示章節</title>

      <para xml:lang="en">Use <tag>chapter</tag> to mark up your chapters.
	Each chapter has a mandatory <tag>title</tag>.
	Articles do not contain chapters, they are reserved for
	books.</para>

      <example>
	<title>簡單的章節</title>

	<programlisting xml:lang="en"><tag class="starttag">chapter</tag>
  <tag class="starttag">title</tag>The Chapter's Title<tag class="endtag">title</tag>

  ...
<tag class="endtag">chapter</tag></programlisting>
	</example>

	<para xml:lang="en">A chapter cannot be empty; it must contain elements in
	  addition to <tag>title</tag>.  If you need to
	  include an empty chapter then just use an empty
	  paragraph.</para>

	<example>
	  <title>空白章節</title>

	  <programlisting xml:lang="en"><tag class="starttag">chapter</tag>
  <tag class="starttag">title</tag>This is An Empty Chapter<tag class="endtag">title</tag>

  <tag class="starttag">para</tag><tag class="endtag">para</tag>
<tag class="endtag">chapter</tag></programlisting>
      </example>
    </sect2>

    <sect2 xml:id="docbook-markup-sections-below-chapters">
      <title>章底下的小節</title>

      <para xml:lang="en">In books, chapters may (but do not need to) be broken up
	into sections, subsections, and so on.  In articles, sections
	are the main structural element, and each article must contain
	at least one section.  Use the
	<tag>sect<replaceable>n</replaceable></tag> element.
	The <replaceable>n</replaceable> indicates the section number,
	which identifies the section level.</para>

      <para xml:lang="en">The first
	<tag>sect<replaceable>n</replaceable></tag> is
	<tag>sect1</tag>.  You can have one or more of these
	in a chapter.  They can contain one or more
	<tag>sect2</tag> elements, and so on, down to
	<tag>sect5</tag>.</para>

      <example>
	<title>章中的小節</title>

	<programlisting xml:lang="en"><tag class="starttag">chapter</tag>
  <tag class="starttag">title</tag>A Sample Chapter<tag class="endtag">title</tag>

  <tag class="starttag">para</tag>Some text in the chapter.<tag class="endtag">para</tag>

  <tag class="starttag">sect1</tag>
    <tag class="starttag">title</tag>First Section<tag class="endtag">title</tag><tag class="endtag">sect1</tag>

  <tag class="starttag">sect1</tag>
    <tag class="starttag">title</tag>Second Section<tag class="endtag">title</tag>

    <tag class="starttag">sect2</tag>
      <tag class="starttag">title</tag>First Sub-Section<tag class="endtag">title</tag>

      <tag class="starttag">sect3</tag>
	<tag class="starttag">title</tag>First Sub-Sub-Section<tag class="endtag">title</tag><tag class="endtag">sect3</tag>
    <tag class="endtag">sect2</tag>

    <tag class="starttag">sect2</tag>
      <tag class="starttag">title</tag>Second Sub-Section (1.2.2)<tag class="endtag">title</tag><tag class="endtag">sect2</tag>
  <tag class="endtag">sect1</tag>
<tag class="endtag">chapter</tag></programlisting>
      </example>

      <note>
	<para xml:lang="en">Section numbers are automatically generated and
	  prepended to titles when the document is rendered to an
	  output format.  The generated section numbers and titles
	  from the example above will be:</para>

	<itemizedlist>
	  <listitem>
	    <para xml:lang="en">1.1. First Section</para>
	  </listitem>

	  <listitem>
	    <para xml:lang="en">1.2. Second Section</para>
	  </listitem>

	  <listitem>
	    <para xml:lang="en">1.2.1. First Sub-Section</para>
	  </listitem>

	  <listitem>
	    <para xml:lang="en">1.2.1.1. First Sub-Sub-Section</para>
	  </listitem>

	  <listitem>
	    <para xml:lang="en">1.2.2. Second Sub-Section</para>
	  </listitem>
	</itemizedlist>
      </note>
    </sect2>

    <sect2 xml:id="docbook-markup-subdividing-part">
      <title>使用 <tag>part</tag> 元素來分部</title>

      <para xml:lang="en"><tag>part</tag>s introduce another level of
	organization between <tag>book</tag> and
	<tag>chapter</tag> with one or more
	<tag>part</tag>s.  This cannot be done in an
	<tag>article</tag>.</para>

      <programlisting xml:lang="en"><tag class="starttag">part</tag>
  <tag class="starttag">title</tag>Introduction<tag class="endtag">title</tag>

  <tag class="starttag">chapter</tag>
    <tag class="starttag">title</tag>Overview<tag class="endtag">title</tag>

    ...
  <tag class="endtag">chapter</tag>

  <tag class="starttag">chapter</tag>
    <tag class="starttag">title</tag>What is FreeBSD?<tag class="endtag">title</tag>

    ...
  <tag class="endtag">chapter</tag>

  <tag class="starttag">chapter</tag>
    <tag class="starttag">title</tag>History<tag class="endtag">title</tag>

    ...
  <tag class="endtag">chapter</tag>
<tag class="endtag">part</tag></programlisting>
    </sect2>
  </sect1>

  <sect1 xml:id="docbook-markup-block-elements">
    <title>區塊元素</title>

    <sect2 xml:id="docbook-markup-paragraphs">
      <title>段落</title>

      <para xml:lang="en">DocBook supports three types of paragraphs:
	<tag>formalpara</tag>, <tag>para</tag>, and
	<tag>simpara</tag>.</para>

      <para xml:lang="en">Almost all paragraphs in FreeBSD documentation use
	<tag>para</tag>.  <tag>formalpara</tag>
	includes a <tag>title</tag> element, and
	<tag>simpara</tag> disallows some elements from
	within <tag>para</tag>.  Stick with
	<tag>para</tag>.</para>

      <example>
	<title><tag>para</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">para</tag>This is a paragraph.  It can contain just about any
  other element.<tag class="endtag">para</tag></programlisting>

	<para>輸出結果:</para>

	<para xml:lang="en">This is a paragraph.  It can contain just about any
	  other element.</para>
      </example>
    </sect2>

    <sect2 xml:id="docbook-markup-block-quotations">
      <title>區塊引言</title>

      <para xml:lang="en">A block quotation is an extended quotation from another
	document that should not appear within the current paragraph.
	These are rarely needed.</para>

      <para xml:lang="en">Blockquotes can optionally contain a title and an
	attribution (or they can be left untitled and
	unattributed).</para>

      <example>
	<title><tag>blockquote</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">para</tag>A small excerpt from the US Constitution:<tag class="endtag">para</tag>

<tag class="starttag">blockquote</tag>
  <tag class="starttag">title</tag>Preamble to the Constitution of the United States<tag class="endtag">title</tag>

  <tag class="starttag">attribution</tag>Copied from a web site somewhere<tag class="endtag">attribution</tag>

  <tag class="starttag">para</tag>We the People of the United States, in Order to form a more
    perfect Union, establish Justice, insure domestic Tranquility,
    provide for the common defence, promote the general Welfare, and
    secure the Blessings of Liberty to ourselves and our Posterity, do
    ordain and establish this Constitution for the United States of
    America.<tag class="endtag">para</tag>
<tag class="endtag">blockquote</tag></programlisting>

	<para>輸出結果:</para>

	<para xml:lang="en">A small excerpt from the US Constitution:</para>

	<blockquote>
	  <title xml:lang="en">Preamble to the Constitution of the United
	    States</title>

	  <attribution xml:lang="en">Copied from a web site
	    somewhere</attribution>

	  <para xml:lang="en">We the People of the United States, in Order to form
	    a more perfect Union, establish Justice, insure domestic
	    Tranquility, provide for the common defence, promote the
	    general Welfare, and secure the Blessings of Liberty to
	    ourselves and our Posterity, do ordain and establish
	    this Constitution for the United States of
	    America.</para>
	</blockquote>
      </example>
    </sect2>

    <sect2 xml:id="docbook-markup-tips-notes">
      <title>提示、注意、警告、注意事項及重要資訊</title>

      <para xml:lang="en">Extra information may need to be separated from
	the main body of the text.  Typically this is
	<quote>meta</quote> information of which the user should be
	aware.</para>

      <para xml:lang="en">Several types of admonitions are available:
	<tag>tip</tag>, <tag>note</tag>,
	<tag>warning</tag>, <tag>caution</tag>, and
	<tag>important</tag>.</para>

      <para xml:lang="en">Which admonition to choose depends on the situation.
	The DocBook
	documentation suggests:</para>

      <itemizedlist>
	<listitem>
	  <para xml:lang="en">Note is for information that should be heeded by
	    all readers.</para>
	</listitem>

	<listitem>
	  <para xml:lang="en">Important is a variation on Note.</para>
	</listitem>

	<listitem>
	  <para xml:lang="en">Caution is for information regarding possible data
	    loss or software damage.</para>
	</listitem>

	<listitem>
	  <para xml:lang="en">Warning is for information regarding possible
	    hardware damage or injury to life or limb.</para>
	</listitem>
      </itemizedlist>

      <example>
	<title><tag>tip</tag><tag>important</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">tip</tag>
  <tag class="starttag">para</tag>&amp;os; may reduce stress.<tag class="endtag">para</tag>
<tag class="endtag">tip</tag>

<tag class="starttag">important</tag>
  <tag class="starttag">para</tag>Please use admonitions sparingly.  Too many admonitions
    are visually jarring and can have the opposite of the
    intended effect.<tag class="endtag">para</tag>
<tag class="endtag">important</tag></programlisting>
      </example>

      <para>輸出結果:</para>
      <!-- Need to do this outside of the example -->
      <tip>
	<para xml:lang="en">FreeBSD may reduce stress.</para>
      </tip>

      <important>
	<para xml:lang="en">Please use admonitions sparingly.  Too many admonitions
	  are visually jarring and can have the opposite of the
	  intended effect.</para>
      </important>
    </sect2>

    <sect2 xml:id="docbook-markup-example">
      <title>範例</title>

      <para xml:lang="en">Examples can be shown with <tag>example</tag>.</para>

      <example>
	<title><tag>example</tag> 原始碼</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">example</tag>
  <tag class="starttag">para</tag>Empty files can be created easily:<tag class="endtag">para</tag>

  <tag class="starttag">screen</tag>&amp;prompt.user; <tag class="starttag">userinput</tag>touch file1 file2 file3<tag class="endtag">userinput</tag><tag class="endtag">screen</tag>
<tag class="endtag">example</tag></programlisting>
      </example>

      <!-- Need to do this outside of the example -->
      <para>輸出結果:</para>

      <example>
	<title><tag>example</tag> 的結果</title>

	<para xml:lang="en">Empty files can be created easily:</para>

	<screen xml:lang="en"><prompt>%</prompt> <userinput>touch file1 file2 file3</userinput></screen>
      </example>
    </sect2>

    <sect2 xml:id="docbook-markup-lists-and-procedures">
      <title>清單與步驟</title>

      <para xml:lang="en">Information often needs to be presented as lists, or as a
	number of steps that must be carried out in order to
	accomplish a particular goal.</para>

      <para xml:lang="en">To do this, use <tag>itemizedlist</tag>,
	<tag>orderedlist</tag>, <tag>variablelist</tag>, or
	<tag>procedure</tag>.  There are other types of list
	elements in DocBook, but we will not cover them here.</para>

      <para xml:lang="en"><tag>itemizedlist</tag> and
	<tag>orderedlist</tag> are similar to their
	counterparts in <acronym>HTML</acronym>, <tag>ul</tag>
	and <tag>ol</tag>.  Each one consists of one or more
	<tag>listitem</tag> elements, and each
	<tag>listitem</tag> contains one or more block
	elements.  The <tag>listitem</tag> elements are
	analogous to <acronym>HTML</acronym>'s <tag>li</tag>
	tags.  However, unlike HTML, they are required.</para>

      <example>
	<title><tag>itemizedlist</tag><tag>orderedlist</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">itemizedlist</tag>
  <tag class="starttag">listitem</tag>
    <tag class="starttag">para</tag>This is the first itemized item.<tag class="endtag">para</tag>
  <tag class="endtag">listitem</tag>

  <tag class="starttag">listitem</tag>
    <tag class="starttag">para</tag>This is the second itemized item.<tag class="endtag">para</tag>
  <tag class="endtag">listitem</tag>
<tag class="endtag">itemizedlist</tag>

<tag class="starttag">orderedlist</tag>
  <tag class="starttag">listitem</tag>
    <tag class="starttag">para</tag>This is the first ordered item.<tag class="endtag">para</tag>
  <tag class="endtag">listitem</tag>

  <tag class="starttag">listitem</tag>
    <tag class="starttag">para</tag>This is the second ordered item.<tag class="endtag">para</tag>
  <tag class="endtag">listitem</tag>
<tag class="endtag">orderedlist</tag></programlisting>

	<para>輸出結果:</para>

	<itemizedlist>
	  <listitem>
	    <para xml:lang="en">This is the first itemized item.</para>
	  </listitem>

	  <listitem>
	    <para xml:lang="en">This is the second itemized item.</para>
	  </listitem>
	</itemizedlist>

	<orderedlist>
	  <listitem>
	    <para xml:lang="en">This is the first ordered item.</para>
	  </listitem>

	  <listitem>
	    <para xml:lang="en">This is the second ordered item.</para>
	  </listitem>
	</orderedlist>
      </example>

      <para xml:id="docbook-markup-varlist" xml:lang="en">An alternate and often
	useful way of presenting information is the
	<tag>variablelist</tag>.  These are lists where each entry has
	a term and a description.  They are well suited for many types
	of descriptions, and present information in a form that is
	often easier for the reader than sections and
	subsections.</para>

      <para xml:lang="en">A <tag>variablelist</tag> has a <tag>title</tag>, and then
	pairs of <tag>term</tag> and <tag>listitem</tag>
	entries.</para>

      <example xml:id="docbook-markup-variablelist-example">
	<title><tag>variablelist</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">variablelist</tag>
  <tag class="starttag">varlistentry</tag>
    <tag class="starttag">term</tag>Parallel<tag class="endtag">term</tag>

    <tag class="starttag">listitem</tag>
      <tag class="starttag">para</tag>In parallel communications, groups of bits arrive
	at the same time over multiple communications
	channels.<tag class="endtag">para</tag>
    <tag class="endtag">listitem</tag>
  <tag class="endtag">varlistentry</tag>

  <tag class="starttag">varlistentry</tag>
    <tag class="starttag">term</tag>Serial<tag class="endtag">term</tag>

    <tag class="starttag">listitem</tag>
      <tag class="starttag">para</tag>In serial communications, bits arrive one at a
	time over a single communications
	channel.<tag class="endtag">para</tag>
    <tag class="endtag">listitem</tag>
  <tag class="endtag">varlistentry</tag>
<tag class="endtag">variablelist</tag></programlisting>

	<para>輸出結果:</para>

	<variablelist>
	  <varlistentry>
	    <term xml:lang="en">Parallel</term>

	    <listitem>
	      <para xml:lang="en">In parallel communications, groups of bits arrive
		at the same time over multiple communications
		channels.</para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term xml:lang="en">Serial</term>

	    <listitem>
	      <para xml:lang="en">In serial communications, bits arrive one at a
		time over a single communications channel.</para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </example>

      <para xml:lang="en">A <tag>procedure</tag> shows a series of
	<tag>step</tag>s, which may in turn
	consist of more <tag>step</tag>s or
	<tag>substep</tag>s.  Each <tag>step</tag>
	contains block elements and may include an optional title.</para>

      <para xml:lang="en">Sometimes, steps are not sequential, but present a choice:
	do <emphasis>this</emphasis> or do <emphasis>that</emphasis>,
	but not both.  For these alternative choices, use
	<tag>stepalternatives</tag>.</para>

      <example>
	<title><tag>procedure</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">procedure</tag>
  <tag class="starttag">step</tag>
    <tag class="starttag">para</tag>Do this.<tag class="endtag">para</tag>
  <tag class="endtag">step</tag>

  <tag class="starttag">step</tag>
    <tag class="starttag">para</tag>Then do this.<tag class="endtag">para</tag>
  <tag class="endtag">step</tag>

  <tag class="starttag">step</tag>
    <tag class="starttag">para</tag>And now do this.<tag class="endtag">para</tag>
  <tag class="endtag">step</tag>

  <tag class="starttag">step</tag>
    <tag class="starttag">para</tag>Finally, do one of these.<tag class="endtag">para</tag>

    <tag class="starttag">stepalternatives</tag>
      <tag class="starttag">step</tag>
	<tag class="starttag">para</tag>Go left.<tag class="endtag">para</tag>
      <tag class="endtag">step</tag>

      <tag class="starttag">step</tag>
	<tag class="starttag">para</tag>Go right.<tag class="endtag">para</tag>
      <tag class="endtag">step</tag>
    <tag class="endtag">stepalternatives</tag>
  <tag class="endtag">step</tag>
<tag class="endtag">procedure</tag></programlisting>

	<para>輸出結果:</para>

	<procedure>
	  <step>
	    <para xml:lang="en">Do this.</para>
	  </step>

	  <step>
	    <para xml:lang="en">Then do this.</para>
	  </step>

	  <step>
	    <para xml:lang="en">And now do this.</para>
	  </step>

	  <step>
	    <para xml:lang="en">Finally, do one of these:</para>

	    <stepalternatives>
	      <step>
		<para xml:lang="en">Go left.</para>
	      </step>

	      <step>
		<para xml:lang="en">Go right.</para>
	      </step>
	    </stepalternatives>
	  </step>
	</procedure>
      </example>
    </sect2>

    <sect2 xml:id="docbook-markup-showing-file-samples">
      <title>顯示檔案範本</title>

      <para xml:lang="en">Fragments of a file (or perhaps a complete file) are shown
	by wrapping them in the <tag>programlisting</tag>
	element.</para>

      <para xml:lang="en">White space and line breaks within
	<tag>programlisting</tag> <emphasis>are</emphasis>
	significant.  In particular, this means that the opening tag
	should appear on the same line as the first line of the
	output, and the closing tag should appear on the same line
	as the last line of the output, otherwise spurious blank
	lines may be included.</para>

      <example>
	<title><tag>programlisting</tag> 範例</title>

	<para>用法:</para>

	<programlisting xml:lang="en"><tag class="starttag">para</tag>When finished, the program will look like
  this:<tag class="endtag">para</tag>

<tag class="starttag">programlisting</tag>#include &amp;lt;stdio.h&amp;gt;

int
main(void)
{
    printf("hello, world\n");
}<tag class="endtag">programlisting</tag></programlisting>

	<para xml:lang="en">Notice how the angle brackets in the
	  <literal>#include</literal> line need to be referenced by
	  their entities instead of being included literally.</para>

	<para>輸出結果:</para>

	<para xml:lang="en">When finished, the program will look like this:</para>

	<programlisting xml:lang="en">#include &lt;stdio.h&gt;

int
main(void)
{
    printf("hello, world\n");
}</programlisting>
      </example>
    </sect2>

    <sect2 xml:id="docbook-markup-callouts">
      <title>標註</title>

      <para xml:lang="en">A callout is a visual marker for referring to a
	piece of text or specific position within an
	example.</para>

      <para xml:lang="en">Callouts are marked with the <tag>co</tag>
	element.  Each element must have a unique
	<literal>id</literal> assigned to it.  After the example,
	include a <tag>calloutlist</tag> that describes each
	callout.</para>

      <example>
	<title><tag>co</tag><tag>calloutlist</tag> 範例</title>

	<programlisting xml:lang="en"><tag class="starttag">para</tag>When finished, the program will look like
  this:<tag class="endtag">para</tag>

<tag class="starttag">programlisting</tag>#include &amp;lt;stdio.h&amp;gt; <tag class="emptytag">co xml:id="co-ex-include"</tag>

int <tag class="emptytag"