toolkit for mdBook [mirror of my GitHub repo] docs.tonywu.dev/mdbookkit/
permalinks rust-analyzer mdbook
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[docs] socials

+760 -40
+4
.gitattributes
··· 1 + *.png binary 2 + *.webp binary 3 + *.pxd binary 4 + 1 5 .prettierrc.* -linguist-detectable
+452 -27
Cargo.lock
··· 27 27 ] 28 28 29 29 [[package]] 30 + name = "allocator-api2" 31 + version = "0.2.21" 32 + source = "registry+https://github.com/rust-lang/crates.io-index" 33 + checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" 34 + 35 + [[package]] 30 36 name = "android-tzdata" 31 37 version = "0.1.1" 32 38 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 189 195 checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" 190 196 191 197 [[package]] 198 + name = "byteorder" 199 + version = "1.5.0" 200 + source = "registry+https://github.com/rust-lang/crates.io-index" 201 + checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 202 + 203 + [[package]] 192 204 name = "bytes" 193 205 version = "1.10.1" 194 206 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 299 311 "heck", 300 312 "proc-macro2", 301 313 "quote", 302 - "syn", 314 + "syn 2.0.100", 303 315 ] 304 316 305 317 [[package]] ··· 328 340 ] 329 341 330 342 [[package]] 343 + name = "convert_case" 344 + version = "0.4.0" 345 + source = "registry+https://github.com/rust-lang/crates.io-index" 346 + checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" 347 + 348 + [[package]] 331 349 name = "core-foundation" 332 350 version = "0.9.4" 333 351 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 372 390 ] 373 391 374 392 [[package]] 393 + name = "cssparser" 394 + version = "0.29.6" 395 + source = "registry+https://github.com/rust-lang/crates.io-index" 396 + checksum = "f93d03419cb5950ccfd3daf3ff1c7a36ace64609a1a8746d493df1ca0afde0fa" 397 + dependencies = [ 398 + "cssparser-macros", 399 + "dtoa-short", 400 + "itoa", 401 + "matches", 402 + "phf 0.10.1", 403 + "proc-macro2", 404 + "quote", 405 + "smallvec", 406 + "syn 1.0.109", 407 + ] 408 + 409 + [[package]] 410 + name = "cssparser-macros" 411 + version = "0.6.1" 412 + source = "registry+https://github.com/rust-lang/crates.io-index" 413 + checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" 414 + dependencies = [ 415 + "quote", 416 + "syn 2.0.100", 417 + ] 418 + 419 + [[package]] 375 420 name = "darling" 376 421 version = "0.20.10" 377 422 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 392 437 "proc-macro2", 393 438 "quote", 394 439 "strsim", 395 - "syn", 440 + "syn 2.0.100", 396 441 ] 397 442 398 443 [[package]] ··· 403 448 dependencies = [ 404 449 "darling_core", 405 450 "quote", 406 - "syn", 451 + "syn 2.0.100", 407 452 ] 408 453 409 454 [[package]] ··· 435 480 "darling", 436 481 "proc-macro2", 437 482 "quote", 438 - "syn", 483 + "syn 2.0.100", 439 484 ] 440 485 441 486 [[package]] ··· 445 490 checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" 446 491 dependencies = [ 447 492 "derive_builder_core", 448 - "syn", 493 + "syn 2.0.100", 494 + ] 495 + 496 + [[package]] 497 + name = "derive_more" 498 + version = "0.99.19" 499 + source = "registry+https://github.com/rust-lang/crates.io-index" 500 + checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" 501 + dependencies = [ 502 + "convert_case", 503 + "proc-macro2", 504 + "quote", 505 + "rustc_version", 506 + "syn 2.0.100", 449 507 ] 450 508 451 509 [[package]] ··· 487 545 dependencies = [ 488 546 "proc-macro2", 489 547 "quote", 490 - "syn", 548 + "syn 2.0.100", 549 + ] 550 + 551 + [[package]] 552 + name = "dtoa" 553 + version = "1.0.10" 554 + source = "registry+https://github.com/rust-lang/crates.io-index" 555 + checksum = "d6add3b8cff394282be81f3fc1a0605db594ed69890078ca6e2cab1c408bcf04" 556 + 557 + [[package]] 558 + name = "dtoa-short" 559 + version = "0.3.5" 560 + source = "registry+https://github.com/rust-lang/crates.io-index" 561 + checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" 562 + dependencies = [ 563 + "dtoa", 491 564 ] 492 565 493 566 [[package]] ··· 582 655 checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 583 656 584 657 [[package]] 658 + name = "foldhash" 659 + version = "0.1.5" 660 + source = "registry+https://github.com/rust-lang/crates.io-index" 661 + checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" 662 + 663 + [[package]] 585 664 name = "foreign-types" 586 665 version = "0.3.2" 587 666 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 649 728 dependencies = [ 650 729 "proc-macro2", 651 730 "quote", 652 - "syn", 731 + "syn 2.0.100", 653 732 ] 654 733 655 734 [[package]] ··· 683 762 ] 684 763 685 764 [[package]] 765 + name = "fxhash" 766 + version = "0.2.1" 767 + source = "registry+https://github.com/rust-lang/crates.io-index" 768 + checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" 769 + dependencies = [ 770 + "byteorder", 771 + ] 772 + 773 + [[package]] 686 774 name = "generic-array" 687 775 version = "0.14.7" 688 776 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 703 791 704 792 [[package]] 705 793 name = "getrandom" 794 + version = "0.1.16" 795 + source = "registry+https://github.com/rust-lang/crates.io-index" 796 + checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 797 + dependencies = [ 798 + "cfg-if", 799 + "libc", 800 + "wasi 0.9.0+wasi-snapshot-preview1", 801 + ] 802 + 803 + [[package]] 804 + name = "getrandom" 706 805 version = "0.2.15" 707 806 source = "registry+https://github.com/rust-lang/crates.io-index" 708 807 checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" ··· 800 899 ] 801 900 802 901 [[package]] 902 + name = "glob" 903 + version = "0.3.2" 904 + source = "registry+https://github.com/rust-lang/crates.io-index" 905 + checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" 906 + 907 + [[package]] 803 908 name = "h2" 804 909 version = "0.4.8" 805 910 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 839 944 version = "0.15.2" 840 945 source = "registry+https://github.com/rust-lang/crates.io-index" 841 946 checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" 947 + dependencies = [ 948 + "allocator-api2", 949 + "equivalent", 950 + "foldhash", 951 + ] 842 952 843 953 [[package]] 844 954 name = "heck" ··· 1111 1221 dependencies = [ 1112 1222 "proc-macro2", 1113 1223 "quote", 1114 - "syn", 1224 + "syn 2.0.100", 1115 1225 ] 1116 1226 1117 1227 [[package]] ··· 1223 1333 dependencies = [ 1224 1334 "proc-macro2", 1225 1335 "quote", 1226 - "syn", 1336 + "syn 2.0.100", 1227 1337 ] 1228 1338 1229 1339 [[package]] ··· 1342 1452 checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" 1343 1453 1344 1454 [[package]] 1455 + name = "lol_html" 1456 + version = "2.2.0" 1457 + source = "registry+https://github.com/rust-lang/crates.io-index" 1458 + checksum = "3b1058123f6262982b891dccc395cff0144d9439de366460b47fab719258b96e" 1459 + dependencies = [ 1460 + "bitflags 2.9.0", 1461 + "cfg-if", 1462 + "cssparser", 1463 + "encoding_rs", 1464 + "hashbrown", 1465 + "memchr", 1466 + "mime", 1467 + "selectors", 1468 + "thiserror 2.0.12", 1469 + ] 1470 + 1471 + [[package]] 1345 1472 name = "lsp-types" 1346 1473 version = "0.95.1" 1347 1474 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1355 1482 ] 1356 1483 1357 1484 [[package]] 1485 + name = "matches" 1486 + version = "0.1.10" 1487 + source = "registry+https://github.com/rust-lang/crates.io-index" 1488 + checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" 1489 + 1490 + [[package]] 1358 1491 name = "mdbook" 1359 1492 version = "0.4.47" 1360 1493 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1412 1545 "sha2", 1413 1546 "shlex", 1414 1547 "similar", 1415 - "syn", 1548 + "syn 2.0.100", 1416 1549 "tap", 1417 1550 "tempfile", 1418 1551 "tokio", ··· 1469 1602 1470 1603 [[package]] 1471 1604 name = "minijinja" 1472 - version = "2.8.0" 1605 + version = "2.9.0" 1473 1606 source = "registry+https://github.com/rust-lang/crates.io-index" 1474 - checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" 1607 + checksum = "98642a6dfca91122779a307b77cd07a4aa951fbe32232aaf5bad9febc66be754" 1475 1608 dependencies = [ 1476 1609 "serde", 1477 1610 ] ··· 1514 1647 ] 1515 1648 1516 1649 [[package]] 1650 + name = "nodrop" 1651 + version = "0.1.14" 1652 + source = "registry+https://github.com/rust-lang/crates.io-index" 1653 + checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" 1654 + 1655 + [[package]] 1517 1656 name = "normpath" 1518 1657 version = "1.3.0" 1519 1658 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1602 1741 dependencies = [ 1603 1742 "proc-macro2", 1604 1743 "quote", 1605 - "syn", 1744 + "syn 2.0.100", 1606 1745 ] 1607 1746 1608 1747 [[package]] ··· 1672 1811 "pest_meta", 1673 1812 "proc-macro2", 1674 1813 "quote", 1675 - "syn", 1814 + "syn 2.0.100", 1676 1815 ] 1677 1816 1678 1817 [[package]] ··· 1687 1826 ] 1688 1827 1689 1828 [[package]] 1829 + name = "phf" 1830 + version = "0.8.0" 1831 + source = "registry+https://github.com/rust-lang/crates.io-index" 1832 + checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" 1833 + dependencies = [ 1834 + "phf_shared 0.8.0", 1835 + ] 1836 + 1837 + [[package]] 1838 + name = "phf" 1839 + version = "0.10.1" 1840 + source = "registry+https://github.com/rust-lang/crates.io-index" 1841 + checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" 1842 + dependencies = [ 1843 + "phf_macros", 1844 + "phf_shared 0.10.0", 1845 + "proc-macro-hack", 1846 + ] 1847 + 1848 + [[package]] 1849 + name = "phf_codegen" 1850 + version = "0.8.0" 1851 + source = "registry+https://github.com/rust-lang/crates.io-index" 1852 + checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" 1853 + dependencies = [ 1854 + "phf_generator 0.8.0", 1855 + "phf_shared 0.8.0", 1856 + ] 1857 + 1858 + [[package]] 1859 + name = "phf_generator" 1860 + version = "0.8.0" 1861 + source = "registry+https://github.com/rust-lang/crates.io-index" 1862 + checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" 1863 + dependencies = [ 1864 + "phf_shared 0.8.0", 1865 + "rand 0.7.3", 1866 + ] 1867 + 1868 + [[package]] 1869 + name = "phf_generator" 1870 + version = "0.10.0" 1871 + source = "registry+https://github.com/rust-lang/crates.io-index" 1872 + checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" 1873 + dependencies = [ 1874 + "phf_shared 0.10.0", 1875 + "rand 0.8.5", 1876 + ] 1877 + 1878 + [[package]] 1879 + name = "phf_macros" 1880 + version = "0.10.0" 1881 + source = "registry+https://github.com/rust-lang/crates.io-index" 1882 + checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" 1883 + dependencies = [ 1884 + "phf_generator 0.10.0", 1885 + "phf_shared 0.10.0", 1886 + "proc-macro-hack", 1887 + "proc-macro2", 1888 + "quote", 1889 + "syn 1.0.109", 1890 + ] 1891 + 1892 + [[package]] 1893 + name = "phf_shared" 1894 + version = "0.8.0" 1895 + source = "registry+https://github.com/rust-lang/crates.io-index" 1896 + checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" 1897 + dependencies = [ 1898 + "siphasher", 1899 + ] 1900 + 1901 + [[package]] 1902 + name = "phf_shared" 1903 + version = "0.10.0" 1904 + source = "registry+https://github.com/rust-lang/crates.io-index" 1905 + checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" 1906 + dependencies = [ 1907 + "siphasher", 1908 + ] 1909 + 1910 + [[package]] 1690 1911 name = "pin-project" 1691 1912 version = "1.1.10" 1692 1913 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1703 1924 dependencies = [ 1704 1925 "proc-macro2", 1705 1926 "quote", 1706 - "syn", 1927 + "syn 2.0.100", 1707 1928 ] 1708 1929 1709 1930 [[package]] ··· 1740 1961 ] 1741 1962 1742 1963 [[package]] 1964 + name = "ppv-lite86" 1965 + version = "0.2.21" 1966 + source = "registry+https://github.com/rust-lang/crates.io-index" 1967 + checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" 1968 + dependencies = [ 1969 + "zerocopy", 1970 + ] 1971 + 1972 + [[package]] 1973 + name = "precomputed-hash" 1974 + version = "0.1.1" 1975 + source = "registry+https://github.com/rust-lang/crates.io-index" 1976 + checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" 1977 + 1978 + [[package]] 1979 + name = "proc-macro-hack" 1980 + version = "0.5.20+deprecated" 1981 + source = "registry+https://github.com/rust-lang/crates.io-index" 1982 + checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" 1983 + 1984 + [[package]] 1743 1985 name = "proc-macro2" 1744 1986 version = "1.0.94" 1745 1987 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1804 2046 ] 1805 2047 1806 2048 [[package]] 2049 + name = "rand" 2050 + version = "0.7.3" 2051 + source = "registry+https://github.com/rust-lang/crates.io-index" 2052 + checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 2053 + dependencies = [ 2054 + "getrandom 0.1.16", 2055 + "libc", 2056 + "rand_chacha 0.2.2", 2057 + "rand_core 0.5.1", 2058 + "rand_hc", 2059 + "rand_pcg", 2060 + ] 2061 + 2062 + [[package]] 2063 + name = "rand" 2064 + version = "0.8.5" 2065 + source = "registry+https://github.com/rust-lang/crates.io-index" 2066 + checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 2067 + dependencies = [ 2068 + "libc", 2069 + "rand_chacha 0.3.1", 2070 + "rand_core 0.6.4", 2071 + ] 2072 + 2073 + [[package]] 2074 + name = "rand_chacha" 2075 + version = "0.2.2" 2076 + source = "registry+https://github.com/rust-lang/crates.io-index" 2077 + checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 2078 + dependencies = [ 2079 + "ppv-lite86", 2080 + "rand_core 0.5.1", 2081 + ] 2082 + 2083 + [[package]] 2084 + name = "rand_chacha" 2085 + version = "0.3.1" 2086 + source = "registry+https://github.com/rust-lang/crates.io-index" 2087 + checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 2088 + dependencies = [ 2089 + "ppv-lite86", 2090 + "rand_core 0.6.4", 2091 + ] 2092 + 2093 + [[package]] 2094 + name = "rand_core" 2095 + version = "0.5.1" 2096 + source = "registry+https://github.com/rust-lang/crates.io-index" 2097 + checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 2098 + dependencies = [ 2099 + "getrandom 0.1.16", 2100 + ] 2101 + 2102 + [[package]] 2103 + name = "rand_core" 2104 + version = "0.6.4" 2105 + source = "registry+https://github.com/rust-lang/crates.io-index" 2106 + checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 2107 + dependencies = [ 2108 + "getrandom 0.2.15", 2109 + ] 2110 + 2111 + [[package]] 2112 + name = "rand_hc" 2113 + version = "0.2.0" 2114 + source = "registry+https://github.com/rust-lang/crates.io-index" 2115 + checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 2116 + dependencies = [ 2117 + "rand_core 0.5.1", 2118 + ] 2119 + 2120 + [[package]] 2121 + name = "rand_pcg" 2122 + version = "0.2.1" 2123 + source = "registry+https://github.com/rust-lang/crates.io-index" 2124 + checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" 2125 + dependencies = [ 2126 + "rand_core 0.5.1", 2127 + ] 2128 + 2129 + [[package]] 1807 2130 name = "redox_users" 1808 2131 version = "0.5.0" 1809 2132 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1909 2232 checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 1910 2233 1911 2234 [[package]] 2235 + name = "rustc_version" 2236 + version = "0.4.1" 2237 + source = "registry+https://github.com/rust-lang/crates.io-index" 2238 + checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" 2239 + dependencies = [ 2240 + "semver", 2241 + ] 2242 + 2243 + [[package]] 1912 2244 name = "rustix" 1913 2245 version = "0.38.44" 1914 2246 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2018 2350 ] 2019 2351 2020 2352 [[package]] 2353 + name = "selectors" 2354 + version = "0.24.0" 2355 + source = "registry+https://github.com/rust-lang/crates.io-index" 2356 + checksum = "0c37578180969d00692904465fb7f6b3d50b9a2b952b87c23d0e2e5cb5013416" 2357 + dependencies = [ 2358 + "bitflags 1.3.2", 2359 + "cssparser", 2360 + "derive_more", 2361 + "fxhash", 2362 + "log", 2363 + "phf 0.8.0", 2364 + "phf_codegen", 2365 + "precomputed-hash", 2366 + "servo_arc", 2367 + "smallvec", 2368 + ] 2369 + 2370 + [[package]] 2371 + name = "semver" 2372 + version = "1.0.26" 2373 + source = "registry+https://github.com/rust-lang/crates.io-index" 2374 + checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" 2375 + 2376 + [[package]] 2021 2377 name = "serde" 2022 2378 version = "1.0.219" 2023 2379 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2034 2390 dependencies = [ 2035 2391 "proc-macro2", 2036 2392 "quote", 2037 - "syn", 2393 + "syn 2.0.100", 2038 2394 ] 2039 2395 2040 2396 [[package]] ··· 2057 2413 dependencies = [ 2058 2414 "proc-macro2", 2059 2415 "quote", 2060 - "syn", 2416 + "syn 2.0.100", 2061 2417 ] 2062 2418 2063 2419 [[package]] ··· 2082 2438 ] 2083 2439 2084 2440 [[package]] 2441 + name = "servo_arc" 2442 + version = "0.2.0" 2443 + source = "registry+https://github.com/rust-lang/crates.io-index" 2444 + checksum = "d52aa42f8fdf0fed91e5ce7f23d8138441002fa31dca008acf47e6fd4721f741" 2445 + dependencies = [ 2446 + "nodrop", 2447 + "stable_deref_trait", 2448 + ] 2449 + 2450 + [[package]] 2085 2451 name = "sha2" 2086 2452 version = "0.10.8" 2087 2453 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2114 2480 checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" 2115 2481 2116 2482 [[package]] 2483 + name = "siphasher" 2484 + version = "0.3.11" 2485 + source = "registry+https://github.com/rust-lang/crates.io-index" 2486 + checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" 2487 + 2488 + [[package]] 2117 2489 name = "slab" 2118 2490 version = "0.4.9" 2119 2491 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2179 2551 2180 2552 [[package]] 2181 2553 name = "syn" 2554 + version = "1.0.109" 2555 + source = "registry+https://github.com/rust-lang/crates.io-index" 2556 + checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 2557 + dependencies = [ 2558 + "proc-macro2", 2559 + "quote", 2560 + "unicode-ident", 2561 + ] 2562 + 2563 + [[package]] 2564 + name = "syn" 2182 2565 version = "2.0.100" 2183 2566 source = "registry+https://github.com/rust-lang/crates.io-index" 2184 2567 checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" ··· 2205 2588 dependencies = [ 2206 2589 "proc-macro2", 2207 2590 "quote", 2208 - "syn", 2591 + "syn 2.0.100", 2209 2592 ] 2210 2593 2211 2594 [[package]] ··· 2294 2677 dependencies = [ 2295 2678 "proc-macro2", 2296 2679 "quote", 2297 - "syn", 2680 + "syn 2.0.100", 2298 2681 ] 2299 2682 2300 2683 [[package]] ··· 2305 2688 dependencies = [ 2306 2689 "proc-macro2", 2307 2690 "quote", 2308 - "syn", 2691 + "syn 2.0.100", 2309 2692 ] 2310 2693 2311 2694 [[package]] ··· 2343 2726 dependencies = [ 2344 2727 "proc-macro2", 2345 2728 "quote", 2346 - "syn", 2729 + "syn 2.0.100", 2347 2730 ] 2348 2731 2349 2732 [[package]] ··· 2486 2869 dependencies = [ 2487 2870 "proc-macro2", 2488 2871 "quote", 2489 - "syn", 2872 + "syn 2.0.100", 2490 2873 ] 2491 2874 2492 2875 [[package]] ··· 2597 2980 ] 2598 2981 2599 2982 [[package]] 2983 + name = "util-mdbook-socials" 2984 + version = "0.1.0" 2985 + dependencies = [ 2986 + "anyhow", 2987 + "clap", 2988 + "glob", 2989 + "lol_html", 2990 + "minijinja", 2991 + "serde", 2992 + "serde_json", 2993 + "tap", 2994 + "toml 0.5.11", 2995 + "url", 2996 + ] 2997 + 2998 + [[package]] 2600 2999 name = "util-rust-analyzer" 2601 3000 version = "0.0.0" 2602 3001 dependencies = [ ··· 2657 3056 2658 3057 [[package]] 2659 3058 name = "wasi" 3059 + version = "0.9.0+wasi-snapshot-preview1" 3060 + source = "registry+https://github.com/rust-lang/crates.io-index" 3061 + checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 3062 + 3063 + [[package]] 3064 + name = "wasi" 2660 3065 version = "0.11.0+wasi-snapshot-preview1" 2661 3066 source = "registry+https://github.com/rust-lang/crates.io-index" 2662 3067 checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" ··· 2692 3097 "log", 2693 3098 "proc-macro2", 2694 3099 "quote", 2695 - "syn", 3100 + "syn 2.0.100", 2696 3101 "wasm-bindgen-shared", 2697 3102 ] 2698 3103 ··· 2727 3132 dependencies = [ 2728 3133 "proc-macro2", 2729 3134 "quote", 2730 - "syn", 3135 + "syn 2.0.100", 2731 3136 "wasm-bindgen-backend", 2732 3137 "wasm-bindgen-shared", 2733 3138 ] ··· 3044 3449 dependencies = [ 3045 3450 "proc-macro2", 3046 3451 "quote", 3047 - "syn", 3452 + "syn 2.0.100", 3048 3453 "synstructure", 3049 3454 ] 3050 3455 3051 3456 [[package]] 3457 + name = "zerocopy" 3458 + version = "0.8.24" 3459 + source = "registry+https://github.com/rust-lang/crates.io-index" 3460 + checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" 3461 + dependencies = [ 3462 + "zerocopy-derive", 3463 + ] 3464 + 3465 + [[package]] 3466 + name = "zerocopy-derive" 3467 + version = "0.8.24" 3468 + source = "registry+https://github.com/rust-lang/crates.io-index" 3469 + checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" 3470 + dependencies = [ 3471 + "proc-macro2", 3472 + "quote", 3473 + "syn 2.0.100", 3474 + ] 3475 + 3476 + [[package]] 3052 3477 name = "zerofrom" 3053 3478 version = "0.1.6" 3054 3479 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3065 3490 dependencies = [ 3066 3491 "proc-macro2", 3067 3492 "quote", 3068 - "syn", 3493 + "syn 2.0.100", 3069 3494 "synstructure", 3070 3495 ] 3071 3496 ··· 3094 3519 dependencies = [ 3095 3520 "proc-macro2", 3096 3521 "quote", 3097 - "syn", 3522 + "syn 2.0.100", 3098 3523 ]
+1
Cargo.toml
··· 26 26 miette = { version = "7.5.0", features = [ 27 27 "fancy-no-backtrace", 28 28 ], default-features = false } 29 + minijinja = "2.9.0" 29 30 pulldown-cmark = "0.13.0" 30 31 pulldown-cmark-to-cmark = "21.0.0" 31 32 serde = { version = "1", features = ["derive"] }
+2 -12
docs/app/build/build.ts
··· 37 37 namespace: "file", 38 38 }, 39 39 ({ path, kind }) => 40 - kind === "import-rule" 41 - ? { 42 - path, 43 - namespace: "remote-css", 44 - } 45 - : undefined, 40 + kind === "import-rule" ? { path, namespace: "remote-css" } : undefined, 46 41 ); 47 42 48 43 build.onResolve( ··· 51 46 namespace: "remote-css", 52 47 }, 53 48 ({ path, kind }) => 54 - kind === "url-token" 55 - ? { 56 - path, 57 - namespace: "remote-url", 58 - } 59 - : undefined, 49 + kind === "url-token" ? { path, namespace: "remote-url" } : undefined, 60 50 ); 61 51 62 52 build.onLoad(
docs/app/socials.pxd

This is a binary file and will not be displayed.

+16
docs/book.toml
··· 55 55 56 56 [preprocessor.app] 57 57 command = "deno run -A app/build/preprocessor.ts" 58 + 59 + [_metadata] 60 + base-url = "https://tonywu6.github.io/mdbookkit/" 61 + default-theme-color = "#0f1419" 62 + 63 + [_metadata.socials."/"] 64 + image = "src/media/social.png" 65 + title = "mdbookkit" 66 + 67 + [_metadata.socials."/rustdoc-link"] 68 + image = "src/rustdoc-link/media/social.png" 69 + title = "mdbook-rustdoc-link" 70 + 71 + [_metadata.socials."/link-forever"] 72 + image = "src/link-forever/media/social.png" 73 + title = "mdbook-link-forever"
+4
docs/src/SUMMARY.md
··· 1 1 # Summary 2 2 3 + [mdbookkit](index.md) 4 + 5 + --- 6 + 3 7 - [rustdoc-link](rustdoc-link.md) 4 8 - [Getting started](rustdoc-link/getting-started.md) 5 9 - [Motivation](rustdoc-link/motivation.md)
+1
docs/src/index.md
··· 1 + # mdbookkit
docs/src/media/social.png

This is a binary file and will not be displayed.

docs/src/rustdoc-link/media/social.png

This is a binary file and will not be displayed.

+1 -1
utils/clap-reflect/Cargo.toml
··· 13 13 anyhow = { workspace = true } 14 14 clap = { workspace = true } 15 15 mdbook = { workspace = true } 16 - minijinja = { version = "2.8.0" } 16 + minijinja = { workspace = true } 17 17 serde = { workspace = true } 18 18 serde_json = { workspace = true } 19 19 tap = { workspace = true }
+22
utils/mdbook-socials/Cargo.toml
··· 1 + [package] 2 + name = "util-mdbook-socials" 3 + version = "0.1.0" 4 + 5 + authors.workspace = true 6 + edition.workspace = true 7 + license.workspace = true 8 + publish.workspace = true 9 + repository.workspace = true 10 + rust-version.workspace = true 11 + 12 + [dependencies] 13 + anyhow = { workspace = true } 14 + clap = { workspace = true } 15 + glob = "0.3.2" 16 + lol_html = "2.2.0" 17 + minijinja = { workspace = true } 18 + serde = { workspace = true } 19 + serde_json = { workspace = true } 20 + tap = { workspace = true } 21 + toml = { workspace = true } 22 + url = { workspace = true, features = ["serde"] }
+257
utils/mdbook-socials/src/main.rs
··· 1 + use std::{collections::HashMap, path::PathBuf}; 2 + 3 + use anyhow::{Context, Result}; 4 + use clap::Parser; 5 + use glob::glob; 6 + use lol_html::{ 7 + element, html_content::ContentType, rewrite_str, text, HtmlRewriter, RewriteStrSettings, 8 + Settings, 9 + }; 10 + use minijinja::Environment; 11 + use serde::Deserialize; 12 + use serde_json::json; 13 + use tap::{Pipe, Tap}; 14 + use url::Url; 15 + 16 + fn main() -> Result<()> { 17 + let Program { root_dir } = Program::parse(); 18 + 19 + let jinja = 20 + Environment::new().tap_mut(|env| env.add_template("index.html", OPEN_GRAPH).unwrap()); 21 + 22 + let root_dir = std::fs::canonicalize(root_dir)? 23 + .pipe(Url::from_directory_path) 24 + .unwrap(); 25 + 26 + let book_toml_path = root_dir.join("book.toml")?; 27 + 28 + let book_toml = book_toml_path 29 + .path() 30 + .pipe(std::fs::read_to_string)? 31 + .pipe_deref(toml::from_str::<BookToml>)?; 32 + 33 + let src_dir = book_toml.book.src.as_deref().unwrap_or("src"); 34 + let src_dir = root_dir.join(&format!("{src_dir}/"))?; 35 + 36 + let out_dir = book_toml.build.build_dir.as_deref().unwrap_or("book"); 37 + let out_dir = root_dir.join(&format!("{out_dir}/"))?; 38 + 39 + let metadata = book_toml 40 + .metadata 41 + .socials 42 + .0 43 + .into_iter() 44 + .map(|(prefix, metadata)| -> Result<(_, PageMetadata)> { 45 + let image = match metadata.image { 46 + None => return Ok((prefix, metadata)), 47 + Some(image) => image, 48 + }; 49 + let image = book_toml_path.join(&image)?; 50 + let image = src_dir 51 + .make_relative(&image) 52 + .context("failed to make relative path to image")?; 53 + let image = book_toml.metadata.base_url.join(&image)?; 54 + let metadata = PageMetadata { 55 + title: metadata.title, 56 + image: Some(image.to_string()), 57 + }; 58 + Ok((prefix, metadata)) 59 + }) 60 + .collect::<Result<Vec<_>>>()? 61 + .tap_mut(|metadata| metadata.sort_by(|(p1, _), (p2, _)| p1.cmp(p2))); 62 + 63 + let theme_color = book_toml 64 + .metadata 65 + .default_theme_color 66 + .as_deref() 67 + .unwrap_or("#00000000"); 68 + 69 + for path in glob(out_dir.join("**/*.html")?.path())? { 70 + let url = Url::from_file_path(path?).unwrap(); 71 + 72 + let pathname = out_dir 73 + .make_relative(&url) 74 + .context("failed to get page pathname")?; 75 + 76 + let src_path = src_dir.join(&pathname.replace(".html", ".md"))?; 77 + 78 + if !std::fs::exists(src_path.path()).unwrap_or(false) { 79 + continue; 80 + } 81 + 82 + let html = std::fs::read_to_string(url.path())?; 83 + 84 + let (og_title, og_description) = { 85 + let mut title = String::new(); 86 + let mut description = String::new(); 87 + 88 + Settings { 89 + element_content_handlers: vec![ 90 + text!("main > h1", |text| { 91 + title.push_str(text.as_str()); 92 + Ok(()) 93 + }), 94 + text!("main > p:first-of-type", |text| { 95 + description.push_str(text.as_str()); 96 + Ok(()) 97 + }), 98 + ], 99 + ..Default::default() 100 + } 101 + .pipe(|settings| HtmlRewriter::new(settings, |_: &[u8]| ())) 102 + .pipe(|mut wr| wr.write(html.as_bytes()).and(Ok(wr)))? 103 + .pipe(|wr| wr.end())?; 104 + 105 + (collapse_whitespace(title), collapse_whitespace(description)) 106 + }; 107 + 108 + let pathname = pathname 109 + .replace("index.html", "") 110 + .replace(".html", "") 111 + .pipe(|p| format!("/{p}")); 112 + 113 + let title = metadata 114 + .iter() 115 + .filter_map(|(prefix, metadata)| { 116 + let title = metadata.title.as_ref()?; 117 + if pathname.starts_with(prefix) && &pathname != prefix 118 + // pathname != prefix because subroute index page 119 + // should already have a sensible title 120 + { 121 + Some(title.as_str()) 122 + } else { 123 + None 124 + } 125 + }) 126 + .chain(std::iter::once(og_title.as_str())) 127 + .rev() 128 + .collect::<Vec<_>>() 129 + .join(" | "); 130 + 131 + let og_image = metadata.iter().rev().find_map(|(prefix, metadata)| { 132 + if !pathname.starts_with(prefix) { 133 + None 134 + } else { 135 + metadata.image.as_ref()?.parse::<Url>().ok() 136 + } 137 + }); 138 + 139 + let og_url = book_toml.metadata.base_url.join(&pathname[1..])?; 140 + 141 + let og_site_name = book_toml.book.title.as_deref(); 142 + 143 + let ctx = json!({ 144 + "og_title": og_title, 145 + "og_image": og_image, 146 + "og_url": og_url, 147 + "og_description": og_description, 148 + "og_site_name": og_site_name, 149 + }); 150 + 151 + let html = RewriteStrSettings { 152 + element_content_handlers: vec![ 153 + element!("title", |elem| { 154 + elem.set_inner_content(&title, ContentType::Text); 155 + Ok(()) 156 + }), 157 + element!(r#"meta[property^="og"]"#, |elem| { 158 + elem.remove(); 159 + Ok(()) 160 + }), 161 + element!(r#"meta[name="description"]"#, |elem| { 162 + let meta = jinja.get_template("index.html").unwrap().render(&ctx)?; 163 + elem.set_attribute("content", &og_description)?; 164 + elem.before(&meta, ContentType::Html); 165 + Ok(()) 166 + }), 167 + element!(r#"meta[name="theme-color"]"#, |elem| { 168 + elem.set_attribute("content", theme_color)?; 169 + Ok(()) 170 + }), 171 + ], 172 + ..Default::default() 173 + } 174 + .pipe(|settings| rewrite_str(&html, settings))?; 175 + 176 + std::fs::write(url.path(), html)?; 177 + } 178 + 179 + Ok(()) 180 + } 181 + 182 + static OPEN_GRAPH: &str = r#" 183 + <meta property="og:type" content="article"> 184 + <meta property="og:title" content="{{ og_title }}"> 185 + <meta property="og:url" content="{{ og_url }}"> 186 + <meta property="og:image" content="{{ og_image }}"> 187 + <meta property="og:description" content="{{ og_description }}"> 188 + <meta property="og:site_name" content="{{ og_site_name }}"> 189 + "#; 190 + 191 + #[derive(Parser)] 192 + struct Program { 193 + root_dir: PathBuf, 194 + } 195 + 196 + #[derive(Deserialize)] 197 + #[serde(rename_all = "kebab-case")] 198 + struct BookToml { 199 + book: BookConfig, 200 + build: BuildConfig, 201 + #[serde(rename = "_metadata")] 202 + metadata: MetadataConfig, 203 + } 204 + 205 + #[derive(Deserialize)] 206 + #[serde(rename_all = "kebab-case")] 207 + struct BookConfig { 208 + #[serde(default)] 209 + title: Option<String>, 210 + #[serde(default)] 211 + src: Option<String>, 212 + } 213 + 214 + #[derive(Deserialize)] 215 + #[serde(rename_all = "kebab-case")] 216 + struct BuildConfig { 217 + #[serde(default)] 218 + build_dir: Option<String>, 219 + } 220 + 221 + #[derive(Deserialize)] 222 + #[serde(rename_all = "kebab-case")] 223 + struct MetadataConfig { 224 + base_url: Url, 225 + #[serde(default)] 226 + default_theme_color: Option<String>, 227 + #[serde(default)] 228 + socials: Socials, 229 + } 230 + 231 + #[derive(Deserialize, Default)] 232 + struct Socials(HashMap<String, PageMetadata>); 233 + 234 + #[derive(Deserialize)] 235 + #[serde(rename_all = "kebab-case")] 236 + struct PageMetadata { 237 + title: Option<String>, 238 + image: Option<String>, 239 + } 240 + 241 + fn collapse_whitespace(src: String) -> String { 242 + src.chars() 243 + .fold( 244 + (String::with_capacity(src.len()), None), 245 + |(mut out, last), ch| { 246 + if matches!(ch, ' ' | '\n' | '\t') { 247 + if !matches!(last, Some(' ' | '\n' | '\t') | None) { 248 + out.push(' '); 249 + } 250 + } else { 251 + out.push(ch); 252 + } 253 + (out, Some(ch)) 254 + }, 255 + ) 256 + .0 257 + }