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
|
<?xml version="1.0" encoding="ascii" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ascii" />
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
<title>Epydoc</title>
<meta name="author" content="Edward Loper" />
<link rel="stylesheet" href="custom.css" type="text/css" />
</head>
<body>
<div class="document" id="epydoc">
<h1 class="title">Epydoc</h1>
<h2 class="subtitle" id="automatic-api-documentation-generation-for-python">Automatic API Documentation Generation for Python</h2>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td><a class="first last reference external" href="mailto:edloper@gradient.cis.upenn.edu">Edward Loper</a></td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>3.0b1</td></tr>
</tbody>
</table>
<div class="abstract topic">
<p class="topic-title first">Abstract</p>
<p>Epydoc is a tool for generating API documentation for Python modules,
based on their docstrings. For an example of epydoc's output, see the API
documentation for epydoc itself (<a class="reference external" href="http://epydoc.sourceforge.net/api/">html</a>, <a class="reference external" href="http://epydoc.sourceforge.net/epydoc.pdf">pdf</a>). A lightweight markup language
called <a class="reference internal" href="#the-epytext-markup-language">epytext</a> can be used to format docstrings, and to add information
about specific fields, such as parameters and instance variables. Epydoc
also understands docstrings written in <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>, <a class="reference external" href="http://java.sun.com/j2se/javadoc/">Javadoc</a>, and
plaintext. For a more extensive example of epydoc's output, see the <a class="reference external" href="http://epydoc.sourceforge.net/stdlib/">API
documentation for Python 2.4</a>.</p>
</div>
<!-- $Id: manual.txt 1559 2007-02-27 06:42:46Z edloper $ -->
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="auto-toc simple">
<li><a class="reference internal" href="#installing-epydoc" id="id19">1 Installing Epydoc</a><ul class="auto-toc">
<li><a class="reference internal" href="#downloading-epydoc" id="id20">1.1 Downloading Epydoc</a></li>
<li><a class="reference internal" href="#getting-epydoc-from-subversion" id="id21">1.2 Getting Epydoc from Subversion</a></li>
<li><a class="reference internal" href="#installing-from-the-rpm-file" id="id22">1.3 Installing from the RPM File</a></li>
<li><a class="reference internal" href="#installing-from-the-windows-installer" id="id23">1.4 Installing from the Windows Installer</a></li>
<li><a class="reference internal" href="#installing-from-the-source-distribution-using-make" id="id24">1.5 Installing from the Source Distribution (using make)</a></li>
<li><a class="reference internal" href="#installing-from-the-source-distribution-without-make" id="id25">1.6 Installing from the Source Distribution (without make)</a></li>
<li><a class="reference internal" href="#installing-on-debian" id="id26">1.7 Installing on Debian</a></li>
</ul>
</li>
<li><a class="reference internal" href="#using-epydoc" id="id27">2 Using Epydoc</a><ul class="auto-toc">
<li><a class="reference internal" href="#the-command-line-interface" id="id28">2.1 The Command Line Interface</a><ul class="auto-toc">
<li><a class="reference internal" href="#command-line-usage-abbreviated" id="id29">2.1.1 Command Line Usage (Abbreviated)</a></li>
<li><a class="reference internal" href="#examples" id="id30">2.1.2 Examples</a></li>
<li><a class="reference internal" href="#configuration-files" id="id31">2.1.3 Configuration Files</a></li>
</ul>
</li>
<li><a class="reference internal" href="#the-graphical-interface" id="id32">2.2 The Graphical Interface</a></li>
<li><a class="reference internal" href="#documentation-completeness-checks" id="id33">2.3 Documentation Completeness Checks</a></li>
<li><a class="reference internal" href="#html-files" id="id34">2.4 HTML Files</a></li>
<li><a class="reference internal" href="#css-stylesheets" id="id35">2.5 CSS Stylesheets</a></li>
</ul>
</li>
<li><a class="reference internal" href="#python-docstrings" id="id36">3 Python Docstrings</a><ul class="auto-toc">
<li><a class="reference internal" href="#variable-docstrings" id="id37">3.1 Variable docstrings</a></li>
<li><a class="reference internal" href="#items-visibility" id="id38">3.2 Items visibility</a></li>
</ul>
</li>
<li><a class="reference internal" href="#the-epytext-markup-language" id="id39">4 The Epytext Markup Language</a><ul class="auto-toc">
<li><a class="reference internal" href="#a-brief-introduction" id="id40">4.1 A Brief Introduction</a></li>
<li><a class="reference internal" href="#epytext-language-overview" id="id41">4.2 Epytext Language Overview</a></li>
<li><a class="reference internal" href="#block-structure" id="id42">4.3 Block Structure</a><ul class="auto-toc">
<li><a class="reference internal" href="#paragraphs" id="id43">4.3.1 Paragraphs</a></li>
<li><a class="reference internal" href="#lists" id="id44">4.3.2 Lists</a></li>
<li><a class="reference internal" href="#sections" id="id45">4.3.3 Sections</a></li>
<li><a class="reference internal" href="#literal-blocks" id="id46">4.3.4 Literal Blocks</a></li>
<li><a class="reference internal" href="#doctest-blocks" id="id47">4.3.5 Doctest Blocks</a></li>
<li><a class="reference internal" href="#fields" id="id48">4.3.6 Fields</a></li>
</ul>
</li>
<li><a class="reference internal" href="#inline-markup" id="id49">4.4 Inline Markup</a><ul class="auto-toc">
<li><a class="reference internal" href="#basic-inline-markup" id="id50">4.4.1 Basic Inline Markup</a></li>
<li><a class="reference internal" href="#urls" id="id51">4.4.2 URLs</a></li>
<li><a class="reference internal" href="#documentation-crossreference-links" id="id52">4.4.3 Documentation Crossreference Links</a></li>
<li><a class="reference internal" href="#indexed-terms" id="id53">4.4.4 Indexed Terms</a></li>
<li><a class="reference internal" href="#symbols" id="id54">4.4.5 Symbols</a></li>
<li><a class="reference internal" href="#escaping" id="id55">4.4.6 Escaping</a></li>
<li><a class="reference internal" href="#graphs" id="id56">4.4.7 Graphs</a></li>
</ul>
</li>
<li><a class="reference internal" href="#characters" id="id57">4.5 Characters</a><ul class="auto-toc">
<li><a class="reference internal" href="#valid-characters" id="id58">4.5.1 Valid Characters</a></li>
<li><a class="reference internal" href="#content-characters" id="id59">4.5.2 Content Characters</a></li>
<li><a class="reference internal" href="#spaces-and-newlines" id="id60">4.5.3 Spaces and Newlines</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#epydoc-fields" id="id61">5 Epydoc Fields</a><ul class="auto-toc">
<li><a class="reference internal" href="#field-markup" id="id62">5.1 Field Markup</a></li>
<li><a class="reference internal" href="#supported-fields" id="id63">5.2 Supported Fields</a><ul class="auto-toc">
<li><a class="reference internal" href="#functions-and-methods-parameters" id="id64">5.2.1 Functions and Methods parameters</a></li>
<li><a class="reference internal" href="#variables-parameters" id="id65">5.2.2 Variables parameters</a></li>
<li><a class="reference internal" href="#properties-parameters" id="id66">5.2.3 Properties parameters</a></li>
<li><a class="reference internal" href="#grouping-and-sorting" id="id67">5.2.4 Grouping and Sorting</a></li>
<li><a class="reference internal" href="#notes-and-warnings" id="id68">5.2.5 Notes and Warnings</a></li>
<li><a class="reference internal" href="#status" id="id69">5.2.6 Status</a></li>
<li><a class="reference internal" href="#formal-conditions" id="id70">5.2.7 Formal Conditions</a></li>
<li><a class="reference internal" href="#bibliographic-information" id="id71">5.2.8 Bibliographic Information</a></li>
<li><a class="reference internal" href="#other-fields" id="id72">5.2.9 Other fields</a></li>
</ul>
</li>
<li><a class="reference internal" href="#fields-synonyms" id="id73">5.3 Fields synonyms</a></li>
<li><a class="reference internal" href="#module-metadata-variables" id="id74">5.4 Module metadata variables</a></li>
<li><a class="reference internal" href="#adding-new-fields" id="id75">5.5 Adding New Fields</a></li>
</ul>
</li>
<li><a class="reference internal" href="#alternate-markup-languages" id="id76">6 Alternate Markup Languages</a><ul class="auto-toc">
<li><a class="reference internal" href="#id13" id="id77">6.1 reStructuredText</a><ul class="auto-toc">
<li><a class="reference internal" href="#default-role" id="id78">6.1.1 Default role</a></li>
<li><a class="reference internal" href="#consolidated-fields" id="id79">6.1.2 Consolidated Fields</a></li>
<li><a class="reference internal" href="#graph-directives" id="id80">6.1.3 Graph directives</a></li>
<li><a class="reference internal" href="#colorized-snippets-directive" id="id81">6.1.4 Colorized snippets directive</a></li>
<li><a class="reference internal" href="#external-api-links" id="id82">6.1.5 External API links</a><ul class="auto-toc">
<li><a class="reference internal" href="#names-resolution" id="id83">6.1.5.1 Names resolution</a></li>
<li><a class="reference internal" href="#linking-from-standalone-documents" id="id84">6.1.5.2 Linking from standalone documents</a></li>
</ul>
</li>
<li><a class="reference internal" href="#indexed-terms-in-restructuredtext" id="id85">6.1.6 Indexed Terms in reStructuredText</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id15" id="id86">6.2 Javadoc</a><ul class="auto-toc">
<li><a class="reference internal" href="#javadoc-fields" id="id87">6.2.1 Javadoc Fields</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#references" id="id88">7 References</a><ul class="auto-toc">
<li><a class="reference internal" href="#command-line-usage" id="id89">7.1 Command Line Usage</a></li>
<li><a class="reference internal" href="#sample-configuration-file" id="id90">7.2 Sample Configuration File</a></li>
<li><a class="reference internal" href="#warnings-and-errors" id="id91">7.3 Warnings and Errors</a><ul class="auto-toc">
<li><a class="reference internal" href="#epytext-warnings" id="id92">7.3.1 Epytext Warnings</a></li>
<li><a class="reference internal" href="#field-warnings" id="id93">7.3.2 Field Warnings</a></li>
<li><a class="reference internal" href="#epytext-errors" id="id94">7.3.3 Epytext Errors</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!-- Include the document chapters -->
<div class="section" id="installing-epydoc">
<h1><a class="toc-backref" href="#id19">1 Installing Epydoc</a></h1>
<!-- $Id: manual-install.txt 1692 2008-01-30 17:11:29Z edloper $ -->
<div class="section" id="downloading-epydoc">
<h2><a class="toc-backref" href="#id20">1.1 Downloading Epydoc</a></h2>
<p>Epydoc can be downloaded from the <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=32455">SourceForge download page</a>. Epydoc is
available in five formats:</p>
<ul class="simple">
<li>RPM (<tt class="docutils literal"><span class="pre">.noarch.rpm</span></tt>)</li>
<li>Windows installer (<tt class="docutils literal"><span class="pre">.win32.exe</span></tt>)</li>
<li>Source install (<tt class="docutils literal"><span class="pre">.tar.gz</span></tt>)</li>
<li>Source install (<tt class="docutils literal"><span class="pre">.zip</span></tt>)</li>
<li>Source RPM (<tt class="docutils literal"><span class="pre">.src.rpm</span></tt>)</li>
</ul>
<p>If you are installing on RedHat, I recommend that you use the RPM file. If you
are installing on Windows, I recommended that you use the windows installer.
Otherwise, you should use one of the source install files.</p>
</div>
<div class="section" id="getting-epydoc-from-subversion">
<h2><a class="toc-backref" href="#id21">1.2 Getting Epydoc from Subversion</a></h2>
<p>If you wish to keep up on the latest developments, you can get the latest
version of epydoc from the <a class="reference external" href="http://sourceforge.net/svn/?group_id=32455">subversion repository</a>:</p>
<pre class="literal-block">
[/home/edloper]$ svn co https://epydoc.svn.sourceforge.net/svnroot/epydoc/trunk/epydoc epydoc
[/home/edloper]$ ls epydoc
Makefile doc man sandbox src
</pre>
<p>This will create a directory named <tt class="docutils literal"><span class="pre">epydoc</span></tt> containing the latest version of
epydoc. The <tt class="docutils literal"><span class="pre">epydoc</span></tt> package itself is in <tt class="docutils literal"><span class="pre">epydoc/src/epydoc</span></tt> (so adding
<tt class="docutils literal"><span class="pre">epydoc/src</span></tt> to your <tt class="docutils literal"><span class="pre">PYTHONPATH</span></tt> will let you use it). You should
periodically update your copy of the subversion repository, to make sure you
have all the latest changes:</p>
<pre class="literal-block">
[/home/edloper/epydoc]$ svn up
</pre>
<p>You can browse the subversion repository <a class="reference external" href="http://epydoc.svn.sourceforge.net/viewcvs.cgi/epydoc/trunk/epydoc/">here</a>.</p>
</div>
<div class="section" id="installing-from-the-rpm-file">
<h2><a class="toc-backref" href="#id22">1.3 Installing from the RPM File</a></h2>
<ol class="arabic">
<li><p class="first">Download the RPM file to a directory of your choice.</p>
</li>
<li><p class="first">Use rpm to install the new package.</p>
<pre class="literal-block">
[/tmp]$ su
Password:
[/tmp]# rpm -i epydoc-3.0.1.noarch.rpm
</pre>
</li>
<li><p class="first">Once epydoc is installed, you can delete the RPM file.</p>
<pre class="literal-block">
[/tmp]# rm epydoc-3.0.1.rpm
</pre>
</li>
</ol>
</div>
<div class="section" id="installing-from-the-windows-installer">
<h2><a class="toc-backref" href="#id23">1.4 Installing from the Windows Installer</a></h2>
<ol class="arabic simple">
<li>Download and run <tt class="docutils literal"><span class="pre">epydoc-3.0.1.win32.exe</span></tt>.</li>
<li>Follow the on-screen instructions. Epydoc will be installed in the epydoc
subdirectory of your Python installation directory (typically
<tt class="docutils literal"><span class="pre">C:\Python24\</span></tt>).</li>
<li>The Windows installer creates two scripts in the <tt class="docutils literal"><span class="pre">Scripts</span></tt> subdirectory of
your Python installation directory: <tt class="docutils literal"><span class="pre">epydoc.pyw</span></tt> opens the graphical user
interface, and <tt class="docutils literal"><span class="pre">epydoc.py</span></tt> calls the command line interface. If you'd
like, you can create shortcuts from these scripts to more convenient
locations (such as your desktop or start menu).</li>
<li>Once epydoc is installed, you can delete <tt class="docutils literal"><span class="pre">epydoc-3.0.1.win32.exe</span></tt>.</li>
</ol>
</div>
<div class="section" id="installing-from-the-source-distribution-using-make">
<h2><a class="toc-backref" href="#id24">1.5 Installing from the Source Distribution (using make)</a></h2>
<ol class="arabic">
<li><p class="first">Download an epydoc source distribution to a directory of your choice, and
uncompress it.</p>
<pre class="literal-block">
[/tmp]$ wget -q http://prdownloads.sourceforge.net/epydoc/epydoc-3.0.1.tar.gz
[/tmp]$ gunzip epydoc-3.0.1.tar.gz
[/tmp]$ tar -xvf epydoc-3.0.1.tar
</pre>
</li>
<li><p class="first">Use <tt class="docutils literal"><span class="pre">make</span> <span class="pre">install</span></tt> in the <tt class="docutils literal"><span class="pre">eydoc-3.0.1/</span></tt> directory to install
epydoc.</p>
<pre class="literal-block">
[/tmp]$ cd epydoc-3.0.1/
[/tmp/epydoc-3.0.1]$ su
Password:
[/tmp/epydoc-3.0.1]# make install
running install
running build
[...]
copying build/scripts/epydoc -> /usr/bin
changing mode of /usr/bin/epydoc to 100775
</pre>
</li>
<li><p class="first">If you'd like to keep a local copy of the documentation, then use <tt class="docutils literal"><span class="pre">make</span>
<span class="pre">installdocs</span></tt>. By default, this will install the documentation to
<tt class="docutils literal"><span class="pre">/usr/share/doc/</span></tt> and the man pages to <tt class="docutils literal"><span class="pre">/usr/share/man/</span></tt>. If you would
prefer to install documentation to different directories (such as
<tt class="docutils literal"><span class="pre">/usr/lib/doc</span></tt>), then edit the <tt class="docutils literal"><span class="pre">MAN</span></tt> and <tt class="docutils literal"><span class="pre">DOC</span></tt> variables at the top of
<tt class="docutils literal"><span class="pre">Makefile</span></tt> before running <tt class="docutils literal"><span class="pre">make</span> <span class="pre">installdocs</span></tt>.</p>
<pre class="literal-block">
[/tmp/epydoc-3.0.1]# make installdocs
</pre>
</li>
<li><p class="first">Once epydoc is installed, you can delete the installation directory and the
source distribution file.</p>
<pre class="literal-block">
[/tmp/epydoc-3.0.1]# cd ..
[/tmp]# rm -r epydoc-3.0.1
[/tmp]# rm epydoc-3.0.1.tar
</pre>
</li>
</ol>
</div>
<div class="section" id="installing-from-the-source-distribution-without-make">
<h2><a class="toc-backref" href="#id25">1.6 Installing from the Source Distribution (without make)</a></h2>
<ol class="arabic">
<li><p class="first">Download an epydoc source distribution to a directory of your choice, and
uncompress it.</p>
<pre class="literal-block">
[/tmp]$ wget -q http://prdownloads.sourceforge.net/epydoc/epydoc-3.0.1.tar.gz
[/tmp]$ gunzip epydoc-3.0.1.tar.gz
[/tmp]$ tar -xvf epydoc-3.0.1.tar
</pre>
</li>
<li><p class="first">Use the <tt class="docutils literal"><span class="pre">setup.py</span></tt> script in the <tt class="docutils literal"><span class="pre">eydoc-3.0.1/</span></tt> directory to install
epydoc.</p>
<pre class="literal-block">
[/tmp]$ cd epydoc-3.0.1/
[/tmp/epydoc-3.0.1]$ su
Password:
[/tmp/epydoc-3.0.1]# python setup.py install
running install
running build
[...]
copying build/scripts/epydoc -> /usr/bin
changing mode of /usr/bin/epydoc to 100775
[/tmp/epydoc-3.0.1]# cd ..
[/tmp]#
</pre>
</li>
<li><p class="first">If you'd like to keep a local copy of the documentation, then copy it to a
permanant location, such as <tt class="docutils literal"><span class="pre">/usr/share/doc/</span></tt>. You may also want to copy
the man pages to a permanant location, such as <tt class="docutils literal"><span class="pre">/usr/share/man/</span></tt>.</p>
<pre class="literal-block">
[/tmp]# cp -r epydoc-3.0.1/doc/ /usr/share/doc/epydoc/
[/tmp]# cp epydoc-3.0.1/man/* /usr/share/man/
</pre>
</li>
<li><p class="first">Once epydoc is installed, you can delete the installation directory and the
source distribution file.</p>
<pre class="literal-block">
[/tmp]# rm -r epydoc-3.0.1
[/tmp]# rm epydoc-3.0.1.tar
</pre>
</li>
</ol>
</div>
<div class="section" id="installing-on-debian">
<h2><a class="toc-backref" href="#id26">1.7 Installing on Debian</a></h2>
<p>Epydoc 2.1 is available as a testing debian package (<tt class="docutils literal"><span class="pre">python-epydoc</span></tt>). The
epydoc documentation is also available as a package (<tt class="docutils literal"><span class="pre">epydoc-doc</span></tt>).</p>
</div>
</div>
<div class="section" id="using-epydoc">
<h1><a class="toc-backref" href="#id27">2 Using Epydoc</a></h1>
<!-- $Id: manual-usage.txt 1554 2007-02-27 03:31:56Z edloper $ -->
<p>Epydoc provides two user interfaces:</p>
<ul class="simple">
<li>The command line interface, which is accessed via a script named <tt class="docutils literal"><span class="pre">epydoc</span></tt>
(or <tt class="docutils literal"><span class="pre">epydoc.py</span></tt> on Windows)</li>
<li>The graphical interface, which is accessed via a script named <tt class="docutils literal"><span class="pre">epydocgui</span></tt>
(or <tt class="docutils literal"><span class="pre">epydoc.pyw</span></tt> on Windows).</li>
</ul>
<p>Epydoc can also be accessed programmatically; see <tt class="docutils literal"><span class="pre">epydoc's</span> <span class="pre">API</span>
<span class="pre">documentation</span></tt> for more information.</p>
<div class="section" id="the-command-line-interface">
<h2><a class="toc-backref" href="#id28">2.1 The Command Line Interface</a></h2>
<p>The <tt class="docutils literal"><span class="pre">epydoc</span></tt> script extracts API documentation for a set of Python objects,
and writes it using a selected output format. Objects can be named using dotted
names, module filenames, or package directory names. (On Windows, this script
is named <tt class="docutils literal"><span class="pre">epydoc.py</span></tt>.)</p>
<div class="section" id="command-line-usage-abbreviated">
<h3><a class="toc-backref" href="#id29">2.1.1 Command Line Usage (Abbreviated)</a></h3>
<pre class="literal-block">
epydoc [--html|--pdf] [-o <em>DIR</em>] [--parse-only|--introspect-only] [-v|-q]
[--name <em>NAME</em>] [--url <em>URL</em>] [--docformat <em>NAME</em>] [--graph <em>GRAPHTYPE</em>]
[--inheritance <em>STYLE</em>] [--config <em>FILE</em>] <em>OBJECTS...</em>
</pre>
<dl class="docutils">
<dt><em>OBJECTS...</em></dt>
<dd>A list of the Python objects that should be documented. Objects can be
specified using dotted names (such as <tt class="docutils literal"><span class="pre">os.path</span></tt>), module filenames (such
as <tt class="docutils literal"><span class="pre">epydoc/epytext.py</span></tt>), or package directory names (such as <tt class="docutils literal"><span class="pre">epydoc/</span></tt>).
Packages are expanded to include all sub-modules and sub-packages.</dd>
</dl>
<div class="epydoc-usage container">
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--html</span></kbd></td>
<td>Generate HTML output. (default)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--pdf</span></kbd></td>
<td>Generate Adobe Acrobat (PDF) output, using LaTeX.</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-o <var>DIR</var></span>, <span class="option">--output <var>DIR</var></span>, <span class="option">--target <var>DIR</var></span></kbd></td>
</tr>
<tr><td> </td><td>The output directory.</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--parse-only</span>, <span class="option">--introspect-only</span></kbd></td>
</tr>
<tr><td> </td><td>By default, epydoc will gather information about each Python object using
two methods: parsing the object's source code; and importing the object and
directly introspecting it. Epydoc combines the information obtained from
these two methods to provide more complete and accurate documentation.
However, if you wish, you can tell epydoc to use only one or the other of
these methods. For example, if you are running epydoc on untrusted code,
you should use the <tt class="docutils literal"><span class="pre">--parse-only</span></tt> option.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-v</span>, <span class="option">-q</span></kbd></td>
<td>Increase (<tt class="docutils literal"><span class="pre">-v</span></tt>) or decrease (<tt class="docutils literal"><span class="pre">-q</span></tt>) the verbosity of the output. These
options may be repeated to further increase or decrease verbosity.
Docstring markup warnings are supressed unless <tt class="docutils literal"><span class="pre">-v</span></tt> is used at least once.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--name <var>NAME</var></span></kbd></td>
<td>The documented project's name.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--url <var>URL</var></span></kbd></td>
<td>The documented project's URL.</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--docformat <var>NAME</var></span></kbd></td>
</tr>
<tr><td> </td><td>The markup language that should be used by default to process modules'
docstrings. This is only used for modules that do not define the special
<tt class="docutils literal"><span class="pre">__docformat__</span></tt> variable; it is recommended that you explicitly specify
<tt class="docutils literal"><span class="pre">__docformat__</span></tt> in all your modules.</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--graph <var>GRAPHTYPE</var></span></kbd></td>
</tr>
<tr><td> </td><td><p class="first">Include graphs of type <em>GRAPHTYPE</em> in the generated output. Graphs are
generated using the Graphviz <tt class="docutils literal"><span class="pre">dot</span></tt> executable. If this executable is not
on the path, then use <tt class="docutils literal"><span class="pre">--dotpath</span></tt> to specify its location. This option
may be repeated to include multiple graph types in the output. To include
all graphs, use <tt class="docutils literal"><span class="pre">--graph</span> <span class="pre">all</span></tt>. The available graph types are:</p>
<ul class="last simple">
<li><strong>classtree</strong>: displays each class's base classes and subclasses;</li>
<li><strong>callgraph</strong>: displays the callers and callees of each function or
method. These graphs are based on profiling information, which must be
specified using the <tt class="docutils literal"><span class="pre">--pstate</span></tt> option.</li>
<li><strong>umlclass</strong>: displays each class's base classes and subclasses, using
UML style. Methods and attributes are listed in the classes where they
are defined. If type information is available about attributes (via the
<tt class="docutils literal"><span class="pre">@type</span></tt> field), then those types are displayed as separate classes, and
the attributes are displayed as associations.</li>
</ul>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--inheritance <var>STYLE</var></span></kbd></td>
</tr>
<tr><td> </td><td><p class="first">The format that should be used to display inherited methods, variables, and
properties. Currently, three styles are supported. To see an example of each style,
click on it:</p>
<ul class="last simple">
<li><a class="reference external" href="http://epydoc.sourceforge.net/examples/grouped/inh_example.Programmer-class.html">grouped</a>: Inherited objects are gathered into groups, based on which
class they are inherited from.</li>
<li><a class="reference external" href="http://epydoc.sourceforge.net/examples/listed/inh_example.Programmer-class.html">listed</a>: Inherited objects are listed in a short list at the end of the
summary table.</li>
<li><a class="reference external" href="http://epydoc.sourceforge.net/examples/included/inh_example.Programmer-class.html">included</a>: Inherited objects are mixed in with non-inherited objects.</li>
</ul>
</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--config <var>FILE</var></span></kbd></td>
<td>Read the given configuration file, which can contain both options and
Python object names. This option may be used multiple times, if you wish
to use multiple configuration files. See <a class="reference internal" href="#configuration-files">Configuration Files</a> for more
information.</td></tr>
</tbody>
</table>
</div>
<p>The complete list of command line options is available in the <a class="reference internal" href="#command-line-usage">Command Line
Usage</a> section.</p>
</div>
<div class="section" id="examples">
<h3><a class="toc-backref" href="#id30">2.1.2 Examples</a></h3>
<p>The following command will generate HTML documentation for the <tt class="docutils literal"><span class="pre">sys</span></tt> module,
and write it to the directory <tt class="docutils literal"><span class="pre">sys_docs</span></tt>:</p>
<pre class="literal-block">
[epydoc]$ epydoc --html sys -o sys_docs
</pre>
<p>The following commands are used to produce the API documentation for epydoc
itself. The first command writes html output to the directory <tt class="docutils literal"><span class="pre">html/api</span></tt>,
using <tt class="docutils literal"><span class="pre">epydoc</span></tt> as the project name and <tt class="docutils literal"><span class="pre">http://epydoc.sourcforge.net</span></tt> as
the project URL. The <tt class="docutils literal"><span class="pre">white</span></tt> CSS style is used; inheritance is displayed
using the listed style; and all graphs are included in the output. The second
command writes pdf output to the file <tt class="docutils literal"><span class="pre">api.pdf</span></tt> in the directory
<tt class="docutils literal"><span class="pre">latex/api</span></tt>, using <tt class="docutils literal"><span class="pre">Epydoc</span></tt> as the project name.</p>
<pre class="literal-block">
[epydoc]$ epydoc -v -o html/api --name epydoc --css white \
--url http://epydoc.sourceforge.net \
--inheritance listed --graph all src/epydoc
[epydoc]$ epydoc -v -o latex/api --pdf --name "Epydoc" src/epydoc
</pre>
</div>
<div class="section" id="configuration-files">
<h3><a class="toc-backref" href="#id31">2.1.3 Configuration Files</a></h3>
<p>Configuration files, specified using the <tt class="docutils literal"><span class="pre">--config</span></tt> option, may be used to
specify both the list of objects to document, and the options that should be
used to document them. Configuration files are read using the standard
<a class="reference external" href="http://docs.python.org/lib/module-ConfigParser.html">ConfigParser</a> module. The following is a simple example of a configuration
file.</p>
<pre class="literal-block">
<strong>[epydoc]</strong> <em># Epydoc section marker (required by ConfigParser)</em>
<em># Information about the project.</em>
<strong>name: My Cool Project</strong>
<strong>url: http://cool.project/</strong>
<em># The list of modules to document. Modules can be named using</em>
<em># dotted names, module filenames, or package directory names.</em>
<em># This option may be repeated.</em>
<strong>modules: sys, os.path, re</strong>
<strong>modules: my/project/driver.py</strong>
<em># Write html output to the directory "apidocs"</em>
<strong>output: html</strong>
<strong>target: apidocs/</strong>
<em># Include all automatically generated graphs. These graphs are</em>
<em># generated using Graphviz dot.</em>
<strong>graph: all</strong>
<strong>dotpath: /usr/local/bin/dot</strong>
</pre>
<p>A <a class="reference internal" href="#sample-configuration-file">more complete example</a>, including all of the supported options, is also
available.</p>
</div>
</div>
<div class="section" id="the-graphical-interface">
<h2><a class="toc-backref" href="#id32">2.2 The Graphical Interface</a></h2>
<p>Epydoc also includes a graphical interface, for systems where command line
interfaces are not convenient (such as Windows). The graphical interface can
be invoked with the <tt class="docutils literal"><span class="pre">epydocgui</span></tt> command, or with <tt class="docutils literal"><span class="pre">epydoc.pyw</span></tt> in the
<tt class="docutils literal"><span class="pre">Scripts</span></tt> subdirectory of the Python installation directory under Windows.
Currently, the graphical interface can only generate HTML output.</p>
<div align="center" class="align-center"><img alt="epydoc_gui.png" class="align-center" src="epydoc_gui.png" /></div>
<p>Use the <strong>Add</strong> box to specify what objects you wish to document. Objects can
be specified using dotted names (such as <tt class="docutils literal"><span class="pre">os.path</span></tt>), module filenames (such
as <tt class="docutils literal"><span class="pre">epydoc/epytext.py</span></tt>), or package directory names (such as <tt class="docutils literal"><span class="pre">epydoc/</span></tt>).
Packages are expanded to include all sub-modules and sub-packages. Once you
have added all of the modules that you wish to document, press the <strong>Start</strong>
button. Epydoc's progress will be displayed on the progress bar.</p>
<p>To customize the output, click on the <strong>Options</strong> arrow at the bottom of the
window. This opens the options pane, which contains fields corresponding to
each command line option.</p>
<div align="center" class="align-center"><img alt="epydoc_guiconfig.png" class="align-center" src="epydoc_guiconfig.png" /></div>
<p>The epydoc graphical interface can save and load <em>project files</em>, which record
the set of modules and the options that you have selected. Select
<strong>File->Save</strong> to save the current modules and options to a project file; and
<strong>File->Open</strong> to open a previously saved project file. (These project files do
not currently use the same format as the configuration files used by the
command line interface.)</p>
<p>For more information, see the <tt class="docutils literal"><span class="pre">epydocgui(1)</span></tt> man page.</p>
</div>
<div class="section" id="documentation-completeness-checks">
<h2><a class="toc-backref" href="#id33">2.3 Documentation Completeness Checks</a></h2>
<p>The <tt class="docutils literal"><span class="pre">epydoc</span></tt> script can be used to check the completeness of the reference
documentation. In particular, it will check that every module, class, method,
and function has a description; that every parameter has a description and a
type; and that every variable has a type. If the <tt class="docutils literal"><span class="pre">-p</span></tt> option is used, then
these checks are run on both public and private objects; otherwise, the checks
are only run on public objects.</p>
<p><tt class="docutils literal"><span class="pre">epydoc</span></tt> <tt class="docutils literal"><span class="pre">--check</span></tt> [<tt class="docutils literal"><span class="pre">-p</span></tt>] <em>MODULES...</em></p>
<dl class="docutils">
<dt><em>MODULES...</em></dt>
<dd>A list of the modules that should be checked. Modules may be specified
using either filenames (such as <tt class="docutils literal"><span class="pre">epydoc/epytext.py</span></tt>) or module names
(such as <tt class="docutils literal"><span class="pre">os.path</span></tt>). The filename for a package is its <tt class="docutils literal"><span class="pre">__init__.py</span></tt>
file.</dd>
</dl>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-p</span></kbd></td>
<td>Run documentation completeness checks on private objects.</td></tr>
</tbody>
</table>
<p>For each object that fails a check, epydoc will print a warning. For example,
some of the warnings generated when checking the completeness of the
documentation for epydoc's private objects are:</p>
<pre class="literal-block">
epydoc.html.HTML_Doc._dom_link_to_html........No docs
epydoc.html.HTML_Doc._module..................No type
epydoc.html.HTML_Doc._link_to_html.link.......No descr
epydoc.html.HTML_Doc._author.return...........No type
epydoc.html.HTML_Doc._author.authors..........No descr, No type
epydoc.html.HTML_Doc._author.container........No descr, No type
epydoc.html.HTML_Doc._base_tree.uid...........No descr, No type
epydoc.html.HTML_Doc._base_tree.width.........No descr, No type
epydoc.html.HTML_Doc._base_tree.postfix.......No descr, No type
</pre>
<p>If you'd like more fine-grained control over what gets checked, or you would
like to check other fields (such as the author or version), then you should
use the <a class="reference external" href="http://epydoc.sourceforge.net/api/epydoc.checker.DocChecker-class.html"><tt class="docutils literal"><span class="pre">DocChecker</span></tt></a> class directly.</p>
</div>
<div class="section" id="html-files">
<h2><a class="toc-backref" href="#id34">2.4 HTML Files</a></h2>
<p>Every Python module and class is documented in its own file. Index files, tree
files, a help file, and a frames-based table of contents are also created.
The following list describes each of the files generated by epydoc:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">index.html</span></tt></dt>
<dd>The standard entry point for the documentation. Normally, <tt class="docutils literal"><span class="pre">index.html</span></tt>
is a copy of the frames file (<tt class="docutils literal"><span class="pre">frames.html</span></tt>). But if the <tt class="docutils literal"><span class="pre">--no-frames</span></tt>
option is used, then <tt class="docutils literal"><span class="pre">index.html</span></tt> is a copy of the API documentation home
page, which is normally the documentation page for the top-level package or
module (or the trees page if there is no top-level package or module).</dd>
<dt><em>module</em><tt class="docutils literal"><span class="pre">-module.html</span></tt></dt>
<dd>The API documentation for a module. <em>module</em> is the complete dotted name of
the module, such as <cite>sys</cite> or <cite>epydoc.epytext</cite>.</dd>
<dt><em>class</em><tt class="docutils literal"><span class="pre">-class.html</span></tt></dt>
<dd>The API documentation for a class, exception, or type. <em>class</em> is the
complete dotted name of the class, such as <tt class="docutils literal"><span class="pre">epydoc.epytext.Token</span></tt> or
<tt class="docutils literal"><span class="pre">array.ArrayType</span></tt>.</dd>
<dt><em>module</em><tt class="docutils literal"><span class="pre">-pysrc.html</span></tt></dt>
<dd>A page with the module colorized source code, with links back to the
objects main documentation pages. The creation of the colorized source
pages can be controlled using the <a class="reference external" href="CommandLineUsage_">options</a> <tt class="docutils literal"><span class="pre">--show-sourcecode</span></tt> and
<tt class="docutils literal"><span class="pre">--no-sourcecode</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">module-tree.html</span></tt></dt>
<dd>The documented module hierarchy.</dd>
<dt><tt class="docutils literal"><span class="pre">class-tree.html</span></tt></dt>
<dd>The documented classes hierarchy.</dd>
<dt><tt class="docutils literal"><span class="pre">identifier-index.html</span></tt></dt>
<dd>The index of all the identifiers found in the documented items.</dd>
<dt><tt class="docutils literal"><span class="pre">term-index.html</span></tt></dt>
<dd>The index of all the term definition found in the docstrings. Term
definitions are created using the <a class="reference internal" href="#indexed-terms">Indexed Terms</a> markup.</dd>
<dt><tt class="docutils literal"><span class="pre">bug-index.html</span></tt></dt>
<dd>The index of all the known bug in the documented sources. Bugs are marked
using the <tt class="docutils literal"><span class="pre">@bug</span></tt> tag.</dd>
<dt><tt class="docutils literal"><span class="pre">todo-index.html</span></tt></dt>
<dd>The index of all the to-do items in the documented sources. They are
marked using the <tt class="docutils literal"><span class="pre">@todo</span></tt> tag.</dd>
<dt><tt class="docutils literal"><span class="pre">help.html</span></tt></dt>
<dd>The help page for the project. This page explains how to use and navigate
the webpage produced by epydoc.</dd>
<dt><tt class="docutils literal"><span class="pre">epydoc-log.html</span></tt></dt>
<dd>A page with the log of the epydoc execution. It is available clicking on
the timestamp below each page, if the documentation was created using the
<tt class="docutils literal"><span class="pre">--include-log</span></tt> option. The page also contains the list of the options
enabled when the documentation was created.</dd>
<dt><tt class="docutils literal"><span class="pre">api-objects.txt</span></tt></dt>
<dd>A text file containing each available item and the URL where it is
documented. Each item takes a file line and it is separated by the URL by
a <tt class="docutils literal"><span class="pre">tab</span></tt> charecter. Such file can be used to create <a class="reference internal" href="#external-api-links">external API links</a>.</dd>
<dt><tt class="docutils literal"><span class="pre">redirect.html</span></tt></dt>
<dd>A page containing Javascript code that redirect the browser to the
documentation page indicated by the accessed fragment. For example
opening the page <tt class="docutils literal"><span class="pre">redirect.html#epydoc.apidoc.DottedName</span></tt> the browser
will be redirected to the page <tt class="docutils literal"><span class="pre">epydoc.apidoc.DottedName-class.html</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">frames.html</span></tt></dt>
<dd>The main frames file. Two frames on the left side of the window contain a
table of contents, and the main frame on the right side of the window
contains API documentation pages.</dd>
<dt><tt class="docutils literal"><span class="pre">toc.html</span></tt></dt>
<dd>The top-level table of contents page. This page is displayed in the
upper-left frame of frames.html, and provides links to the
<tt class="docutils literal"><span class="pre">toc-everything.html</span></tt> and <tt class="docutils literal"><span class="pre">toc-module-module.html</span></tt> pages.</dd>
<dt><tt class="docutils literal"><span class="pre">toc-everything.html</span></tt></dt>
<dd>The table of contents for the entire project. This page is displayed in
the lower-left frame of frames.html, and provides links to every class,
type, exception, function, and variable defined by the project.</dd>
<dt><tt class="docutils literal"><span class="pre">toc-</span></tt><em>module</em><tt class="docutils literal"><span class="pre">-module.html</span></tt></dt>
<dd>The table of contents for a module. This page is displayed in the
lower-left frame of frames.html, and provides links to every class, type,
exception, function, and variable defined by the module. module is the
complete dotted name of the module, such as <tt class="docutils literal"><span class="pre">sys</span></tt> or <tt class="docutils literal"><span class="pre">epydoc.epytext</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">epydoc.css</span></tt></dt>
<dd>The CSS stylesheet used to display all HTML pages.</dd>
</dl>
</div>
<div class="section" id="css-stylesheets">
<h2><a class="toc-backref" href="#id35">2.5 CSS Stylesheets</a></h2>
<p>Epydoc creates a CSS stylesheet (<tt class="docutils literal"><span class="pre">epydoc.css</span></tt>) when it builds the API
documentation for a project. You can specify which stylesheet should be used
using the <tt class="docutils literal"><span class="pre">--css</span></tt> command-line option. If you do not specify a stylesheet,
and one is already present, epydoc will use that stylesheet; otherwise, it will
use the default stylesheet.</p>
</div>
</div>
<div class="section" id="python-docstrings">
<h1><a class="toc-backref" href="#id36">3 Python Docstrings</a></h1>
<!-- $Id: manual-docstring.txt 1575 2007-03-08 21:28:07Z edloper $ -->
<p>Python documentation strings (or <em>docstrings</em>) provide a convenient way of
associating documentation with Python modules, functions, classes, and methods.
An object's docsting is defined by including a string constant as the first
statement in the object's definition. For example, the following function
defines a docstring:</p>
<pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">x_intercept</span>(m, b):
<span class="py-string">"""</span>
<span class="py-string"> Return the x intercept of the line y=m*x+b. The x intercept of a</span>
<span class="py-string"> line is the point at which it crosses the x axis (y=0).</span>
<span class="py-string"> """</span>
return -b/m</pre>
<p>Docstrings can be accessed from the interpreter and from Python programs
using the "<tt class="docutils literal"><span class="pre">__doc__</span></tt>" attribute:</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">print</span> x_intercept.__doc__
Return the x intercept of the line y=m*x+b. The x intercept of a
line <span class="py-keyword">is</span> the point at which it crosses the x axis (y=0).</pre>
<p>The <a class="reference external" href="http://web.lfw.org/python/pydoc.html">pydoc</a> module, which became part of <a class="reference external" href="http://www.python.org/doc/current/lib/module-pydoc.html">the standard library</a> in Python 2.1,
can be used to display information about a Python object, including its
docstring:</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">from</span> pydoc <span class="py-keyword">import</span> help
<span class="py-prompt">>>> </span>help(x_intercept)
Help on function x_intercept <span class="py-keyword">in</span> module __main__:
x_intercept(m, b)
Return the x intercept of the line y=m*x+b. The x intercept of a
line <span class="py-keyword">is</span> the point at which it crosses the x axis (y=0).</pre>
<p>For more information about Python docstrings, see the <a class="reference external" href="http://www.python.org/doc/current/tut/node6.html#docstrings">Python Tutorial</a> or
the O'Reilly Network article <a class="reference external" href="http://www.onlamp.com/lpt/a/python/2001/05/17/docstrings.html">Python Documentation Tips and Tricks</a>.</p>
<div class="section" id="variable-docstrings">
<h2><a class="toc-backref" href="#id37">3.1 Variable docstrings</a></h2>
<!-- [xx] this should be somewhere else, i guess... -->
<p>Python don't support directly docstrings on variables: there is no attribute
that can be attached to variables and retrieved interactively like the
<tt class="docutils literal"><span class="pre">__doc__</span></tt> attribute on modules, classes and functions.</p>
<p>While the language doesn't directly provides for them, Epydoc supports
<em>variable docstrings</em>: if a variable assignment statement is immediately
followed by a bare string literal, then that assignment is treated as a
docstring for that variable. In classes, variable assignments at the class
definition level are considered class variables; and assignments to instance
variables in the constructor (<tt class="docutils literal"><span class="pre">__init__</span></tt>) are considered instance variables:</p>
<pre class="py-doctest">
<span class="py-keyword">class</span> <span class="py-defname">A</span>:
x = 22
<span class="py-string">"""Docstring for class variable A.x"""</span>
<span class="py-keyword">def</span> <span class="py-defname">__init__</span>(self, a):
self.y = a
<span class="py-string">""</span>"Docstring <span class="py-keyword">for</span> instance variable A.y</pre>
<p>Variables may also be documented using <em>comment docstrings</em>. If a variable
assignment is immediately preceeded by a comment whose lines begin with the
special marker '<tt class="docutils literal"><span class="pre">#:</span></tt>', or is followed on the same line by such a comment,
then it is treated as a docstring for that variable:</p>
<pre class="py-doctest">
<span class="py-comment">#: docstring for x</span>
x = 22
x = 22 <span class="py-comment">#: docstring for x</span></pre>
<p>Notice that variable docstrings are only available for documentation when the
source code is available for <em>parsing</em>: it is not possible to retrieve variable</p>
</div>
<div class="section" id="items-visibility">
<h2><a class="toc-backref" href="#id38">3.2 Items visibility</a></h2>
<p>Any Python object (modules, classes, functions, variables...) can be <em>public</em>
or <em>private</em>. Usually the object name decides the object visibility: objects
whose name starts with an underscore and doesn't end with an underscore are
considered private. All the other objects (including the "magic functions" such
as <tt class="docutils literal"><span class="pre">__add__</span></tt>) are public.</p>
<p>For each module and class, Epydoc generates pages with both public and private
methods. A Javascript snippet allows you to toggle the visibility of private
objects.</p>
<p>If a module wants to hide some of the objects it contains (either defined in
the module itself or imported from other modules), it can explicitly list the
names if its <a class="reference external" href="http://www.python.org/doc/2.4.3/ref/import.html">public names</a> in the <tt class="docutils literal"><span class="pre">__all__</span></tt> variable.</p>
<p>If a module defines the <tt class="docutils literal"><span class="pre">__all__</span></tt> variable, Epydoc uses its content to decide
if the module objects are public or private.</p>
</div>
</div>
<div class="section" id="the-epytext-markup-language">
<h1><a class="toc-backref" href="#id39">4 The Epytext Markup Language</a></h1>
<!-- $Id: manual-epytext.txt 1547 2007-02-21 17:34:54Z dvarrazzo $ -->
<div class="section" id="a-brief-introduction">
<h2><a class="toc-backref" href="#id40">4.1 A Brief Introduction</a></h2>
<p>Epytext is a simple lightweight markup language that lets you add formatting
and structue to docstrings. Epydoc uses that formatting and structure to
produce nicely formatted API documentation. The following example (which has
an unusually high ratio of documentaiton to code) illustrates some of the
basic features of epytext:</p>
<pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">x_intercept</span>(m, b):
<span class="py-string">"""</span>
<span class="py-string"> Return the x intercept of the line M{y=m*x+b}. The X{x intercept}</span>
<span class="py-string"> of a line is the point at which it crosses the x axis (M{y=0}).</span>
<span class="py-string"> This function can be used in conjuction with L{z_transform} to</span>
<span class="py-string"> find an arbitrary function's zeros.</span>
<span class="py-string"> @type m: number</span>
<span class="py-string"> @param m: The slope of the line.</span>
<span class="py-string"> @type b: number</span>
<span class="py-string"> @param b: The y intercept of the line. The X{y intercept} of a</span>
<span class="py-string"> line is the point at which it crosses the y axis (M{x=0}).</span>
<span class="py-string"> @rtype: number</span>
<span class="py-string"> @return: the x intercept of the line M{y=m*x+b}.</span>
<span class="py-string"> """</span>
return -b/m</pre>
<p>You can compare this function definition with the <a class="reference external" href="http://epydoc.sourceforge.net/examples/epytext_example-module.html#x_intercept">API documentation</a>
generated by epydoc. Note that:</p>
<ul class="simple">
<li>Paragraphs are separated by blank lines.</li>
<li>Inline markup has the form "<em>x</em><tt class="docutils literal"><span class="pre">{</span></tt>...<tt class="docutils literal"><span class="pre">}</span></tt>", where "<em>x</em>" is a
single capital letter. This example uses inline markup to mark mathematical
expressions ("<tt class="docutils literal"><span class="pre">M{...}</span></tt>"); terms that should be indexed ("<tt class="docutils literal"><span class="pre">X{...}</span></tt>");
and links to the documentation of other objects ("<tt class="docutils literal"><span class="pre">L{...}</span></tt>").</li>
<li>Descriptions of parameters, return values, and types are marked with
"<tt class="docutils literal"><span class="pre">@</span></tt><em>field</em><tt class="docutils literal"><span class="pre">:</span></tt>" or "<tt class="docutils literal"><span class="pre">@</span></tt><em>field arg</em><tt class="docutils literal"><span class="pre">:</span></tt>", where "<em>field</em>"
identifies the kind of description, and "<em>arg</em>" specifies what object is
described.</li>
</ul>
<p>Epytext is intentionally very lightweight. If you wish to use a more
expressive markup language, I recommend <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>.</p>
</div>
<div class="section" id="epytext-language-overview">
<h2><a class="toc-backref" href="#id41">4.2 Epytext Language Overview</a></h2>
<p>Epytext is a lightweight markup language for Python docstrings. The epytext
markup language is used by epydoc to parse docstrings and create structured API
documentation. Epytext markup is broken up into the following categories:</p>
<ul>
<li><p class="first"><strong>Block Structure</strong> divides the docstring into nested blocks of text, such
as <em>paragraphs</em> and <em>lists</em>.</p>
<blockquote>
<p>o <strong>Basic Blocks</strong> are the basic unit of block structure.</p>
<p>o <strong>Hierarchical blocks</strong> represent the nesting structure of the docstring.</p>
</blockquote>
</li>
<li><p class="first"><strong>Inline Markup</strong> marks regions of text within a basic block with properties,
such as italics and hyperlinks.</p>
</li>
</ul>
</div>
<div class="section" id="block-structure">
<h2><a class="toc-backref" href="#id42">4.3 Block Structure</a></h2>
<p>Block structure is encoded using indentation, blank lines, and a handful of
special character sequences.</p>
<ul class="simple">
<li>Indentation is used to encode the nesting structure of hierarchical blocks.
The indentation of a line is defined as the number of leading spaces on that
line; and the indentation of a block is typically the indentation of its
first line.</li>
<li>Blank lines are used to separate blocks. A blank line is a line that only
contains whitespace.</li>
<li>Special character sequences are used to mark the beginnings of some blocks.
For example, '<tt class="docutils literal"><span class="pre">-</span></tt>' is used as a bullet for unordered list items, and
'<tt class="docutils literal"><span class="pre">>>></span></tt>' is used to mark <a class="reference internal" href="#doctest-blocks">doctest blocks</a>.</li>
</ul>
<p>The following sections describe how to use each type of block structure.</p>
<div class="section" id="paragraphs">
<h3><a class="toc-backref" href="#id43">4.3.1 Paragraphs</a></h3>
<p>A paragraph is the simplest type of basic block. It consists of one or more
lines of text. Paragraphs must be left justified (i.e., every line must have
the same indentation). The following example illustrates how paragraphs can be
used:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> This is a paragraph. Paragraphs can</span>
<span class="py-string"> span multiple lines, and can contain</span>
<span class="py-string"> I{inline markup}.</span>
<span class="py-string"> This is another paragraph. Paragraphs</span>
<span class="py-string"> are separated by blank lines.</span>
<span class="py-string"> """</span>
*[...]*</pre>
</td>
<td><p class="first">This is a paragraph. Paragraphs can span multiple lines,
and contain <em>inline markup</em>.</p>
<p class="last">This is another paragraph. Paragraphs are separated from each
other by blank lines.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="lists">
<h3><a class="toc-backref" href="#id44">4.3.2 Lists</a></h3>
<p>Epytext supports both ordered and unordered lists. A list consists of one or
more consecutive <em>list items</em> of the same type (ordered or unordered), with the
same indentation. Each list item is marked by a <em>bullet</em>. The bullet for
unordered list items is a single dash character (<tt class="docutils literal"><span class="pre">-</span></tt>). Bullets for ordered
list items consist of a series of numbers followed by periods, such as
<tt class="docutils literal"><span class="pre">12.</span></tt> or <tt class="docutils literal"><span class="pre">1.2.8.</span></tt>.</p>
<p>List items typically consist of a bullet followed by a space and a single
paragraph. The paragraph may be indented more than the list item's bullet;
often, the paragraph is intended two or three characters, so that its left
margin lines up with the right side of the bullet. The following example
illustrates a simple ordered list.</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> 1. This is an ordered list item.</span>
<span class="py-string"> 2. This is a another ordered list</span>
<span class="py-string"> item.</span>
<span class="py-string"> 3. This is a third list item. Note that</span>
<span class="py-string"> the paragraph may be indented more</span>
<span class="py-string"> than the bullet.</span>
<span class="py-string"> """</span>
*[...]*</pre>
</td>
<td><ol class="first last arabic simple">
<li>This is an ordered list item.</li>
<li>This is another ordered list item.</li>
<li>This is a third list item. Note that the paragraph may be
indented more than the bullet.</li>
</ol>
</td>
</tr>
</tbody>
</table>
<p>List items can contain more than one paragraph; and they can also contain
sublists, <cite>literal blocks</cite>, and <cite>doctest blocks</cite>. All of the blocks contained
by a list item must all have equal indentation, and that indentation must be
greater than or equal to the indentation of the list item's bullet. If the
first contained block is a paragraph, it may appear on the same line as the
bullet, separated from the bullet by one or more spaces, as shown in the
previous example. All other block types must follow on separate lines.</p>
<p>Every list must be separated from surrounding blocks by indentation:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> This is a paragraph.</span>
<span class="py-string"> 1. This is a list item.</span>
<span class="py-string"> 2. This a second list</span>
<span class="py-string"> item.</span>
<span class="py-string"> - This is a sublist</span>
<span class="py-string"> """</span>
[...]</pre>
</td>
<td><p class="first">This is a paragraph.</p>
<ol class="last arabic simple">
<li>This is a list item.</li>
<li>This is a second list item.<ul>
<li>This is a sublist.</li>
</ul>
</li>
</ol>
</td>
</tr>
</tbody>
</table>
<p>Note that sublists must be separated from the blocks in their parent list
item by indentation. In particular, the following docstring generates an error,
since the sublist is not separated from the paragraph in its parent list item
by indentation:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> 1. This is a list item. Its</span>
<span class="py-string"> paragraph is indented 7 spaces.</span>
<span class="py-string"> - This is a sublist. It is</span>
<span class="py-string"> indented 7 spaces.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><strong>L5: Error: Lists must be indented.</strong></td>
</tr>
</tbody>
</table>
<p>The following example illustrates how lists can be used:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> This is a paragraph.</span>
<span class="py-string"> 1. This is a list item.</span>
<span class="py-string"> - This is a sublist.</span>
<span class="py-string"> - The sublist contains two</span>
<span class="py-string"> items.</span>
<span class="py-string"> - The second item of the</span>
<span class="py-string"> sublist has its own sublist.</span>
<span class="py-string"> 2. This list item contains two</span>
<span class="py-string"> paragraphs and a doctest block.</span>
<span class="py-string"> >>> print 'This is a doctest block'</span>
<span class="py-string"> This is a doctest block</span>
<span class="py-string"> This is the second paragraph.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><p class="first">This is a paragraph.</p>
<ol class="last arabic">
<li><p class="first">This is a list item.</p>
<ul class="simple">
<li>This is a sublist.</li>
<li>The sublist contains two items.<ul>
<li>The second item of the sublist has its own own sublist.</li>
</ul>
</li>
</ul>
</li>
<li><p class="first">This list item contains two paragraphs and a doctest block.</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">print</span> <span class="py-string">'This is a doctest block'</span>
<span class="py-output">This is a doctest block</span></pre>
<p>This is the second paragraph.</p>
</li>
</ol>
</td>
</tr>
</tbody>
</table>
<p>Epytext will treat any line that begins with a bullet as a list item. If you
want to include bullet-like text in a paragraph, then you must either ensure
that it is not at the beginning of the line, or use <a class="reference internal" href="#escaping">escaping</a> to prevent
epytext from treating it as markup:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> This sentence ends with the number</span>
<span class="py-string"> 1. Epytext can't tell if the "1."</span>
<span class="py-string"> is a bullet or part of the paragraph,</span>
<span class="py-string"> so it generates an error.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><strong>L4: Error: Lists must be indented.</strong></td>
</tr>
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> This sentence ends with the number 1.</span>
<span class="py-string"> This sentence ends with the number</span>
<span class="py-string"> E{1}.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><p class="first">This sentence ends with the number 1.</p>
<p class="last">This sentence ends with the number 1.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="sections">
<h3><a class="toc-backref" href="#id45">4.3.3 Sections</a></h3>
<p>A section consists of a heading followed by one or more child blocks.</p>
<ul class="simple">
<li>The heading is a single underlined line of text. Top-level section headings
are underlined with the '<tt class="docutils literal"><span class="pre">=</span></tt>' character; subsection headings are
underlined with the '<tt class="docutils literal"><span class="pre">-</span></tt>' character; and subsubsection headings are
underlined with the '<tt class="docutils literal"><span class="pre">~</span></tt>' character. The length of the underline must
exactly match the length of the heading.</li>
<li>The child blocks can be paragraphs, lists, literal blocks, doctest blocks,
or sections. Each child must have equal indentation, and that indentation
must be greater than or equal to the heading's indentation.</li>
</ul>
<p>The following example illustrates how sections can be used:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> This paragraph is not in any section.</span>
<span class="py-string"> Section 1</span>
<span class="py-string"> =========</span>
<span class="py-string"> This is a paragraph in section 1.</span>
<span class="py-string"> Section 1.1</span>
<span class="py-string"> -----------</span>
<span class="py-string"> This is a paragraph in section 1.1.</span>
<span class="py-string"> Section 2</span>
<span class="py-string"> =========</span>
<span class="py-string"> This is a paragraph in section 2.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><p class="h1 first">Section 1</p>
<p>This is a paragraph in section 1.</p>
<p class="h2">Section 1.1</p>
<p>This is a paragraph in section 1.1.</p>
<p class="h1">Section 2</p>
<p class="last">This is a paragraph in section 2.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="literal-blocks">
<h3><a class="toc-backref" href="#id46">4.3.4 Literal Blocks</a></h3>
<p>Literal blocks are used to represent "preformatted" text. Everything within a
literal block should be displayed exactly as it appears in plaintext. In
particular:</p>
<ul class="simple">
<li>Spaces and newlines are preserved.</li>
<li>Text is shown in a monospaced font.</li>
<li>Inline markup is not detected.</li>
</ul>
<p>Literal blocks are introduced by paragraphs ending in the special sequence
"<tt class="docutils literal"><span class="pre">::</span></tt>". Literal blocks end at the first line whose indentation is equal to
or less than that of the paragraph that introduces them. The following example
shows how literal blocks can be used:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> The following is a literal block::</span>
<span class="py-string"> Literal /</span>
<span class="py-string"> / Block</span>
<span class="py-string"> This is a paragraph following the</span>
<span class="py-string"> literal block.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><p class="first">The following is a literal block:</p>
<pre class="literal-block">
Literal /
/ Block
</pre>
<p class="last">This is a paragraph following the literal block.</p>
</td>
</tr>
</tbody>
</table>
<p>Literal blocks are indented relative to the paragraphs that introduce them;
for example, in the previous example, the word "Literal" is displayed with four
leading spaces, not eight. Also, note that the double colon ("<tt class="docutils literal"><span class="pre">::</span></tt>") that
introduces the literal block is rendered as a single colon.</p>
</div>
<div class="section" id="doctest-blocks">
<h3><a class="toc-backref" href="#id47">4.3.5 Doctest Blocks</a></h3>
<p>Doctest blocks contain examples consisting of Python expressions and their
output. Doctest blocks can be used by the doctest module to test the
documented object. Doctest blocks begin with the special sequence
"<tt class="docutils literal"><span class="pre">>>></span></tt>". Doctest blocks are delimited from surrounding blocks by blank lines.
Doctest blocks may not contain blank lines. The following example shows how
doctest blocks can be used:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> The following is a doctest block:</span>
<span class="py-string"> >>> print (1+3,</span>
<span class="py-more"> </span><span class="py-string"> ... 3+5)</span>
<span class="py-string"> (4, 8)</span>
<span class="py-string"> >>> 'a-b-c-d-e'.split('-')</span>
<span class="py-string"> ['a', 'b', 'c', 'd', 'e']</span>
<span class="py-string"> This is a paragraph following the</span>
<span class="py-string"> doctest block.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><p class="first">The following is a doctest block:</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">print</span> (1+3,
<span class="py-more">... </span> 3+5)
<span class="py-output">(4, 8)</span>
<span class="py-output"></span><span class="py-prompt">>>> </span><span class="py-string">'a-b-c-d-e'</span>.split(<span class="py-string">'-'</span>)
<span class="py-output">['a', 'b', 'c', 'd', 'e']</span></pre>
<p class="last">This is a paragraph following the doctest block.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="fields">
<h3><a class="toc-backref" href="#id48">4.3.6 Fields</a></h3>
<p>Fields are used to describe specific properties of a documented object. For
example, fields can be used to define the parameters and return value of a
function; the instance variables of a class; and the author of a module. Each
field is marked by a <em>field tag</em>, which consist of an at sign ('<tt class="docutils literal"><span class="pre">@</span></tt>')
followed by a <em>field name</em>, optionally followed by a space and a <em>field
argument</em>, followed by a colon ('<tt class="docutils literal"><span class="pre">:</span></tt>'). For example, '<tt class="docutils literal"><span class="pre">@return:</span></tt>' and
'<tt class="docutils literal"><span class="pre">@param</span> <span class="pre">x:</span></tt>' are field tags.</p>
<p>Fields can contain paragraphs, lists, literal blocks, and doctest blocks.
All of the blocks contained by a field must all have equal indentation, and
that indentation must be greater than or equal to the indentation of the
field's tag. If the first contained block is a paragraph, it may appear on the
same line as the field tag, separated from the field tag by one or more spaces.
All other block types must follow on separate lines.</p>
<p>Fields must be placed at the end of the docstring, after the description of
the object. Fields may be included in any order.</p>
<p>Fields do not need to be separated from other blocks by a blank line. Any line
that begins with a field tag followed by a space or newline is considered a
field.</p>
<p>The following example illustrates how fields can be used:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> @param x: This is a description of</span>
<span class="py-string"> the parameter x to a function.</span>
<span class="py-string"> Note that the description is</span>
<span class="py-string"> indented four spaces.</span>
<span class="py-string"> @type x: This is a description of</span>
<span class="py-string"> x's type.</span>
<span class="py-string"> @return: This is a description of</span>
<span class="py-string"> the function's return value.</span>
<span class="py-string"> It contains two paragraphs.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><dl class="first last docutils">
<dt><strong>Parameters:</strong></dt>
<dd><p class="first"><strong>x</strong> - This is a description of the parameter x to a function.
Note that the description is indented four spaces.</p>
<blockquote class="last">
<em>(type=This is a description of x's type.)</em></blockquote>
</dd>
<dt><strong>Returns:</strong></dt>
<dd><p class="first">This is a description of the function's return value.</p>
<p class="last">It contains two paragraphs.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p>For a list of the fields that are supported by epydoc, see the <cite>epydoc fields</cite>
chapter.</p>
</div>
</div>
<div class="section" id="inline-markup">
<h2><a class="toc-backref" href="#id49">4.4 Inline Markup</a></h2>
<p>Inline markup has the form '<tt class="docutils literal"><span class="pre">x{...}</span></tt>', where <tt class="docutils literal"><span class="pre">x</span></tt> is a single capital letter
that specifies how the text between the braces should be rendered. Inline
markup is recognized within paragraphs and section headings. It is <em>not</em>
recognized within literal and doctest blocks. Inline markup can contain
multiple words, and can span multiple lines. Inline markup may be nested.</p>
<p>A matching pair of curly braces is only interpreted as inline markup if the
left brace is immediately preceeded by a capital letter. So in most cases, you
can use curly braces in your text without any form of escaping. However, you do
need to escape curly braces when:</p>
<ol class="arabic simple">
<li>You want to include a single (un-matched) curly brace.</li>
<li>You want to preceed a matched pair of curly braces with a capital letter.</li>
</ol>
<p>Note that there is no valid Python expression where a pair of matched curly
braces is immediately preceeded by a capital letter (except within string
literals). In particular, you never need to escape braces when writing Python
dictionaries. See also <a class="reference internal" href="#escaping">escaping</a>.</p>
<div class="section" id="basic-inline-markup">
<h3><a class="toc-backref" href="#id50">4.4.1 Basic Inline Markup</a></h3>
<blockquote>
Epytext defines four types of inline markup that specify how text should be
displayed:</blockquote>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">I{...}</span></tt>: Italicized text.</li>
<li><tt class="docutils literal"><span class="pre">B{...}</span></tt>: Bold-faced text.</li>
<li><tt class="docutils literal"><span class="pre">C{...}</span></tt>: Source code or a Python identifier.</li>
<li><tt class="docutils literal"><span class="pre">M{...}</span></tt>: A mathematical expression.</li>
</ul>
<p>By default, source code is rendered in a fixed width font; and mathematical
expressions are rendered in italics. But those defaults may be changed by
modifying the CSS stylesheet. The following example illustrates how the four
basic markup types can be used:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> I{B{Inline markup} may be nested; and</span>
<span class="py-string"> it may span} multiple lines.</span>
<span class="py-string"> - I{Italicized text}</span>
<span class="py-string"> - B{Bold-faced text}</span>
<span class="py-string"> - C{Source code}</span>
<span class="py-string"> - M{Math}</span>
<span class="py-string"> Without the capital letter, matching</span>
<span class="py-string"> braces are not interpreted as markup:</span>
<span class="py-string"> C{my_dict={1:2, 3:4}}.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><p class="first"><strong>Inline markup</strong> <em>may be nested</em>; and it may span multiple lines.</p>
<ul class="simple">
<li><em>Italicized text</em></li>
<li><strong>Bold-faced text</strong></li>
<li><tt class="docutils literal"><span class="pre">Source</span> <span class="pre">code</span></tt></li>
<li>Math: <em>m*x+b</em></li>
</ul>
<p class="last">Without the capital letter, matching braces are not interpreted as
markup: <tt class="docutils literal"><span class="pre">my_dict={1:2,</span> <span class="pre">3:4}</span></tt>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="urls">
<h3><a class="toc-backref" href="#id51">4.4.2 URLs</a></h3>
<p>The inline markup construct <tt class="docutils literal"><span class="pre">U{</span></tt><em>text<url></em><tt class="docutils literal"><span class="pre">}</span></tt> is used to create links
to external URLs and URIs. '<em>text</em>' is the text that should be displayed for
the link, and '<em>url</em>' is the target of the link. If you wish to use the URL as
the text for the link, you can simply write "<tt class="docutils literal"><span class="pre">U{</span></tt><em>url</em><tt class="docutils literal"><span class="pre">}</span></tt>". Whitespace
within URL targets is ignored. In particular, URL targets may be split over
multiple lines. The following example illustrates how URLs can be used:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> - U{www.python.org}</span>
<span class="py-string"> - U{http://www.python.org}</span>
<span class="py-string"> - U{The epydoc homepage<http://</span>
<span class="py-string"> epydoc.sourceforge.net>}</span>
<span class="py-string"> - U{The B{Python} homepage</span>
<span class="py-string"> <www.python.org>}</span>
<span class="py-string"> - U{Edward Loper<mailto:edloper@</span>
<span class="py-string"> gradient.cis.upenn.edu>}</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><ul class="first last simple">
<li><a class="reference external" href="http://www.python.org">www.python.org</a></li>
<li><a class="reference external" href="http://www.python.org">http://www.python.org</a></li>
<li><a class="reference external" href="http://epydoc.sourceforge.net">The epydoc homepage</a></li>
<li><a class="reference external" href="http://www.python.org">The <strong>Python</strong> homepage</a></li>
<li><a class="reference external" href="mailto:edloper@gradient.cis.upenn.edu">Edward Loper</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="documentation-crossreference-links">
<h3><a class="toc-backref" href="#id52">4.4.3 Documentation Crossreference Links</a></h3>
<p>The inline markup construct '<tt class="docutils literal"><span class="pre">L{</span></tt><em>text<object></em><tt class="docutils literal"><span class="pre">}</span></tt>' is used to create
links to the documentation for other Python objects. '<em>text</em>' is the text that
should be displayed for the link, and '<em>object</em>' is the name of the Python
object that should be linked to. If you wish to use the name of the Python
object as the text for the link, you can simply write <tt class="docutils literal"><span class="pre">L{</span></tt><em>object</em>}``.
Whitespace within object names is ignored. In particular, object names may be
split over multiple lines. The following example illustrates how documentation
crossreference links can be used:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> - L{x_transform}</span>
<span class="py-string"> - L{search<re.search>}</span>
<span class="py-string"> - L{The I{x-transform} function</span>
<span class="py-string"> <x_transform>}</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><ul class="first last simple">
<li><a class="reference external" href="http://www.example.com">x_transform</a></li>
<li><a class="reference external" href="http://www.example.com">search</a></li>
<li><a class="reference external" href="http://www.example.com">The x-transform function</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>In order to find the object that corresponds to a given name, epydoc checks the
following locations, in order:</p>
<ol class="arabic simple">
<li>If the link is made from a class or method docstring, then epydoc checks for
a method, instance variable, or class variable with the given name.</li>
<li>Next, epydoc looks for an object with the given name in the current module.</li>
<li>Epydoc then tries to import the given name as a module. If the current
module is contained in a package, then epydoc will also try importing the
given name from all packages containing the current module.</li>
<li>Epydoc then tries to divide the given name into a module name and an
object name, and to import the object from the module. If the current module
is contained in a package, then epydoc will also try importing the module
name from all packages containing the current module.</li>
<li>Finally, epydoc looks for a class name in any module with the given name.
This is only returned if there is a single class with such name.</li>
</ol>
<p>If no object is found that corresponds with the given name, then epydoc
issues a warning.</p>
</div>
<div class="section" id="indexed-terms">
<h3><a class="toc-backref" href="#id53">4.4.4 Indexed Terms</a></h3>
<p>Epydoc automatically creates an index of term definitions for the API
documentation. The inline markup construct '<tt class="docutils literal"><span class="pre">X{...}</span></tt>' is used to mark terms
for inclusion in the index. The term itself will be italicized; and a link will
be created from the index page to the location of the term in the text. The
following example illustrates how index terms can be used:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> An X{index term} is a term that</span>
<span class="py-string"> should be included in the index.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><p class="first">An <em>index term</em> is a term that should be included in the index.</p>
<blockquote class="last">
<table border="1" class="docutils">
<colgroup>
<col width="46%" />
<col width="54%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head" colspan="2">Index</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>index term</td>
<td><em>example</em></td>
</tr>
<tr><td>x intercept</td>
<td><em>x_intercept</em></td>
</tr>
<tr><td>y intercept</td>
<td><em>x_intercept</em></td>
</tr>
</tbody>
</table>
</blockquote>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="symbols">
<h3><a class="toc-backref" href="#id54">4.4.5 Symbols</a></h3>
<p>Symbols are used to insert special characters in your documentation. A symbol
has the form '<tt class="docutils literal"><span class="pre">S{code}</span></tt>', where code is a symbol code that specifies what
character should be produced. The following example illustrates how symbols can
be used to generate special characters:</p>
<!-- This data file has been placed in the public domain. -->
<!-- Derived from the Unicode character mappings available from
<http://www.w3.org/2003/entities/xml/>.
Processed by unicode2rstsubs.py, part of Docutils:
<http://docutils.sourceforge.net>. -->
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> Symbols can be used in equations:</span>
<span class="py-string"> - S{sum}S{alpha}/x S{<=} S{beta}</span>
<span class="py-string"> S{<-} and S{larr} both give left</span>
<span class="py-string"> arrows. Some other arrows are</span>
<span class="py-string"> S{rarr}, S{uarr}, and S{darr}.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><p class="first">Symbols can be used in equations:</p>
<ul class="simple">
<li>∑ α/<em>x</em> ≤ β</li>
</ul>
<p class="last">← and ← both give left
arrows. Some other arrows are
→, ↑, and ↓.</p>
</td>
</tr>
</tbody>
</table>
<p>Although symbols can be quite useful, you should keep in mind that they can
make it harder to read your docstring in plaintext. In general, symbols should
be used sparingly. For a complete list of the symbols that are currently
supported, see the reference documentation for <a class="reference external" href="http://epydoc.sourceforge.net/api/epydoc.markup.epytext-module.html#SYMBOLS"><tt class="docutils literal"><span class="pre">epytext.SYMBOLS</span></tt></a>.</p>
</div>
<div class="section" id="escaping">
<h3><a class="toc-backref" href="#id55">4.4.6 Escaping</a></h3>
<p>Escaping is used to write text that would otherwise be interpreted as epytext
markup. Epytext was carefully constructed to minimize the need for this type
of escaping; but sometimes, it is unavoidable. Escaped text has the form
'<tt class="docutils literal"><span class="pre">E{</span></tt><em>code</em><tt class="docutils literal"><span class="pre">}</span></tt>', where code is an escape code that specifies what
character should be produced. If the escape code is a single character (other
than '<tt class="docutils literal"><span class="pre">{</span></tt>' or '<tt class="docutils literal"><span class="pre">}</span></tt>'), then that character is produced. For example, to
begin a paragraph with a dash (which would normally signal a list item), write
'<tt class="docutils literal"><span class="pre">E{-}</span></tt>'. In addition, two special escape codes are defined: '<tt class="docutils literal"><span class="pre">E{lb}</span></tt>'
produces a left curly brace ('<tt class="docutils literal"><span class="pre">{</span></tt>'); and '<tt class="docutils literal"><span class="pre">E{rb}</span></tt>' produces a right curly
brace ('<tt class="docutils literal"><span class="pre">}</span></tt>'). The following example illustrates how escaping can be used:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> This paragraph ends with two</span>
<span class="py-string"> colons, but does not introduce</span>
<span class="py-string"> a literal blockE{:}E{:}</span>
<span class="py-string"> E{-} This is not a list item.</span>
<span class="py-string"> Escapes can be used to write</span>
<span class="py-string"> unmatched curly braces:</span>
<span class="py-string"> E{rb}E{lb}</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><p class="first">This paragraph ends with two colons, but does not introduce a literal
block::</p>
<p>- This is not a list item.</p>
<p class="last">Escapes can be used to write unmatched curly braces: }{</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="graphs">
<h3><a class="toc-backref" href="#id56">4.4.7 Graphs</a></h3>
<p>The inline markup construct '<tt class="docutils literal"><span class="pre">G{</span></tt><em>graphtype args...</em><tt class="docutils literal"><span class="pre">}</span></tt>' is used to
insert automatically generated graphs. The following graphs generation
constructions are currently defines:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Markup</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><tt class="docutils literal"><span class="pre">G{classtree</span></tt> <em>classes...</em><tt class="docutils literal"><span class="pre">}</span></tt></td>
<td>Display a class hierarchy for the given
class or classes (including all
superclasses & subclasses). If no class
is specified, and the directive is used
in a class's docstring, then that
class's class hierarchy will be
displayed.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">G{packagetree</span></tt> <em>modules...</em><tt class="docutils literal"><span class="pre">}</span></tt></td>
<td>Display a package hierarchy for the
given module or modules (including all
subpackages and submodules). If no
module is specified, and the directive
is used in a module's docstring, then
that module's package hierarchy will be
displayed.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">G{importgraph</span></tt> <em>modules...</em><tt class="docutils literal"><span class="pre">}</span></tt></td>
<td>Display an import graph for the given
module or modules. If no module is
specified, and the directive is used in
a module's docstring, then that
module's import graph will be
displayed.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">G{callgraph</span></tt> <em>functions...</em><tt class="docutils literal"><span class="pre">}</span></tt></td>
<td>Display a call graph for the given
function or functions. If no function
is specified, and the directive is used
in a function's docstring, then that
function's call graph will be
displayed.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="characters">
<h2><a class="toc-backref" href="#id57">4.5 Characters</a></h2>
<div class="section" id="valid-characters">
<h3><a class="toc-backref" href="#id58">4.5.1 Valid Characters</a></h3>
<p>Valid characters for an epytext docstring are space (<tt class="docutils literal"><span class="pre">\040</span></tt>); newline
(<tt class="docutils literal"><span class="pre">\012</span></tt>); and any letter, digit, or punctuation, as defined by the current
locale. Control characters (<tt class="docutils literal"><span class="pre">\000</span></tt>-<tt class="docutils literal"><span class="pre">\010`</span> <span class="pre">and</span> <span class="pre">``\013</span></tt>-<tt class="docutils literal"><span class="pre">\037</span></tt>) are not
valid content characters. Tabs (<tt class="docutils literal"><span class="pre">\011</span></tt>) are expanded to spaces, using the
same algorithm used by the Python parser. Carridge-return/newline pairs
(<tt class="docutils literal"><span class="pre">\015\012</span></tt>) are converted to newlines.</p>
</div>
<div class="section" id="content-characters">
<h3><a class="toc-backref" href="#id59">4.5.2 Content Characters</a></h3>
<p>Characters in a docstring that are not involved in markup are called <em>content characters</em>. Content characters are always displayed as-is. In particular, HTML
codes are not passed through. For example, consider the following example:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> <B>test</B></span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><B>test</B></td>
</tr>
</tbody>
</table>
<p>The docstring is rendered as <tt class="docutils literal"><span class="pre"><B>test</B></span></tt>, and not as the word "test" in
bold face.</p>
</div>
<div class="section" id="spaces-and-newlines">
<h3><a class="toc-backref" href="#id60">4.5.3 Spaces and Newlines</a></h3>
<p>In general, spaces and newlines within docstrings are treated as soft spaces.
In other words, sequences of spaces and newlines (that do not contain a blank
line) are rendered as a single space, and words may wrapped at spaces. However,
within literal blocks and doctest blocks, spaces and newlines are preserved,
and no word-wrapping occurs; and within URL targets and documentation link
targets, whitespace is ignored.</p>
</div>
</div>
</div>
<div class="section" id="epydoc-fields">
<h1><a class="toc-backref" href="#id61">5 Epydoc Fields</a></h1>
<!-- $Id: manual-fields.txt 1554 2007-02-27 03:31:56Z edloper $ -->
<p>Fields are used to describe specific properties of a documented object. For
example, fields can be used to define the parameters and return value of a
function; the instance variables of a class; and the author of a module. Each
field consists of a <em>tag</em>, an optional <em>argument</em>, and a <em>body</em>.</p>
<ul class="simple">
<li>The <em>tag</em> is a case-insensitive word that indicates what kind of
documentation is given by the field.</li>
<li>The optional <em>argument</em> specifies what object, parameter, or group is
documented by the field.</li>
<li>The <em>body</em> contains the main contents of the field.</li>
</ul>
<div class="section" id="field-markup">
<h2><a class="toc-backref" href="#id62">5.1 Field Markup</a></h2>
<p>Each docstring markup langauge marks fields differently. The following table
shows the basic fields syntax for each markup language. For more information,
see the definition of field syntax for each markup language.</p>
<table border="1" class="docutils">
<colgroup>
<col width="33%" />
<col width="33%" />
<col width="33%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Epytext</th>
<th class="head">reStructuredText</th>
<th class="head">Javadoc</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="first last literal-block">
@<em>tag</em>: <em>body</em>...
@<em>tag</em> <em>arg</em>: <em>body</em>...
</pre>
</td>
<td><pre class="first last literal-block">
:<em>tag</em>: <em>body</em>...
:<em>tag</em> <em>arg</em>: <em>body</em>...
</pre>
</td>
<td><pre class="first last literal-block">
@<em>tag</em> <em>body</em>...
@<em>tag</em> <em>arg</em> <em>body</em>...
</pre>
</td>
</tr>
<tr><td><a class="reference internal" href="#fields">Definition of epytext fields</a></td>
<td><a class="reference external" href="http://docutils.sourceforge.net/spec/rst/reStructuredText.html#field-lists">Definition of ReStructuredText fields</a></td>
<td><a class="reference external" href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javadoc.html#javadoctags">Definition of Javadoc fields</a></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="supported-fields">
<h2><a class="toc-backref" href="#id63">5.2 Supported Fields</a></h2>
<p>The following table lists the fields that epydoc currently recognizes. Field
tags are written using epytext markup; if you are using a different markup
language, then you should adjust the markup accordingly.</p>
<div class="section" id="functions-and-methods-parameters">
<h3><a class="toc-backref" href="#id64">5.2.1 Functions and Methods parameters</a></h3>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">@param</span></tt> <em>p</em>: ...</dt>
<dd>A description of the parameter <em>p</em> for a function or method.</dd>
<dt><tt class="docutils literal"><span class="pre">@type</span></tt> <em>p</em>: ...</dt>
<dd>The expected type for the parameter <em>p</em>.</dd>
<dt><tt class="docutils literal"><span class="pre">@return</span></tt>: ...</dt>
<dd>The return value for a function or method.</dd>
<dt><tt class="docutils literal"><span class="pre">@rtype</span></tt>: ...</dt>
<dd>The type of the return value for a function or method.</dd>
<dt><tt class="docutils literal"><span class="pre">@keyword</span></tt> <em>p</em>: ...</dt>
<dd>A description of the keyword parameter <em>p</em>.</dd>
<dt><tt class="docutils literal"><span class="pre">@raise</span></tt> <em>e</em>: ...</dt>
<dd>A description of the circumstances under which a function or method
raises exception <em>e</em>.</dd>
</dl>
<p>These tags can be used to specify attributes of parameters and return value
of function and methods. These tags are usually put in the the docstring of the
function to be documented.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p><strong>constructor parameters</strong></p>
<p class="last">In C extension modules, extension classes cannot have a docstring attached
to the <tt class="docutils literal"><span class="pre">__init__</span></tt> function; consequently it is not possible to document
parameters and exceptions raised by the class constructor. To overcome this
shortcoming, the tags <tt class="docutils literal"><span class="pre">@param</span></tt>, <tt class="docutils literal"><span class="pre">@keyword</span></tt>, <tt class="docutils literal"><span class="pre">@type</span></tt>, <tt class="docutils literal"><span class="pre">@exception</span></tt>
are also allowed to appear in the class docstring. In this case they refer
to constructor parameters.</p>
</div>
<p><tt class="docutils literal"><span class="pre">@param</span></tt> fields should be used to document any explicit parameter
(including the keyword parameter). <tt class="docutils literal"><span class="pre">@keyword</span></tt> fields should only be used
for non-explicit keyword parameters:</p>
<pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">plant</span>(seed, *tools, **options):
<span class="py-string">"""</span>
<span class="py-string"> @param seed: The seed that should be planted.</span>
<span class="py-string"> @param tools: Tools that should be used to plant the seed.</span>
<span class="py-string"> @param options: Any extra options for the planting.</span>
<span class="py-string"> @keyword dig_deep: Plant the seed deep under ground.</span>
<span class="py-string"> @keyword soak: Soak the seed before planting it.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
<p>Since the <tt class="docutils literal"><span class="pre">@type</span></tt> field allows for arbitrary text, it does not
automatically create a crossreference link to the specified type, and is
not written in fixed-width font by default. If you want to create a
crossreference link to the type, or to write the type in a fixed-width
font, then you must use inline markup:</p>
<pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">ponder</span>(person, time):
<span class="py-string">"""</span>
<span class="py-string"> @param person: Who should think.</span>
<span class="py-string"> @type person: L{Person} or L{Animal}</span>
<span class="py-string"> @param time: How long they should think.</span>
<span class="py-string"> @type time: C{int} or C{float}</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</div>
<div class="section" id="variables-parameters">
<h3><a class="toc-backref" href="#id65">5.2.2 Variables parameters</a></h3>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">@ivar</span></tt> <em>v</em>: ...</dt>
<dd>A description of the class instance variable <em>v</em>.</dd>
<dt><tt class="docutils literal"><span class="pre">@cvar</span></tt> <em>v</em>: ...</dt>
<dd>A description of the static class variable <em>v</em>.</dd>
<dt><tt class="docutils literal"><span class="pre">@var</span></tt> <em>v</em>: ...</dt>
<dd>A description of the module variable <em>v</em>.</dd>
<dt><tt class="docutils literal"><span class="pre">@type</span></tt> <em>v</em>: ...</dt>
<dd>The type of the variable <em>v</em>.</dd>
</dl>
<p>These tags are usually put in a module or class docstring. If the sources can
be parsed by Epydoc it is also possible to document the variable in their own
docstrings: see <a class="reference internal" href="#variable-docstrings">variable docstrings</a></p>
<p>Epydoc considers class variables the ones defined directly defined in the
class body. A common Python idiom is to create instance variables settings
their default value in the class instead of the constructor (hopefully if the
default is immutable...).</p>
<p>If you want to force Epydoc to classify as instance variable one whose default
value is set at class level, you can describe it using the tag <tt class="docutils literal"><span class="pre">@ivar</span></tt> in the
context of a variable docstring:</p>
<pre class="py-doctest">
<span class="py-keyword">class</span> <span class="py-defname">B</span>:
y = 42
<span class="py-string">"""@ivar: This is an instance variable."""</span></pre>
</div>
<div class="section" id="properties-parameters">
<h3><a class="toc-backref" href="#id66">5.2.3 Properties parameters</a></h3>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">@type</span></tt>: ...</dt>
<dd>The type of the property.</dd>
</dl>
<p>The <tt class="docutils literal"><span class="pre">@type</span></tt> tag can be attached toa property docstring to specify its type.</p>
</div>
<div class="section" id="grouping-and-sorting">
<h3><a class="toc-backref" href="#id67">5.2.4 Grouping and Sorting</a></h3>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">@group</span></tt> <em>g</em>: <em>c1,...,cn</em></dt>
<dd>Organizes a set of related children of a module or class into a group.
<em>g</em> is the name of the group; and <em>c1,...,cn</em> are the names of the
children in the group. To define multiple groups, use multiple group
fields.</dd>
<dt><tt class="docutils literal"><span class="pre">@sort</span></tt>: <em>c1,...,cn</em></dt>
<dd>Specifies the sort order for the children of a module or class.
<em>c1,...,cn</em> are the names of the children, in the order in which they
should appear. Any children that are not included in this list will
appear after the children from this list, in alphabetical order.</dd>
</dl>
<p>These tags can be used to present groups of related items in a logical way.
They apply to modules and classes docstrings.</p>
<p>For the <tt class="docutils literal"><span class="pre">@group</span></tt> and <tt class="docutils literal"><span class="pre">@sort</span></tt> tags, asterisks (<tt class="docutils literal"><span class="pre">*</span></tt>) can be used to
specify multiple children at once. An asterisk in a child name will match
any substring:</p>
<pre class="py-doctest">
<span class="py-keyword">class</span> <span class="py-defname">widget</span>(size, weight, age):
<span class="py-string">"""</span>
<span class="py-string"> @group Tools: zip, zap, *_tool</span>
<span class="py-string"> @group Accessors: get_*</span>
<span class="py-string"> @sort: get_*, set_*, unpack_*, cut</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
<div class="note">
<p class="first admonition-title">Note</p>
<p><strong>group markers</strong></p>
<p>It is also possible to group set of related items enclosing them
into special comment starting with the <em>group markers</em> '<tt class="docutils literal"><span class="pre">#{</span></tt>' and '<tt class="docutils literal"><span class="pre">#}</span></tt>'
The group title can be specified after the opening group marker. Example:</p>
<pre class="py-doctest">
<span class="py-comment">#{ Database access functions</span>
<span class="py-keyword">def</span> <span class="py-defname">read</span>(id):
<span class="py-comment">#[...]</span>
<span class="py-keyword">def</span> <span class="py-defname">store</span>(item):
<span class="py-comment">#[...]</span>
<span class="py-keyword">def</span> <span class="py-defname">delete</span>(id):
<span class="py-comment">#[...]</span>
<span class="py-comment"># groups can't be nested, so a closing marker is not required here.</span>
<span class="py-comment">#{ Web publish functions</span>
<span class="py-keyword">def</span> <span class="py-defname">get</span>(request):
<span class="py-comment">#[...]</span>
<span class="py-keyword">def</span> <span class="py-defname">post</span>(request):
<span class="py-comment">#[...]</span>
<span class="py-comment">#}</span></pre>
</div>
</div>
<div class="section" id="notes-and-warnings">
<h3><a class="toc-backref" href="#id68">5.2.5 Notes and Warnings</a></h3>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">@note</span></tt>: ...</dt>
<dd>A note about an object. Multiple note fields may be used to list
separate notes.</dd>
<dt><tt class="docutils literal"><span class="pre">@attention</span></tt>: ...</dt>
<dd>An important note about an object. Multiple attention fields may be
used to list separate notes.</dd>
<dt><tt class="docutils literal"><span class="pre">@bug</span></tt>: ...</dt>
<dd><p class="first">A description of a bug in an object. Multiple bug fields may be used to
report separate bugs.</p>
<div class="note last">
<p class="first admonition-title">Note</p>
<p class="last">If any <tt class="docutils literal"><span class="pre">@bug</span></tt> field is used, the HTML writer will generate a the page
<tt class="docutils literal"><span class="pre">bug-index.html</span></tt>, containing links to all the items tagged with
the field.</p>
</div>
</dd>
<dt><tt class="docutils literal"><span class="pre">@warning</span></tt>: ...</dt>
<dd>A warning about an object. Multiple warning fields may be used to
report separate warnings.</dd>
</dl>
</div>
<div class="section" id="status">
<h3><a class="toc-backref" href="#id69">5.2.6 Status</a></h3>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">@version</span></tt>: ...</dt>
<dd>The current version of an object.</dd>
<dt><tt class="docutils literal"><span class="pre">@todo</span></tt> [<em>ver</em>]: ...</dt>
<dd><p class="first">A planned change to an object. If the optional argument ver is given,
then it specifies the version for which the change will be made.
Multiple todo fields may be used if multiple changes are planned.</p>
<div class="note last">
<p class="first admonition-title">Note</p>
<p class="last">If any <tt class="docutils literal"><span class="pre">@todo</span></tt> field is used, the HTML writer will generate a the
page <tt class="docutils literal"><span class="pre">todo-index.html</span></tt>, containing links to all the items tagged
with the field.</p>
</div>
</dd>
<dt><tt class="docutils literal"><span class="pre">@deprecated</span></tt>: ...</dt>
<dd>Indicates that an object is deprecated. The body of the field describe
the reason why the object is deprecated.</dd>
<dt><tt class="docutils literal"><span class="pre">@since</span></tt>: ...</dt>
<dd>The date or version when an object was first introduced.</dd>
<dt><tt class="docutils literal"><span class="pre">@status</span></tt>: ...</dt>
<dd>The current status of an object.</dd>
<dt><tt class="docutils literal"><span class="pre">@change</span></tt>: ...</dt>
<dd>A change log entry for this object.</dd>
<dt><tt class="docutils literal"><span class="pre">@permission</span></tt>: ...</dt>
<dd>The object access permission, for systems such Zope/Plone supporting
this concept. It may be used more than once to specify multiple
permissions.</dd>
</dl>
</div>
<div class="section" id="formal-conditions">
<h3><a class="toc-backref" href="#id70">5.2.7 Formal Conditions</a></h3>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">@requires</span></tt>: ...</dt>
<dd>A requirement for using an object. Multiple requires fields may be
used if an object has multiple requirements.</dd>
<dt><tt class="docutils literal"><span class="pre">@precondition</span></tt>: ...</dt>
<dd>A condition that must be true before an object is used. Multiple
precondition fields may be used if an object has multiple preconditions.</dd>
<dt><tt class="docutils literal"><span class="pre">@postcondition</span></tt>: ...</dt>
<dd>A condition that is guaranteed to be true after an object is used.
Multiple postcondition fields may be used if an object has multiple
postconditions.</dd>
<dt><tt class="docutils literal"><span class="pre">@invariant</span></tt>: ...</dt>
<dd>A condition which should always be true for an object. Multiple
invariant fields may be used if an object has multiple invariants.</dd>
</dl>
</div>
<div class="section" id="bibliographic-information">
<h3><a class="toc-backref" href="#id71">5.2.8 Bibliographic Information</a></h3>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">@author</span></tt>: ...</dt>
<dd>The author(s) of an object. Multiple author fields may be used if an
object has multiple authors.</dd>
<dt><tt class="docutils literal"><span class="pre">@organization</span></tt>: ...</dt>
<dd>The organization that created or maintains an object.</dd>
<dt><tt class="docutils literal"><span class="pre">@copyright</span></tt>: ...</dt>
<dd>The copyright information for an object.</dd>
<dt><tt class="docutils literal"><span class="pre">@license</span></tt>: ...</dt>
<dd>The licensing information for an object.</dd>
<dt><tt class="docutils literal"><span class="pre">@contact</span></tt>: ...</dt>
<dd>Contact information for the author or maintainer of a module, class,
function, or method. Multiple contact fields may be used if an object
has multiple contacts.</dd>
</dl>
</div>
<div class="section" id="other-fields">
<h3><a class="toc-backref" href="#id72">5.2.9 Other fields</a></h3>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">@summary</span></tt>: ...</dt>
<dd>A summary description for an object. This description overrides the
default summary (which is constructed from the first sentence of the
object's description).</dd>
<dt><tt class="docutils literal"><span class="pre">@see</span></tt>: ...</dt>
<dd>A description of a related topic. see fields typically use
documentation crossreference links or external hyperlinks that link to
the related topic.</dd>
</dl>
</div>
</div>
<div class="section" id="fields-synonyms">
<h2><a class="toc-backref" href="#id73">5.3 Fields synonyms</a></h2>
<p>Several fields have <em>synonyms</em>, or alternate tags. The following table lists
all field synonyms. Field tags are written using epytext markup; if you are
using a different markup language, then you should adjust the markup
accordingly.</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Name</th>
<th class="head">Synonims</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><tt class="docutils literal"><span class="pre">@param</span></tt> <em>p</em>: ...</td>
<td><div class="first last line-block">
<div class="line"><tt class="docutils literal"><span class="pre">@parameter</span></tt> <em>p</em>: ...</div>
<div class="line"><tt class="docutils literal"><span class="pre">@arg</span></tt> <em>p</em>: ...</div>
<div class="line"><tt class="docutils literal"><span class="pre">@argument</span></tt> <em>p</em>: ...</div>
</div>
</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@return</span></tt>: ...</td>
<td><tt class="docutils literal"><span class="pre">@returns</span></tt>: ...</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@rtype</span></tt>: ...</td>
<td><tt class="docutils literal"><span class="pre">@returntype</span></tt>: ...</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@raise</span></tt> <em>e</em>: ...</td>
<td><div class="first last line-block">
<div class="line"><tt class="docutils literal"><span class="pre">@raises</span></tt> <em>e</em>: ...</div>
<div class="line"><tt class="docutils literal"><span class="pre">@except</span></tt> <em>e</em>: ...</div>
<div class="line"><tt class="docutils literal"><span class="pre">@exception</span></tt> <em>e</em>: ...</div>
</div>
</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@keyword</span></tt> <em>p</em>: ...</td>
<td><div class="first last line-block">
<div class="line"><tt class="docutils literal"><span class="pre">@kwarg</span></tt> <em>p</em>: ...</div>
<div class="line"><tt class="docutils literal"><span class="pre">@kwparam</span></tt> <em>p</em>: ...</div>
</div>
</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@ivar</span></tt> <em>v</em>: ...</td>
<td><tt class="docutils literal"><span class="pre">@ivariable</span></tt> <em>v</em>: ...</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@cvar</span></tt> <em>v</em>: ...</td>
<td><tt class="docutils literal"><span class="pre">@cvariable</span></tt> <em>v</em>: ...</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@var</span></tt> <em>v</em>: ...</td>
<td><tt class="docutils literal"><span class="pre">@variable</span></tt> <em>v</em>: ...</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@see</span></tt>: ...</td>
<td><tt class="docutils literal"><span class="pre">@seealso</span></tt>: ...</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@warning</span></tt>: ...</td>
<td><tt class="docutils literal"><span class="pre">@warn</span></tt>: ...</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@requires</span></tt>: ...</td>
<td><div class="first last line-block">
<div class="line"><tt class="docutils literal"><span class="pre">@require</span></tt>: ...</div>
<div class="line"><tt class="docutils literal"><span class="pre">@requirement</span></tt>: ...</div>
</div>
</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@precondition</span></tt>: ...</td>
<td><tt class="docutils literal"><span class="pre">@precond</span></tt>: ...</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@postcondition</span></tt>: ...</td>
<td><tt class="docutils literal"><span class="pre">@postcond</span></tt>: ...</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@organization</span></tt>: ...</td>
<td><tt class="docutils literal"><span class="pre">@org</span></tt>: ...</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@copyright</span></tt>: ...</td>
<td><tt class="docutils literal"><span class="pre">@(c)</span></tt>: ...</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@change</span></tt>: ...</td>
<td><tt class="docutils literal"><span class="pre">@changed</span></tt>: ...</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="module-metadata-variables">
<h2><a class="toc-backref" href="#id74">5.4 Module metadata variables</a></h2>
<p>Some module variables are commonly used as module metadata. Epydoc can use the
value provided by these variables as alternate form for tags. The following
table lists the recognized variables and the tag they replace. Customized
metadata variables can be added using the method described in <a class="reference internal" href="#adding-new-fields">Adding New
Fields</a>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Tag</th>
<th class="head">Variable</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><tt class="docutils literal"><span class="pre">@author</span></tt></td>
<td><tt class="docutils literal"><span class="pre">__author__</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@authors</span></tt></td>
<td><tt class="docutils literal"><span class="pre">__authors__</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@contact</span></tt></td>
<td><tt class="docutils literal"><span class="pre">__contact__</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@copyright</span></tt></td>
<td><tt class="docutils literal"><span class="pre">__copyright__</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@license</span></tt></td>
<td><tt class="docutils literal"><span class="pre">__license__</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@deprecated</span></tt></td>
<td><tt class="docutils literal"><span class="pre">__deprecated__</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@date</span></tt></td>
<td><tt class="docutils literal"><span class="pre">__date__</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">@version</span></tt></td>
<td><tt class="docutils literal"><span class="pre">__version__</span></tt></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="adding-new-fields">
<h2><a class="toc-backref" href="#id75">5.5 Adding New Fields</a></h2>
<p>New fields can be defined for the docstrings in a module using the special
<tt class="docutils literal"><span class="pre">@newfield</span></tt> tag (or its synonym, <tt class="docutils literal"><span class="pre">@deffield</span></tt>). This tag has the following
syntax:</p>
<blockquote>
<pre class="literal-block">
@newfield <em>tag</em>: <em>label</em> [, <em>plural</em> ]
</pre>
</blockquote>
<p>Where <em>tag</em> is the new tag that's being defined; <em>label</em> is a string that will
be used to mark this field in the generated output; and plural is the plural form
of label, if different.</p>
<p>New fields can be defined in any Python module. If they are defined in a
package, it will be possible to use the newly defined tag from every package
submodule.</p>
<p>Each new field will also define a <a class="reference internal" href="#module-metadata-variables">metadata variable</a> which can be used
to set the field value instead of the tag. For example, if a <em>revision</em>
tag has been defined with:</p>
<pre class="literal-block">
@newfield revision: Revision
</pre>
<p>then it will be possible to set a value for the field using a module variable:</p>
<pre class="py-doctest">
__revision__ = <span class="py-string">"1234"</span></pre>
<p>The following example illustrates how the @newfield can be used:
Docstring Input Rendered Output</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-string">"""</span>
<span class="py-string">@newfield corpus: Corpus, Corpora</span>
<span class="py-string">"""</span>
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> @corpus: Bob's wordlist.</span>
<span class="py-string"> @corpus: The British National Corpus.</span>
<span class="py-string"> """</span>
[...]</pre>
</td>
<td><p class="first"><strong>Corpora:</strong></p>
<ul class="last simple">
<li>Bob's wordlist.</li>
<li>The British National Corpus.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">The module-level variable <tt class="docutils literal"><span class="pre">__extra_epydoc_fields__</span></tt> is deprecated;
use <tt class="docutils literal"><span class="pre">@newfield</span></tt> instead.</p>
</div>
</div>
</div>
<div class="section" id="alternate-markup-languages">
<h1><a class="toc-backref" href="#id76">6 Alternate Markup Languages</a></h1>
<!-- $Id: manual-othermarkup.txt 1598 2007-09-06 13:02:50Z dvarrazzo $ -->
<p>Epydoc's default markup language is <a class="reference internal" href="#the-epytext-markup-language">epytext</a>, a lightweight markup language
that's easy to write and to understand. But if epytext is not powerful enough
for you, or doesn't suit your needs, epydoc also supports three alternate
markup languages:</p>
<dl class="docutils">
<dt><a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a></dt>
<dd>is an "easy-to-read, what-you-see-is-what-you-get plaintext markup syntax".
It is more powerful than epytext (e.g., it includes markup for tables and
footnotes); but it is also more complex, and sometimes harder to read.</dd>
<dt><a class="reference external" href="http://java.sun.com/j2se/javadoc/">Javadoc</a></dt>
<dd>is a documentation markup language that was developed for Java. It consists
of HTML, augmented by a set of special tagged fields.</dd>
<dt>Plaintext docstrings</dt>
<dd>are rendered verbatim (preserving whitespace).</dd>
</dl>
<p>To specify the markup language for a module, you should define a module-level
string variable <tt class="docutils literal"><span class="pre">__docformat__</span></tt>, containing the name of the module's markup
language. The name of the markup language may optionally be followed by a
language code (such as <tt class="docutils literal"><span class="pre">en</span></tt> for English). Conventionally, the definition of
the <tt class="docutils literal"><span class="pre">__docformat__</span></tt> variable immediately follows the module's docstring:</p>
<pre class="py-doctest">
<span class="py-comment"># widget.py</span>
<span class="py-string">"""</span>
<span class="py-string">Graphical support for `gizmos` and `widgets`.</span>
<span class="py-string">"""</span>
__docformat__ = <span class="py-string">"restructuredtext en"</span>
<span class="py-comment">#[...]</span></pre>
<p>To change the default markup language from the command line, use the
<tt class="docutils literal"><span class="pre">--docformat</span></tt> option. For example, the following command generates API
documentation for the existing regular expression package <tt class="docutils literal"><span class="pre">re</span></tt>, which uses
plaintext markup:</p>
<pre class="literal-block">
[epydoc]$ epydoc --docformat plaintext re
</pre>
<div class="section" id="id13">
<h2><a class="toc-backref" href="#id77">6.1 reStructuredText</a></h2>
<p>reStructuredText is a markup language that was developed in conjunction with
<a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a>. In order to parse reStructuredText docstrings, Docutils 0.3 or
higher must be installed. If Docutils is not installed, then reStructuredText
docstrings will be rendered as plaintext. Docutils can be downloaded from the
<a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=38414">Docutils SourceForge page</a>.</p>
<div class="section" id="default-role">
<h3><a class="toc-backref" href="#id78">6.1.1 Default role</a></h3>
<p>Epydoc replaces the Docutils' default <a class="reference external" href="http://docutils.sourceforge.net/docs/ref/rst/roles.html">interpreted text role</a> with
the creation of <a class="reference internal" href="#documentation-crossreference-links">documentation crossreference links</a>. If you want to create
a crossreference link to the <tt class="docutils literal"><span class="pre">somemod.Example</span></tt> class, you can put backquotes
around your test, typing:</p>
<pre class="literal-block">
`somemod.Example`
</pre>
</div>
<div class="section" id="consolidated-fields">
<h3><a class="toc-backref" href="#id79">6.1.2 Consolidated Fields</a></h3>
<p>In addition to the <a class="reference internal" href="#epydoc-fields">standard set of fields</a>, the reStructruedText parser also
supports <em>consolidated fields</em>, which combine the documentation for several
objects into a single field. For example, a single <tt class="docutils literal"><span class="pre">:Parameters:</span></tt> field is
often used to describe all of the parameters for a function or method:</p>
<pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">fox_speed</span>(size, weight, age):
<span class="py-string">"""</span>
<span class="py-string"> Return the maximum speed for a fox.</span>
<span class="py-string"> :Parameters:</span>
<span class="py-string"> - `size`: The size of the fox (in meters)</span>
<span class="py-string"> - `weight`: The weight of the fox (in stones)</span>
<span class="py-string"> - `age`: The age of the fox (in years)</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
<p>Epydoc will automatically extract information about each parameter from this
list. These <em>consolidated fields</em> may be written using either a <a class="reference external" href="http://docutils.sourceforge.net/docs/user/rst/quickref.html#bullet-lists">bulleted
list</a> or a <a class="reference external" href="http://docutils.sourceforge.net/docs/user/rst/quickref.html#definition-lists">definition list</a>.</p>
<ul class="simple">
<li>If a consolidated field is written as a <em>bulleted list</em>, then each list item
must begin with the field's argument, marked as <a class="reference external" href="http://docutils.sourceforge.net/docs/user/rst/quickref.html#inline-markup">interpreted text</a>, and
followed by a colon or dash.</li>
<li>If a consolidated field is written as a <em>definition list</em>, then each
definition item's term should contain the field's argument, (it is not
mandatory for it being marked as interpreted text).</li>
</ul>
<p>The term classifier, if present, is used to specify the associated type. The
following example shows the use of a definition list to define a consolidated
field (note that docutils requires a space before and after the '<tt class="docutils literal"><span class="pre">:</span></tt>' used
to mark classifiers).</p>
<pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">fox_speed</span>(size, weight, age):
<span class="py-string">"""</span>
<span class="py-string"> Return the maximum speed for a fox.</span>
<span class="py-string"> :Parameters:</span>
<span class="py-string"> size</span>
<span class="py-string"> The size of the fox (in meters)</span>
<span class="py-string"> weight : float</span>
<span class="py-string"> The weight of the fox (in stones)</span>
<span class="py-string"> age : int</span>
<span class="py-string"> The age of the fox (in years)</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
<p>The following consolidated fields are currently supported by epydoc:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Consolidated Field Tag</th>
<th class="head">Corresponding Base Field Tag</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><tt class="docutils literal"><span class="pre">:Parameters:</span></tt></td>
<td><tt class="docutils literal"><span class="pre">:param:</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">:Exceptions:</span></tt></td>
<td><tt class="docutils literal"><span class="pre">:except:</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">:Groups:</span></tt></td>
<td><tt class="docutils literal"><span class="pre">:group:</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">:Keywords:</span></tt></td>
<td><tt class="docutils literal"><span class="pre">:keyword:</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">:Variables:</span></tt></td>
<td><tt class="docutils literal"><span class="pre">:var:</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">:IVariables:</span></tt></td>
<td><tt class="docutils literal"><span class="pre">:ivar:</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">:CVariables:</span></tt></td>
<td><tt class="docutils literal"><span class="pre">:cvar:</span></tt></td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">:Types:</span></tt></td>
<td><tt class="docutils literal"><span class="pre">:type:</span></tt></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="graph-directives">
<h3><a class="toc-backref" href="#id80">6.1.3 Graph directives</a></h3>
<p>The epydoc reStructuredText reader defines several custom <cite>directives</cite>, which
can be used to automatically generate a variety of graphs. The following custom
directives are currently defined:</p>
<table border="1" class="docutils">
<colgroup>
<col width="30%" />
<col width="70%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Directive</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="first last literal-block">
.. classtree:: [<em>classes...</em>]
:dir: <em>up|down|left|right</em>
</pre>
</td>
<td>Display a class hierarchy for the given class or classes (including all
superclasses & subclasses). If no class is specified, and the directive
is used in a class's docstring, then that class's class hierarchy will
be displayed. The <tt class="docutils literal"><span class="pre">dir</span></tt> option specifies the orientation for the graph
(default=<tt class="docutils literal"><span class="pre">down</span></tt>).</td>
</tr>
<tr><td><pre class="first last literal-block">
.. packagetree:: [<em>modules...</em>]
:dir: <em>up|down|left|right</em>
:style: <em>uml|tree</em>
</pre>
</td>
<td>Display a package hierarchy for the given module or modules (including
all subpackages and submodules). If no module is specified, and the
directive is used in a module's docstring, then that module's package
hierarchy will be displayed. The <tt class="docutils literal"><span class="pre">dir</span></tt> option specifies the
orientation for the graph (default=<tt class="docutils literal"><span class="pre">down</span></tt>). The <tt class="docutils literal"><span class="pre">style</span></tt> option
specifies whether packages should be displayed in a tree, or using
nested UML symbols.</td>
</tr>
<tr><td><pre class="first last literal-block">
.. importgraph:: [<em>modules...</em>]
:dir: <em>up|down|left|right</em>
</pre>
</td>
<td>Display an import graph for the given module or modules. If no module
is specified, and the directive is used in a module's docstring, then
that module's import graph will be displayed. The <tt class="docutils literal"><span class="pre">dir</span></tt> option
specifies the orientation for the graph (default=<tt class="docutils literal"><span class="pre">left</span></tt>).</td>
</tr>
<tr><td><pre class="first last literal-block">
.. callgraph:: [<em>functions...</em>]
:dir: <em>up|down|left|right</em>
</pre>
</td>
<td>Display a call graph for the given function or functions. If no
function is specified, and the directive is used in a function's
docstring, then that function's call graph will be displayed. The
<tt class="docutils literal"><span class="pre">dir</span></tt> option specifies the orientation for the graph (default=<tt class="docutils literal"><span class="pre">right</span></tt>).</td>
</tr>
<tr><td><pre class="first last literal-block">
.. dotgraph:: [<em>title...</em>]
:caption: <em>text...</em>
<em>graph...</em>
</pre>
</td>
<td>Display a custom Graphviz dot graph. The body of the directive
(<tt class="docutils literal"><span class="pre">graph...</span></tt>) should contain the body of a dot graph. The optional
<tt class="docutils literal"><span class="pre">title</span></tt> argument, if specified, is used as the title of the graph.
The optional <tt class="docutils literal"><span class="pre">caption</span></tt> option can be used to provide a caption for
the graph.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="colorized-snippets-directive">
<h3><a class="toc-backref" href="#id81">6.1.4 Colorized snippets directive</a></h3>
<p>Using reStructuredText markup it is possible to specify Python snippets in a
<a class="reference external" href="http://docutils.sourceforge.net/docs/user/rst/quickref.html#bullet-lists">doctest block</a>. SUch block will be colorized as in epytext <a class="reference internal" href="#doctest-blocks">Doctest Blocks</a>.</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">def</span> <span class="py-defname">double</span>(x):
<span class="py-more">... </span> return x * 2
<span class="py-more">...</span>
<span class="py-prompt">>>> </span><span class="py-keyword">print</span> double(8)
<span class="py-output">16</span></pre>
<p>Doctest block are mostly useful to be run as a part of automatized test suite
using the <a class="reference external" href="http://docs.python.org/lib/module-doctest.html">doctest</a> module. If the Python prompt gets in your way when you try
to copy and paste and you are not interested in self-testing docstrings, the
<tt class="docutils literal"><span class="pre">python</span></tt> directive will let you obtain a simple block of colorized text:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="first last literal-block">
.. python::
def fib(n):
"""Print a Fibonacci series."""
a, b = 0, 1
while b < n:
print b,
a, b = b, a+b
</pre>
</td>
<td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">fib</span>(n):
<span class="py-string">"""Print a Fibonacci series."""</span>
a, b = 0, 1
while b < n:
<span class="py-keyword">print</span> b,
a, b = b, a+b</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="external-api-links">
<h3><a class="toc-backref" href="#id82">6.1.5 External API links</a></h3>
<p>Epydoc can be used to create hyperlinks from your package documentation towards
objects defined in the API of other packages. Such links are similar to
ordinary <a class="reference internal" href="#documentation-crossreference-links">documentation crossreference links</a>, but it is required to configure
Epydoc setting up a new <a class="reference external" href="http://docutils.sourceforge.net/docs/ref/rst/roles.html">interpreted text role</a>, binding it to an external API.</p>
<p>To create a new role, the command line option <tt class="docutils literal"><span class="pre">--external-api=</span></tt><em>NAME</em> must
be used. This option introduces a new interpreted text role called <tt class="docutils literal"><span class="pre">NAME</span></tt>,
which can be used to refer to objects defined in an external API.</p>
<p>You can alternatively use a configuration file for this and all the other
options: see the <a class="reference internal" href="#sample-configuration-file">sample configuration file</a> for a comprehensive example.</p>
<p>For example, if your program needs to programmatically use the Epydoc package
itself, your docstrings may refer to functions described by Epydoc API:</p>
<pre class="literal-block">
If you want to print a value, you can use
the :epydoc:`apidoc.pp_apidoc()` function.
</pre>
<p>When you will generate the API documentation for such program, you will
need the option <tt class="docutils literal"><span class="pre">--external-api=epydoc</span></tt> or you will get parsing errors due
to the unknown role.</p>
<p>Of course this doesn't help to really create cross references: the
<tt class="docutils literal"><span class="pre">--external-api</span></tt> option suffices to stop Epydoc complaining about unknown
roles, but the text is simply rendered in a monotype font and no link is
created.</p>
<p>What Epydoc requires to create external API links is a mapping from the names
of the objects exposed by the API and the URL where such objects are actually
described. Such mapping must be provided as a text file, with an object name
and its URL on each line, separated by a <tt class="docutils literal"><span class="pre">tab</span></tt> character. For example the
Epydoc API documentation may be represented by a file names <tt class="docutils literal"><span class="pre">api-objects.txt</span></tt>
containing:</p>
<pre class="literal-block">
epydoc -> epydoc-module.html
epydoc.apidoc -> epydoc.apidoc-module.html
epydoc.apidoc.UNKNOWN -> epydoc.apidoc-module.html#UNKNOWN
epydoc.apidoc._pp_val -> epydoc.apidoc-module.html#_pp_val
epydoc.apidoc.py_src_filename -> epydoc.util-module.html#py_src_filename
epydoc.apidoc.pp_apidoc -> epydoc.apidoc-module.html#pp_apidoc
epydoc.apidoc._pp_list -> epydoc.apidoc-module.html#_pp_list
... ...
... ...
</pre>
<p>Epydoc's HTML writer indeed includes such file in its output: see <a class="reference internal" href="#html-files">HTML
Files</a> for details.</p>
<p>You can bind the definition file to the interpreted text role name using
the command line option <tt class="docutils literal"><span class="pre">--external-api-file=</span></tt><em>NAME:FILENAME</em>.In the
previous example you can use:</p>
<pre class="literal-block">
--external-api-file=epydoc:api-objects.txt
</pre>
<p>This helps Epydoc to create relative urls: in the previous example the
<tt class="docutils literal"><span class="pre">apidoc.pp_apidoc()</span></tt> label will be linked with the
<tt class="docutils literal"><span class="pre">epydoc.apidoc-module.html#_pp_val</span></tt> URL.</p>
<p>You can specify a new root for the generated links using the last command line
option: <tt class="docutils literal"><span class="pre">--external-api-root=</span></tt><em>NAME:STRING</em>. <em>STRING</em> will be attached
in front of any URL returned by the <em>NAME</em> text role. For example, to let your
program refer to Epydoc API whose documentation is published at
<a class="reference external" href="http://epydoc.sourceforge.net/api/">http://epydoc.sourceforge.net/api/</a> you can use the options:</p>
<pre class="literal-block">
--external-api-root=epydoc:http://epydoc.sourceforge.net/api/
</pre>
<p>this will let your reference <a class="reference external" href="http://epydoc.sourceforge.net/api/epydoc.apidoc-module.html#pp_apidoc"><tt class="docutils literal"><span class="pre">apidoc.pp_apidoc()</span></tt></a> point at the
right documentation.</p>
<p>The three options can be used any number of time, effectively allowing to link
towards all the required external packages.</p>
<div class="section" id="names-resolution">
<h4><a class="toc-backref" href="#id83">6.1.5.1 Names resolution</a></h4>
<p>When an external API link is to be created, the required name is split along
any separator ('<tt class="docutils literal"><span class="pre">.</span></tt>', '<tt class="docutils literal"><span class="pre">::</span></tt>', '<tt class="docutils literal"><span class="pre">-></span></tt>'). Everything after the first noise
character (for example after an '<tt class="docutils literal"><span class="pre">(</span></tt>') is discarded.</p>
<p>The name fragment is looked for in the names defined in the description file:
first an exact match is attempted; if no name exactly matches the required
name, a partial match is attempted: the required name is compared with the
<em>trailing parts</em> of the names in the file.</p>
<p>If a single name is found in this lookup, then its URL is returned. If the
name is not found, or if it matches with the trailing part of many defined
names, a warning is raised and the name is rendered as literal text.</p>
</div>
<div class="section" id="linking-from-standalone-documents">
<h4><a class="toc-backref" href="#id84">6.1.5.2 Linking from standalone documents</a></h4>
<p>Epydoc provides the script <tt class="docutils literal"><span class="pre">apirst2html.py</span></tt> which allows you to use the
previously described interpreted text roles from any reST document. The script
exposes the same interface of the standard Docutils script <tt class="docutils literal"><span class="pre">rst2html.py</span></tt> but
provides the extra command line options described in <a class="reference internal" href="#external-api-links">External API links</a>.</p>
<p>With such tool you will be able to create hypertextual documentation of your
package with direct links to its API.</p>
</div>
</div>
<div class="section" id="indexed-terms-in-restructuredtext">
<h3><a class="toc-backref" href="#id85">6.1.6 Indexed Terms in reStructuredText</a></h3>
<p>Epydoc uses <a class="reference internal" href="#indexed-terms">indexed terms</a> to create a table of terms definitions. Indexed
terms are created using the epytext markup <tt class="docutils literal"><span class="pre">X{...}</span></tt>.</p>
<p>If you want to create indexed terms in reStructuredText modules,
you can use the <tt class="docutils literal"><span class="pre">term</span></tt> <a class="reference external" href="http://docutils.sourceforge.net/docs/ref/rst/roles.html">interpreted text role</a>. For example:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Docstring Input</th>
<th class="head">Rendered Output</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><pre class="py-doctest">
<span class="py-keyword">def</span> <span class="py-defname">example</span>():
<span class="py-string">"""</span>
<span class="py-string"> An :term:`index term` is a term that</span>
<span class="py-string"> should be included in the index.</span>
<span class="py-string"> """</span>
<span class="py-comment">#[...]</span></pre>
</td>
<td><p class="first">An <em>index term</em> is a term that should be included in the index.</p>
<blockquote class="last">
<table border="1" class="docutils">
<colgroup>
<col width="46%" />
<col width="54%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head" colspan="2">Index</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>index term</td>
<td><em>example</em></td>
</tr>
<tr><td>x intercept</td>
<td><em>x_intercept</em></td>
</tr>
<tr><td>y intercept</td>
<td><em>x_intercept</em></td>
</tr>
</tbody>
</table>
</blockquote>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="id15">
<h2><a class="toc-backref" href="#id86">6.2 Javadoc</a></h2>
<p><a class="reference external" href="http://java.sun.com/j2se/javadoc/">Javadoc</a> is a markup language developed by Sun Microsystems for documenting
Java APIs. The epydoc implementation of Javadoc is based on the <a class="reference external" href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javadoc.html">Javadoc 1.4.2
reference documentation</a>. However, there are likely to be some minor incompatibilities between Sun's implementation and epydoc's. Known incompatibilities include:</p>
<ul class="simple">
<li>Epydoc does not support the Javadoc block tag <tt class="docutils literal"><span class="pre">@serial</span></tt>.</li>
<li>Epydoc does not support the following Javadoc inline tags: <tt class="docutils literal"><span class="pre">{@docroot}</span></tt>,
<tt class="docutils literal"><span class="pre">{@inheritdoc}</span></tt>, <tt class="docutils literal"><span class="pre">{@value}</span></tt>.</li>
<li>Epydoc adds many field tags that Sun does not include, such as <tt class="docutils literal"><span class="pre">@var</span></tt>,
<tt class="docutils literal"><span class="pre">@type</span></tt>, and <tt class="docutils literal"><span class="pre">@group</span></tt>.</li>
</ul>
<div class="section" id="javadoc-fields">
<h3><a class="toc-backref" href="#id87">6.2.1 Javadoc Fields</a></h3>
<p>For compatibility with Javadoc, every <tt class="docutils literal"><span class="pre">@see</span></tt> field is assumed to contain a
single crossreference link, unless its body is quoted, or it starts with an
HTML tag. See the <a class="reference external" href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javadoc.html#@see">Javadoc reference manual</a> for more information about how the
<tt class="docutils literal"><span class="pre">@see</span></tt> field is encoded in Javadoc.</p>
<p>Because Javadoc does not mark end of the optional argument, field arguments
must contain exactly one word. Thus, multi-word arguments are not available
in Javadoc. In particular, all group names must be single words.</p>
</div>
</div>
</div>
<div class="section" id="references">
<h1><a class="toc-backref" href="#id88">7 References</a></h1>
<!-- $Id: manual-reference.txt 1549 2007-02-24 16:23:49Z dvarrazzo $ -->
<div class="section" id="command-line-usage">
<h2><a class="toc-backref" href="#id89">7.1 Command Line Usage</a></h2>
<p>Usage: <tt class="docutils literal"><span class="pre">epydoc.py</span></tt> [<em>ACTION</em>] [<em>options</em>] <em>NAMES...</em></p>
<dl class="docutils">
<dt>NAMES...</dt>
<dd>A list of the Python objects that should be documented. Objects can be
specified using dotted names (such as <tt class="docutils literal"><span class="pre">os.path</span></tt>), module filenames (such
as <tt class="docutils literal"><span class="pre">epydoc/epytext.py</span></tt>), or package directory names (such as
<tt class="docutils literal"><span class="pre">epydoc/</span></tt>). Packages are expanded to include all sub-modules and
sub-packages.</dd>
<dt>options</dt>
<dd><pre class="first last literal-block">
--config=FILE A configuration file, specifying additional OPTIONS
and/or NAMES. This option may be repeated.
-o PATH, --output=PATH
The output directory. If PATH does not exist, then it
will be created.
-q, --quiet Decrease the verbosity.
-v, --verbose Increase the verbosity.
--debug Show full tracebacks for internal errors.
--simple-term Do not try to use color or cursor control when
displaying the progress bar, warnings, or errors.
Actions:
--html Write HTML output.
--text Write plaintext output. (not implemented yet)
--latex Write LaTeX output.
--dvi Write DVI output.
--ps Write Postscript output.
--pdf Write PDF output.
--check Check completeness of docs.
--pickle Write the documentation to a pickle file.
--version Show epydoc's version number and exit.
-h, --help Show this message and exit. For help on specific
topics, use "--help TOPIC". Use "--help topics" for a
list of available help topics
Generation Options:
--docformat=NAME The default markup language for docstrings. Defaults
to "epytext".
--parse-only Get all information from parsing (don't introspect)
--introspect-only Get all information from introspecting (don't parse)
--exclude=PATTERN Exclude modules whose dotted name matches the regular
expression PATTERN
--exclude-introspect=PATTERN
Exclude introspection of modules whose dotted name
matches the regular expression PATTERN
--exclude-parse=PATTERN
Exclude parsing of modules whose dotted name matches
the regular expression PATTERN
--inheritance=STYLE
The format for showing inheritance objects. STYLE
should be one of: grouped, listed, included.
--show-private Include private variables in the output. (default)
--no-private Do not include private variables in the output.
--show-imports List each module's imports.
--no-imports Do not list each module's imports. (default)
--show-sourcecode Include source code with syntax highlighting in the
HTML output. (default)
--no-sourcecode Do not include source code with syntax highlighting in
the HTML output.
--include-log Include a page with the process log (epydoc-log.html)
Output Options:
--name=NAME The documented project's name (for the navigation
bar).
--css=STYLESHEET The CSS stylesheet. STYLESHEET can be either a
builtin stylesheet or the name of a CSS file.
--url=URL The documented project's URL (for the navigation bar).
--navlink=HTML HTML code for a navigation link to place in the
navigation bar.
--top=PAGE The "top" page for the HTML documentation. PAGE can
be a URL, the name of a module or class, or one of the
special names "trees.html", "indices.html", or
"help.html"
--help-file=FILE An alternate help file. FILE should contain the body
of an HTML file -- navigation bars will be added to
it.
--show-frames Include frames in the HTML output. (default)
--no-frames Do not include frames in the HTML output.
--separate-classes When generating LaTeX or PDF output, list each class
in its own section, instead of listing them under
their containing module.
API Linking Options:
--external-api=NAME
Define a new API document. A new interpreted text
role NAME will be added.
--external-api-file=NAME:FILENAME
Use records in FILENAME to resolve objects in the API
named NAME.
--external-api-root=NAME:STRING
Use STRING as prefix for the URL generated from the
API NAME.
Graph Options:
--graph=GRAPHTYPE Include graphs of type GRAPHTYPE in the generated
output. Graphs are generated using the Graphviz dot
executable. If this executable is not on the path,
then use --dotpath to specify its location. This
option may be repeated to include multiple graph types
in the output. GRAPHTYPE should be one of: all,
classtree, callgraph, umlclasstree.
--dotpath=PATH The path to the Graphviz 'dot' executable.
--graph-font=FONT Specify the font used to generate Graphviz graphs.
(e.g., helvetica or times).
--graph-font-size=SIZE
Specify the font size used to generate Graphviz
graphs, in points.
--pstat=FILE A pstat output file, to be used in generating call
graphs.
Return Value Options:
--fail-on-error Return a non-zero exit status, indicating failure, if
any errors are encountered.
--fail-on-warning Return a non-zero exit status, indicating failure, if
any errors or warnings are encountered (not including
docstring warnings).
--fail-on-docstring-warning
Return a non-zero exit status, indicating failure, if
any errors or warnings are encountered (including
docstring warnings).
</pre>
</dd>
</dl>
</div>
<div class="section" id="sample-configuration-file">
<h2><a class="toc-backref" href="#id90">7.2 Sample Configuration File</a></h2>
<p>Configuration files, specified using the <tt class="docutils literal"><span class="pre">--config</span></tt> option, may be used to
specify both the list of objects to document, and the options that should be
used to document them. Configuration files are read using the standard
<a class="reference external" href="http://docs.python.org/lib/module-ConfigParser.html">ConfigParser</a> module. The following example configuration file demonstrates the
various options that you can set. Lines beginning with <tt class="docutils literal"><span class="pre">#</span></tt> or <tt class="docutils literal"><span class="pre">;</span></tt> are
treated as comments.</p>
<pre class="literal-block">
<strong>[epydoc]</strong> <em># Epydoc section marker (required by ConfigParser)</em>
<em># The list of objects to document. Objects can be named using</em>
<em># dotted names, module filenames, or package directory names.</em>
<em># Alases for this option include "objects" and "values".</em>
<strong>modules: sys, os.path, re</strong>
<em># The type of output that should be generated. Should be one</em>
<em># of: html, text, latex, dvi, ps, pdf.</em>
<strong>output: html</strong>
<em># The path to the output directory. May be relative or absolute.</em>
<strong>target: html/</strong>
<em># An integer indicating how verbose epydoc should be. The default</em>
<em># value is 0; negative values will supress warnings and errors;</em>
<em># positive values will give more verbose output.</em>
<strong>verbosity: 0</strong>
<em># A boolean value indicating that Epydoc should show a tracaback</em>
<em># in case of unexpected error. By default don't show tracebacks</em>
<strong>debug: 0</strong>
<em># If True, don't try to use colors or cursor control when doing</em>
<em># textual output. The default False assumes a rich text prompt</em>
<strong>simple-term: 0</strong>
<strong>### Generation options</strong>
<em># The default markup language for docstrings, for modules that do</em>
<em># not define __docformat__. Defaults to epytext.</em>
<strong>docformat: epytext</strong>
<em># Whether or not parsing should be used to examine objects.</em>
<strong>parse: yes</strong>
<em># Whether or not introspection should be used to examine objects.</em>
<strong>introspect: yes</strong>
<em># Don't examine in any way the modules whose dotted name match this</em>
<em># regular expression pattern.</em>
<strong>#exclude</strong>
<em># Don't perform introspection on the modules whose dotted name match this</em>
<em># regular expression pattern.</em>
<strong>#exclude-introspect</strong>
<em># Don't perform parsing on the modules whose dotted name match this</em>
<em># regular expression pattern.</em>
<strong>#exclude-parse</strong>
<em># The format for showing inheritance objects.</em>
<em># It should be one of: 'grouped', 'listed', 'included'.</em>
<strong>inheritance: listed</strong>
<em># Whether or not to inclue private variables. (Even if included,</em>
<em># private variables will be hidden by default.)</em>
<strong>private: yes</strong>
<em># Whether or not to list each module's imports.</em>
<strong>imports: no</strong>
<em># Whether or not to include syntax highlighted source code in</em>
<em># the output (HTML only).</em>
<strong>sourcecode: yes</strong>
<em># Whether or not to includea a page with Epydoc log, containing</em>
<em># effective option at the time of generation and the reported logs.</em>
<strong>include-log: no</strong>
<strong>### Output options</strong>
<em># The documented project's name.</em>
<strong>#name: Example</strong>
<em># The CSS stylesheet for HTML output. Can be the name of a builtin</em>
<em># stylesheet, or the name of a file.</em>
<strong>css: white</strong>
<em># The documented project's URL.</em>
<strong>#url: http://some.project/</strong>
<em># HTML code for the project link in the navigation bar. If left</em>
<em># unspecified, the project link will be generated based on the</em>
<em># project's name and URL.</em>
<strong>#link: <a href="somewhere">My Cool Project</a></strong>
<em># The "top" page for the documentation. Can be a URL, the name</em>
<em># of a module or class, or one of the special names "trees.html",</em>
<em># "indices.html", or "help.html"</em>
<strong>#top: os.path</strong>
<em># An alternative help file. The named file should contain the</em>
<em># body of an HTML file; navigation bars will be added to it.</em>
<strong>#help: my_helpfile.html</strong>
<em># Whether or not to include a frames-based table of contents.</em>
<strong>frames: yes</strong>
<em># Whether each class should be listed in its own section when</em>
<em># generating LaTeX or PDF output.</em>
<strong>separate-classes: no</strong>
<strong>### API linking options</strong>
<em># Define a new API document. A new interpreted text role</em>
<em># will be created</em>
<strong>#external-api: epydoc</strong>
<em># Use the records in this file to resolve objects in the API named NAME.</em>
<strong>#external-api-file: epydoc:api-objects.txt</strong>
<em># Use this URL prefix to configure the string returned for external API.</em>
<strong>#external-api-root: epydoc:http://epydoc.sourceforge.net/api</strong>
<strong>### Graph options</strong>
<em># The list of graph types that should be automatically included</em>
<em># in the output. Graphs are generated using the Graphviz "dot"</em>
<em># executable. Graph types include: "classtree", "callgraph",</em>
<em># "umlclass". Use "all" to include all graph types</em>
<strong>graph: all</strong>
<em># The path to the Graphviz "dot" executable, used to generate</em>
<em># graphs.</em>
<strong>dotpath: /usr/local/bin/dot</strong>
<em># The name of one or more pstat files (generated by the profile</em>
<em># or hotshot module). These are used to generate call graphs.</em>
<strong>pstat: profile.out</strong>
<em># Specify the font used to generate Graphviz graphs.</em>
<em># (e.g., helvetica or times).</em>
<strong>graph-font: Helvetica</strong>
<em># Specify the font size used to generate Graphviz graphs.</em>
<strong>graph-font-size: 10</strong>
<strong>### Return value options</strong>
<em># The condition upon which Epydoc should exit with a non-zero</em>
<em># exit status. Possible values are error, warning, docstring_warning</em>
<strong>#fail-on: error</strong>
</pre>
</div>
<div class="section" id="warnings-and-errors">
<h2><a class="toc-backref" href="#id91">7.3 Warnings and Errors</a></h2>
<p>If epydoc encounters an error while processing a docstring, it issues a warning
message that describes the error, and attempts to continue generating
documentation. Errors related to epytext are divided into three categories:</p>
<dl class="docutils">
<dt>Epytext Warnings</dt>
<dd>are caused by epytext docstrings that contain questionable or suspicious
markup. Epytext warnings do not prevent the docstring in question from
being parsed.</dd>
<dt>Field Warnings</dt>
<dd>are caused by epytext docstrings containing invalid fields. The contents of
the invalid field are generally ignored.</dd>
<dt>Epytext Errors</dt>
<dd>are caused by epytext docstrings that contain invalid markup. Whenever an
epytext error is detected, the docstring in question is treated as a
plaintext docstring.</dd>
</dl>
<p>The following sections list and describe the warning messages that epydoc can
generate. They are intended as a reference resource, which you can search for
more information and possible causes if you encounter an error and do not
understand it. These descriptions are also available in the <tt class="docutils literal"><span class="pre">epydoc(1)</span></tt> man
page.</p>
<div class="section" id="epytext-warnings">
<h3><a class="toc-backref" href="#id92">7.3.1 Epytext Warnings</a></h3>
<dl class="docutils">
<dt>Possible mal-formatted field item.</dt>
<dd>Epytext detected a line that looks like a field item, but is not correctly
formatted. This typically occurs when the trailing colon (<tt class="docutils literal"><span class="pre">:</span></tt>) is not
included in the field tag.</dd>
<dt>Possible heading typo.</dt>
<dd>Epytext detected a pair of lines that looks like a heading, but the number
of underline characters does not match the number of characters in the
heading. The number of characters in these two lines must match exactly for
them to be considered a heading.</dd>
</dl>
</div>
<div class="section" id="field-warnings">
<h3><a class="toc-backref" href="#id93">7.3.2 Field Warnings</a></h3>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">@param</span></tt> for unknown parameter <em>param</em>.</dt>
<dd>A <tt class="docutils literal"><span class="pre">@param</span></tt> field was used to specify the type for a parameter that is not
included in the function's signature. This is typically caused by a typo in
the parameter name.</dd>
<dt><em>tag</em> did not expect an argument.</dt>
<dd>The field tag <em>tag</em> was used with an argument, but it does not take one.</dd>
<dt><em>tag</em> expected an argument.</dt>
<dd>The field tag <em>tag</em> was used without an argument, but it requires one.</dd>
<dt><tt class="docutils literal"><span class="pre">@type</span></tt> for unknown parameter <em>param</em>.</dt>
<dd>A <tt class="docutils literal"><span class="pre">@type</span></tt> field was used to specify the type for a parameter that is not
included in the function's signature. This is typically caused by a typo in
the parameter name.</dd>
<dt><tt class="docutils literal"><span class="pre">@type</span></tt> for unknown variable <em>var</em>.</dt>
<dd>A <tt class="docutils literal"><span class="pre">@type</span></tt> field was used to specify the type for a variable, but no
other information is known about the variable. This is typically caused
by a typo in the variable name.</dd>
<dt>Unknown field tag <em>tag</em>.</dt>
<dd>A docstring contains a field with the unknown tag <em>tag</em>.</dd>
<dt>Redefinition of <em>field</em>.</dt>
<dd>Multiple field tags define the value of field in the same docstring, but
field can only take a single value.</dd>
</dl>
</div>
<div class="section" id="epytext-errors">
<h3><a class="toc-backref" href="#id94">7.3.3 Epytext Errors</a></h3>
<dl class="docutils">
<dt>Bad link target.</dt>
<dd>The target specified for an inline link contruction (L{...}) is not
well-formed. Link targets must be valid Python identifiers.</dd>
<dt>Bad uri target.</dt>
<dd>The target specified for an inline uri contruction (<tt class="docutils literal"><span class="pre">U{...}</span></tt>) is not
well-formed. This typically occurs if inline markup is nested inside the
URI target.</dd>
<dt>Fields must be at the top level.</dt>
<dd>The list of fields (<tt class="docutils literal"><span class="pre">@param</span></tt>, etc.) is contained by some other block
structure (such as a list or a section).</dd>
<dt>Fields must be the final elements in an epytext string.</dt>
<dd>The list of fields (<tt class="docutils literal"><span class="pre">@param</span></tt>, etc.) is not at the end of a docstring.</dd>
<dt>Headings must occur at top level.</dt>
<dd>The heading is contianed in some other block structure (such as a list).</dd>
<dt>Improper doctest block indentation.</dt>
<dd>The doctest block dedents past the indentation of its initial prompt line.</dd>
<dt>Improper heading indentation.</dt>
<dd>The heading for a section is not left-aligned with the paragraphs in the
section that contains it.</dd>
<dt>Improper paragraph indentation.</dt>
<dd>The paragraphs within a block are not left-aligned. This error is often
generated when plaintext docstrings are parsed using epytext.</dd>
<dt>Invalid escape.</dt>
<dd>An unknown escape sequence was used with the inline escape construction
(<tt class="docutils literal"><span class="pre">E{...}</span></tt>).</dd>
<dt>Lists must be indented.</dt>
<dd>An unindented line immediately following a paragraph starts with a list
bullet. Epydoc is not sure whether you meant to start a new list item, or
meant for a paragraph to include a word that looks like a bullet. If you
intended the former, then indent the list. If you intended the latter, then
change the word-wrapping of the paragraph, or escape the first character of
the word that looks like a bullet.</dd>
<dt>Unbalanced '<tt class="docutils literal"><span class="pre">{</span></tt>'.</dt>
<dd>The docstring contains unbalanced braces. Epytext requires that all braces
must be balanced. To include a single unbalanced brace, use the escape
sequences <tt class="docutils literal"><span class="pre">E{lb}</span></tt> (left brace) and <tt class="docutils literal"><span class="pre">E{rb}</span></tt> (right brace).</dd>
<dt>Unbalanced '<tt class="docutils literal"><span class="pre">}</span></tt>'.</dt>
<dd>The docstring contains unbalanced braces. Epytext requires that all braces
must be balanced. To include a single unbalanced brace, use the escape
sequences <tt class="docutils literal"><span class="pre">E{lb}</span></tt> (left brace) and <tt class="docutils literal"><span class="pre">E{rb}</span></tt> (right brace).</dd>
<dt>Unknown inline markup tag.</dt>
<dd>An unknown tag was used with the inline markup construction (<tt class="docutils literal"><span class="pre">x{...}</span></tt>).</dd>
<dt>Wrong underline character for heading.</dt>
<dd>The underline character used for this section heading does not indicate an
appopriate section level. The '<tt class="docutils literal"><span class="pre">=</span></tt>' character should be used to underline
sections; '<tt class="docutils literal"><span class="pre">-</span></tt>' for subsections; and '<tt class="docutils literal"><span class="pre">~</span></tt>' for subsubsections.</dd>
</dl>
</div>
</div>
</div>
</div>
<table width="100%" class="navbox" cellpadding="1" cellspacing="0">
<tr>
<a class="nav" href="index.html">
<td align="center" width="20%" class="nav">
<a class="nav" href="index.html">
Home</a></td></a>
<a class="nav" href="installing.html">
<td align="center" width="20%" class="nav">
<a class="nav" href="installing.html">
Installing Epydoc</a></td></a>
<a class="nav" href="using.html">
<td align="center" width="20%" class="nav">
<a class="nav" href="using.html">
Using Epydoc</a></td></a>
<a class="nav" href="epytext.html">
<td align="center" width="20%" class="nav">
<a class="nav" href="epytext.html">
Epytext</a></td></a>
<td align="center" width="20%" class="nav">
<A href="http://sourceforge.net/projects/epydoc">
<IMG src="sflogo.png"
width="88" height="26" border="0" alt="SourceForge"
align="top"/></A></td>
</tr>
</table>
</body>
</html>
|