Compare commits
739 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f3fd06ef7a | |||
| d97721f38b | |||
| 8d3ec8605e | |||
| 7517389072 | |||
| b7011139cf | |||
| 6e8a68dd0d | |||
| 4e8309d3e4 | |||
| 371ab21d16 | |||
| cbcbc4bc3f | |||
| dc9b2e1766 | |||
| 334df62651 | |||
| 046353cf7e | |||
| 51f2f032d7 | |||
| 70360edb96 | |||
| 2b12ab9206 | |||
| 87a01e04ce | |||
| 5f04200bd0 | |||
| aa823b5a2d | |||
| 9012dee888 | |||
| 81d5f1a8bb | |||
| d2b0a22a8f | |||
| 355e6b1f18 | |||
| 7a2c9107c3 | |||
| 127473fff8 | |||
| 9a79b0a800 | |||
| ca13298d00 | |||
| eaf82e6367 | |||
| cae290ded7 | |||
| a22208a0be | |||
| bc877dc9dc | |||
| 40b1775d42 | |||
| c2dc605adb | |||
| a1e1af07a4 | |||
| 76948130f6 | |||
| f71ba31bfe | |||
| b7caa228e6 | |||
| 0101dd2f65 | |||
| c8baa61fe3 | |||
| 104335706a | |||
| 7c60841bad | |||
| f6a7c57175 | |||
| 730acee609 | |||
| b7295df662 | |||
| aba3ec37d9 | |||
| 020c98bfad | |||
| d33d11e086 | |||
| 2e41751cf6 | |||
| f493150825 | |||
| 68d0dd0cd5 | |||
| 38fc7e69c1 | |||
| 5b7b9f40ae | |||
| 17162aa091 | |||
| 0c89aa2b3e | |||
| 1980e39876 | |||
| 2b949014b8 | |||
| b399496ec2 | |||
| 8433327926 | |||
| bb207f43d0 | |||
| 333af9b76c | |||
| 18a16665cc | |||
| 6c0796733d | |||
| 97ed5a7c57 | |||
| c87c8c446e | |||
| bfbfb21c17 | |||
| 137728cdab | |||
| 3f7fd21d4a | |||
| 2204cef0ef | |||
| 29ad7127d1 | |||
| 123518b940 | |||
| dbe849707a | |||
| 986a76cf8e | |||
| 42439033c8 | |||
| 421ff18788 | |||
| 519a275ff0 | |||
| 5a95f79b32 | |||
| 627ee5bbbe | |||
| a9d300341c | |||
| 6b7e912010 | |||
| 4feae80814 | |||
| 5f5730fe2e | |||
| 5f784f5e10 | |||
| 35a44efafd | |||
| b32dcfa8dd | |||
| 38fc32bbdd | |||
| 6c7b12ae5e | |||
| 649e19bdb1 | |||
| a4266170ea | |||
| 6e6d9d8c1f | |||
| e49758334f | |||
| 580068212d | |||
| 504278d9ba | |||
| 214056a88a | |||
| e310f76030 | |||
| 83abe62125 | |||
| 8e7a714991 | |||
| 4f67710ed2 | |||
| 8ec8be5db3 | |||
| 92da563211 | |||
| 2eb5a7e4b8 | |||
| 23110d5f05 | |||
| 18de3272e3 | |||
| 1e81c42818 | |||
| ef6e0e8a07 | |||
| ba575b886d | |||
| c8f856109d | |||
| 4035c579c7 | |||
| 8bab3de510 | |||
| 9ab4bbb17c | |||
| ae024eb3b3 | |||
| db84653bf2 | |||
| d8ebba114f | |||
| b9d7375dba | |||
| 676811206d | |||
| ff1baf0036 | |||
| 3d12aeb8b2 | |||
| 5a8750a975 | |||
| 0cb303f09f | |||
| edc7d0b50b | |||
| 2c268a9f8c | |||
| d61a09d421 | |||
| 0eee014a8b | |||
| 76f6b6e81c | |||
| 40215c3da2 | |||
| 1056d5cf16 | |||
| f74c6c1706 | |||
| 821614e45a | |||
| 32e8618ed4 | |||
| e123611fed | |||
| 5c3394c227 | |||
| da6708e61d | |||
| c99da8ff34 | |||
| 9ab308412c | |||
| 4efcba6ceb | |||
| ca7c708bf9 | |||
| 1f70dca752 | |||
| d32c5a88f7 | |||
| b209127000 | |||
| 6e37601b25 | |||
| 23b97daa84 | |||
| 7329b7595d | |||
| f0bb300e03 | |||
| 6a1ea82ff1 | |||
| 6011deb930 | |||
| 28bfe02411 | |||
| 862c6d5d2e | |||
| 4c491a01db | |||
| 16676e0788 | |||
| ebf46629b1 | |||
| 36811490d0 | |||
| f0122cebb5 | |||
| e2804d6313 | |||
| ae7ed4eafa | |||
| aae320ddff | |||
| a71cb40bdf | |||
| 2ba5d389a8 | |||
| f1e8d30a43 | |||
| e6ee27a083 | |||
| 4008bf12e7 | |||
| 0b1d7ab01c | |||
| a45101cfe9 | |||
| d5970d6274 | |||
| 83f4ccfa70 | |||
| 707648bde8 | |||
| 0707205374 | |||
| f6f81b39f8 | |||
| f8829c68d6 | |||
| 54bbd1d789 | |||
| ee267f72a2 | |||
| f516b1cb79 | |||
| 0e4c8342ab | |||
| 6f61ddae77 | |||
| e312641cbd | |||
| 07de956b1d | |||
| 4d549b1660 | |||
| e1a13aef1f | |||
| cc3eb233c7 | |||
| f0b04f1334 | |||
| 9b89e31679 | |||
| 2b380ee6bc | |||
| caf4da73e2 | |||
| 56e36df6bd | |||
| c8fed4d50d | |||
| c619920452 | |||
| 70ede99545 | |||
| 9862c51e3f | |||
| f0dbc2801b | |||
| 7c65d65cb1 | |||
| 5dd6c40933 | |||
| 5487563a71 | |||
| 7458e396ee | |||
| 8f104ec09c | |||
| 8fe4c614db | |||
| c137c2af4b | |||
| 2402c9ef3b | |||
| bbe609974a | |||
| 88c624877e | |||
| 41d7cf75c5 | |||
| 9da11dba10 | |||
| d1857e5824 | |||
| fc64d88ce9 | |||
| 3713890b5e | |||
| efaa6a0ba2 | |||
| d55a3432a2 | |||
| 0fda253457 | |||
| 2216d67d5a | |||
| a04af6c638 | |||
| 91c04cd44c | |||
| 1c98a787ab | |||
| 87902f258a | |||
| 3740a7f6ff | |||
| b6b176fdc1 | |||
| 77aaeef5ff | |||
| d1b1375629 | |||
| 569eac3a06 | |||
| a5ecb772ae | |||
| 736897a168 | |||
| c1f6f0b429 | |||
| 9fd9acb573 | |||
| beff52a68e | |||
| cc33d81473 | |||
| 1a27f04577 | |||
| 2f2487150a | |||
| 6d44bd7bc8 | |||
| e2d9d1f4d5 | |||
| 958410146b | |||
| 0a9b9ff709 | |||
| bce9800142 | |||
| 7f07f652d4 | |||
| 1b5f0b910b | |||
| e1aa4c02a0 | |||
| 976f55e1b2 | |||
| 29a8b893f1 | |||
| c991149422 | |||
| 175c0ceab5 | |||
| 9d48ea0079 | |||
| 042ad2d8c4 | |||
| 19868a10ef | |||
| 92b17f9053 | |||
| 2dc527b60f | |||
| fa08ce35cc | |||
| 8413e5b5ee | |||
| aa16f6ba2a | |||
| 22e0fdc822 | |||
| 0de56202e9 | |||
| bcec052e35 | |||
| e28a41bb8f | |||
| 17c574467f | |||
| 8f350976a1 | |||
| dfb4281a14 | |||
| 7881237de2 | |||
| 05daab661e | |||
| c0e6de899b | |||
| c103f3ebdc | |||
| 7cabd684a9 | |||
| af344c1d25 | |||
| b40a344c49 | |||
| e0a2b183ad | |||
| 97857d0e3f | |||
| 6fcfe7895e | |||
| f5f655e3a1 | |||
| 94fe2f59d3 | |||
| 66fd8eef1f | |||
| fb5c65827d | |||
| bb79cf5ce6 | |||
| f72e8610da | |||
| b76a250596 | |||
| 2aea55a92c | |||
| 073137af7d | |||
| e966de6922 | |||
| 616c004058 | |||
| 59bb48340e | |||
| 7ec80bf2f1 | |||
| 006dd36078 | |||
| 58225c7c20 | |||
| 04501c205a | |||
| 253ba89f90 | |||
| 7f598cb49e | |||
| d3402dded2 | |||
| f222efd281 | |||
| 8f6c19b3fd | |||
| f44367c31b | |||
| c31c68200b | |||
| ddfaf8c091 | |||
| ca9702088f | |||
| 413e962871 | |||
| 848cef26ee | |||
| b40b3aa9fc | |||
| ae853e074a | |||
| f4838d12c6 | |||
| 4eb7fd211c | |||
| efd1d3992d | |||
| d4a9da0db5 | |||
| bde72cb52e | |||
| f251e0f556 | |||
| 5de2442540 | |||
| b5c4fdcc83 | |||
| b50872497e | |||
| 6d0b42b18f | |||
| 70bf766cd0 | |||
| 104c959bf7 | |||
| 3c4c2a072c | |||
| 769f8ec8d6 | |||
| 64c4ee9c05 | |||
| 6857995442 | |||
| eade94dcfd | |||
| daef5fe9d2 | |||
| b8629729b9 | |||
| 4e2b1442bd | |||
| 83fbb16c3b | |||
| d2ea03fbb9 | |||
| b1ac06cd5f | |||
| 19751ec37f | |||
| 814caff755 | |||
| 8d611ea25a | |||
| 1a8b6d6823 | |||
| 78289a53bb | |||
| 303796c773 | |||
| 825f43c429 | |||
| 454b5e94dc | |||
| 7ddbab76c1 | |||
| 6475394133 | |||
| 874c20e69f | |||
| b93083667d | |||
| 8f7108c56f | |||
| a6167d88cd | |||
| 197a2bd57b | |||
| fd73eb6d05 | |||
| 963eb24fce | |||
| 5c5bfc71bd | |||
| 3b9af34e0d | |||
| daaa82fab5 | |||
| ff52933320 | |||
| 84c01bb69b | |||
| eb9b71e94a | |||
| 1080e776a3 | |||
| f8673f565a | |||
| 6d4f97fdc4 | |||
| c85e14336e | |||
| b1cdf91789 | |||
| fd9156821c | |||
| feb098bf45 | |||
| b0ad3265e7 | |||
| 02fd12339f | |||
| 9048d6a03d | |||
| b5eed33932 | |||
| c660222300 | |||
| 93f6b0373a | |||
| 43d3271b4e | |||
| 66d09b76c7 | |||
| 90043a66cb | |||
| 317ccef7c8 | |||
| ef6bd9b538 | |||
| 012f1fcd47 | |||
| e46861f827 | |||
| 4549fdb9c5 | |||
| f5ad5e397e | |||
| f64ecd340b | |||
| 3060a3576f | |||
| 771ca331e9 | |||
| 92e42236f5 | |||
| 7ada448bce | |||
| c2258c449e | |||
| 051b88fe70 | |||
| 25578961c0 | |||
| b47db5611b | |||
| efe1df769b | |||
| 812cd311c3 | |||
| 676fb474b9 | |||
| 612267d322 | |||
| 167b5c4b1f | |||
| d87a481ffb | |||
| 6f54af5556 | |||
| ddea445a28 | |||
| e82bf4ce46 | |||
| f75037db42 | |||
| 01c7b5f380 | |||
| 0b906dd952 | |||
| dac91e9998 | |||
| 6de0914788 | |||
| e4f702d1e2 | |||
| a75b003c78 | |||
| 08d822a3ff | |||
| 2f864c5e15 | |||
| c9e3e9aa84 | |||
| 7139590798 | |||
| 37c1183515 | |||
| 935a080152 | |||
| 6f11ce71c4 | |||
| f41a85ced9 | |||
| 97fab1df14 | |||
| f6273ded80 | |||
| 9b7028a74e | |||
| 16894330a9 | |||
| 35f6952519 | |||
| ca50e87538 | |||
| 0870655455 | |||
| ba24a7bb8c | |||
| 56ad3251fd | |||
| f32d7465a2 | |||
| 750e2ee677 | |||
| cc273f30e9 | |||
| 64fd56e8ef | |||
| 0fa47047f3 | |||
| 6e2559f77a | |||
| cabe9f353b | |||
| 5aa5bccda3 | |||
| 16ea6245e3 | |||
| df9382bbc3 | |||
| 39aa290ea6 | |||
| f9b8b4e8d3 | |||
| 8aa10fe400 | |||
| e202698bf1 | |||
| c1f94d2deb | |||
| 11c2bf7dae | |||
| 159a2e13ad | |||
| 1e53d7ba53 | |||
| 53cf0e1148 | |||
| 2d1e49e3f2 | |||
| 199161f611 | |||
| ece5c775f1 | |||
| 895d2eb97e | |||
| 3121c43b71 | |||
| c5f3270ff6 | |||
| 318a4717d1 | |||
| 37a11546fa | |||
| 643a42aea6 | |||
| 2b8497531d | |||
| fdbde7840d | |||
| d702026134 | |||
| e2d55b45ba | |||
| 72c8e1aff3 | |||
| 51e8caf369 | |||
| e7e7937678 | |||
| a0f5a60ea0 | |||
| af29c6e441 | |||
| 00dfecb1c7 | |||
| cc249bef15 | |||
| 9a2231804d | |||
| 1edcf15bcd | |||
| 0190e08763 | |||
| 6b20c5df71 | |||
| 8da809f22c | |||
| 54ece4e432 | |||
| a50fcd31e2 | |||
| d3cc5a69c4 | |||
| 07ca53a778 | |||
| abb516e1b1 | |||
| 6910b6d024 | |||
| 435a3e62ba | |||
| f02c934ad7 | |||
| 236680aab9 | |||
| 6316f97c06 | |||
| 14830af306 | |||
| b620decde7 | |||
| b08ca620a0 | |||
| 66a2bb0393 | |||
| 0675844d97 | |||
| 148eda2990 | |||
| 330f7b4002 | |||
| def0fc8866 | |||
| fa1bcf9608 | |||
| 5a5e56a47b | |||
| e64f40eaa3 | |||
| 3f3d86ad4c | |||
| 91833dd72e | |||
| c049f7c11f | |||
| 6bd2f3bff5 | |||
| 8c3c519679 | |||
| 4e5002a31e | |||
| 5a53c58b04 | |||
| a61d1e3d10 | |||
| 1a50f99189 | |||
| 6caacbf388 | |||
| f876aa7d0f | |||
| 31e1281600 | |||
| 90072a9332 | |||
| bacd2893b9 | |||
| 7362fd859b | |||
| 3811fb46b3 | |||
| ab42c0c0df | |||
| de5aed2f6a | |||
| ce68a88293 | |||
| 288f75929d | |||
| 8528dd0c7f | |||
| e0f35eceab | |||
| 7e36517a79 | |||
| 69327766bb | |||
| 9ecf8a61ba | |||
| 2323506c82 | |||
| caa1a55e7a | |||
| 2ce44c157a | |||
| e17778190d | |||
| d1d81a0043 | |||
| ddb5ced3d5 | |||
| 9cebe655fd | |||
| 51b5a11a54 | |||
| f3405851a7 | |||
| 5b6870d610 | |||
| c3dceaff5c | |||
| 0a9b35c039 | |||
| dc32997f45 | |||
| 67c64c17d5 | |||
| 9cc02982be | |||
| b4c70a62a9 | |||
| c9d5921f4e | |||
| 0f47a4de5d | |||
| 0ba5e4d3c7 | |||
| 73e61dbcff | |||
| ba142e3b19 | |||
| f651a401e8 | |||
| 3301252fb2 | |||
| fe77e2b0d3 | |||
| d586567c3b | |||
| 211178d39e | |||
| d8354faa49 | |||
| f9e5c05046 | |||
| 596afe9451 | |||
| f7b5de986a | |||
| ee9262472b | |||
| 8a6a8db730 | |||
| 3642370f11 | |||
| 2db2cfb81c | |||
| 279b028c5e | |||
| f268827a2e | |||
| d8bc065057 | |||
| 6301bbbb66 | |||
| 3ad65eaef8 | |||
| 3d1bc7949d | |||
| 26e092fd20 | |||
| be7ddec1b0 | |||
| 5781ac6bbd | |||
| a51bc4427a | |||
| 80854584bb | |||
| 93af289d3b | |||
| a27b882493 | |||
| ba6f957692 | |||
| ec0e1bf26f | |||
| e4df298bb4 | |||
| 804d21e31d | |||
| 6d33687866 | |||
| 21bb1efb46 | |||
| 9d0986f1ca | |||
| fd483f397f | |||
| 09364850ee | |||
| 4d3a8bad4c | |||
| cc39b0aa41 | |||
| 1cceb7d4b4 | |||
| 6fc3b4be75 | |||
| af6d690fc8 | |||
| eea5152444 | |||
| 1ca38b625b | |||
| f964407c47 | |||
| 3be2e76ec0 | |||
| f9a9b90ed7 | |||
| 1f2917ac22 | |||
| fe1a8569f6 | |||
| 33e8d4f328 | |||
| e183260d0a | |||
| b4023942b4 | |||
| c10c24d90d | |||
| 915f63cac4 | |||
| 5c30ff4d3e | |||
| 3269f02ba7 | |||
| e5c2e3b3eb | |||
| 77f4aee0af | |||
| 868cbdfc7b | |||
| a650c0eab8 | |||
| a7dc8d8c6f | |||
| 355db16d2c | |||
| c54ce41eb7 | |||
| afb7d4c9d1 | |||
| b55cdde9da | |||
| 93cbc6c770 | |||
| 3b1b4a0a96 | |||
| 10b45cb54d | |||
| 9d289e571b | |||
| cce871c30e | |||
| c2b605a90f | |||
| 09149592b5 | |||
| e7410e551b | |||
| 9d77bc4192 | |||
| 537fa0c423 | |||
| c78dbc8bc1 | |||
| 249eed5c2c | |||
| 55eb3b24f7 | |||
| 508c255d0f | |||
| 9f8a90c0ac | |||
| 861dc935cb | |||
| 96ef8cacea | |||
| 5f3ecc8713 | |||
| 8b8ef0eb46 | |||
| 2dbea54c84 | |||
| a776d9fb6f | |||
| 57b7bbff5a | |||
| a832b0ed54 | |||
| 3ec75b84ae | |||
| b932763080 | |||
| 374f8f2f69 | |||
| 226c253d5a | |||
| c78a9f7950 | |||
| 7264510ab2 | |||
| 3458ec6511 | |||
| 2c80db6678 | |||
| 439aa6e4f5 | |||
| adf544dca9 | |||
| 0965269ee9 | |||
| 19d370c4e9 | |||
| cee0f8b652 | |||
| 37664d3487 | |||
| 5a78015d81 | |||
| 7250962ba3 | |||
| 442120bfdb | |||
| de624d1e54 | |||
| 523029cc45 | |||
| 934affe419 | |||
| 55b9af1589 | |||
| 16dd7e46ef | |||
| 851c77d8f2 | |||
| ee55b74898 | |||
| 13fc1e5c66 | |||
| 87112c2942 | |||
| 2664fdca30 | |||
| e05f523145 | |||
| 1148d29439 | |||
| 7ba52978d1 | |||
| 138a9fee43 | |||
| 1d522eaf0d | |||
| b5c5da64c9 | |||
| 8466425836 | |||
| b774ee5cd0 | |||
| 7e2e0e926b | |||
| 30f673c63c | |||
| bb5be728e3 | |||
| 0be5d1c657 | |||
| d143e6be06 | |||
| e65a78a5f5 | |||
| 4f443a3c62 | |||
| ff82ddea97 | |||
| 2e2d3f5e87 | |||
| 491b1041f8 | |||
| ce192d33f7 | |||
| ca1cb64026 | |||
| 71b5f5e469 | |||
| 946567f903 | |||
| 036e739511 | |||
| 87a95b85c5 | |||
| 4f49859bf7 | |||
| 2c53e55533 | |||
| 2ae75978dd | |||
| 452d825e66 | |||
| a7a1c4f81e | |||
| 00740eb9e8 | |||
| d76264c255 | |||
| 2297ce418d | |||
| fec85e6c59 | |||
| 54efa35fb3 | |||
| 988aebf630 | |||
| d2f7766aea | |||
| 25d30aee64 | |||
| 8af92da23c | |||
| 08dd36e1b0 | |||
| 324ff0a17c | |||
| cfb372e5e2 | |||
| 6513c732ba | |||
| c4ea869223 | |||
| 5387267675 | |||
| 8e4c3cc562 | |||
| 8b6b0699e5 | |||
| 229bff1658 | |||
| 7a59d37350 | |||
| d06b1e7883 | |||
| c8a284db9d | |||
| c7d6aceff4 | |||
| 7ea45d5e89 | |||
| 48c4aafb15 | |||
| ff302ed842 | |||
| 20a2424b83 | |||
| de0f34a27a | |||
| d0992cce3f | |||
| 15feeb3614 | |||
| fc0a879e52 | |||
| 9b675146a2 | |||
| 4d0bdcc8c0 | |||
| 0abdb67687 | |||
| d1fb98cf1b | |||
| 5eac24eacb | |||
| 3fd16daeca | |||
| d9b38c3b73 | |||
| 0a5176c1ee | |||
| b836b0e273 | |||
| 9a41e2a65d | |||
| cb1b74ed7b | |||
| e25e5d9768 | |||
| 9f3766952f | |||
| cb4471b07f | |||
| 9fa7eac41f | |||
| 94fa985550 | |||
| 1c498ead35 | |||
| 5abc983172 | |||
| 7a0d4919b0 | |||
| d5e9183877 | |||
| 9b39a51e9f | |||
| bec7eabd1c | |||
| cd3791087f | |||
| 714985e377 | |||
| 76c37dce96 | |||
| 5a9af40058 | |||
| e871ff35b7 | |||
| ecc6c32933 | |||
| 831cf61a08 | |||
| cc1231dece | |||
| bb3d1a165b | |||
| 3da0426c54 | |||
| e01aa25be3 | |||
| ee2f9d8dcb | |||
| 4d8677965c | |||
| 72729d5510 | |||
| 0b57e70c87 | |||
| 033d6489f8 | |||
| 8608007337 | |||
| 665e493570 | |||
| eb1e2f60f3 | |||
| dc637f0a9b | |||
| f81634728d | |||
| 440cd5ebc0 | |||
| 1cd7d0f205 | |||
| a69d62911c | |||
| 395e9bd006 | |||
| 90e20810d5 | |||
| 9c714e7687 | |||
| 6c3523d61c | |||
| 183840b793 | |||
| 4e2856aa64 | |||
| 4627a39165 | |||
| c87cbe83d2 | |||
| f05282badf | |||
| 957879346e | |||
| 87e64f67f3 | |||
| 43840d246d |
@@ -30,3 +30,11 @@ gollum text
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
|
||||
# Make github-linguist ignore files that aren't our own
|
||||
|
||||
lib/gollum/public/gollum/* linguist-vendored
|
||||
lib/gollum/public/gollum/javascript/gollum* linguist-vendored=false
|
||||
lib/gollum/public/gollum/javascript/*/gollum* linguist-vendored=false
|
||||
lib/gollum/public/gollum/css linguist-vendored=false
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Please read the [CONTRIBUTION GUIDELINES](https://github.com/gollum/gollum/blob/master/CONTRIBUTING.md) before submitting!**
|
||||
|
||||
If your have problems using or installing the software which stem from bugs in the software or a lack of documentation, we are always happy to help out! However, **for ordinary usage questions, please consider asking elsewhere**, for instance on [StackOverflow](http://stackoverflow.com/questions/tagged/gollum-wiki).
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Environment Info**
|
||||
|
||||
Always include the output of the `gollum --versions` command (NB: `versions` in plural).
|
||||
@@ -0,0 +1,39 @@
|
||||
name: Deploy docker
|
||||
on: [push]
|
||||
env:
|
||||
DEPLOY_NAME: gollumwiki/gollum:latest
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.ref == 'refs/heads/master' }}
|
||||
steps:
|
||||
- name: Check Out Repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Login
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Cache docker layers
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
push: true
|
||||
tags: ${{ env.DEPLOY_NAME }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
@@ -0,0 +1,38 @@
|
||||
name: Build and Test Docker
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
CI_IMAGE: gollum-ci-img
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check Out Repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Cache docker layers
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
- name: Build
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
push: false
|
||||
tags: ${{ env.CI_IMAGE }}
|
||||
outputs: type=docker
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
- name: docker state
|
||||
run: docker image ls
|
||||
- name: Run tests
|
||||
run: docker run -e CI=true -w /app --entrypoint bundle ${{ env.CI_IMAGE }} exec rake
|
||||
@@ -0,0 +1,25 @@
|
||||
on:
|
||||
push:
|
||||
# Sequence of patterns matched against refs/tags
|
||||
tags:
|
||||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||
|
||||
name: Create Release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
@@ -0,0 +1,29 @@
|
||||
name: Ruby Build
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
ruby: [2.4.0, 2.6.0, 3.0.0, jruby-9.2.18.0]
|
||||
steps:
|
||||
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
|
||||
- run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub!"
|
||||
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
|
||||
- run: echo "The workflow is now ready to test your code on the runner."
|
||||
- name: List files in the repository
|
||||
run: |
|
||||
ls ${{ github.workspace }}
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '11'
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
bundler-cache: true
|
||||
- name: exec rake
|
||||
run: bundle exec rake
|
||||
@@ -5,3 +5,7 @@ pkg
|
||||
Gemfile.lock
|
||||
*.gem
|
||||
*.swp
|
||||
.*
|
||||
!.sprockets*
|
||||
!lib/gollum/public/gollum/stylesheets/_styles.css
|
||||
!.github*
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
rvm:
|
||||
- 1.8.7
|
||||
- 1.9.3
|
||||
notifications:
|
||||
email:
|
||||
- code@bootstraponline.com
|
||||
before_install:
|
||||
- sudo apt-get update
|
||||
@@ -0,0 +1,111 @@
|
||||
# Contributing to Gollum
|
||||
|
||||
Thanks for your interest in the gollum project!
|
||||
|
||||
## Submitting an Issue
|
||||
|
||||
Please note that the issue tracker is meant for:
|
||||
|
||||
1. Bug reports.
|
||||
2. Feature requests.
|
||||
|
||||
If your have problems using or installing the software which stem from bugs in the software or a lack of documentation, we are always happy to help out! However, **for ordinary usage questions, please consider asking elsewhere**, for instance on [StackOverflow](http://stackoverflow.com/questions/tagged/gollum-wiki).
|
||||
|
||||
Gollum supports [custom macros](https://github.com/gollum/gollum/wiki#macros) for the creation of additional wiki markup tags. Please **do not** use this tracker to request macros specific to your situation. However, if you have or are working on a macro that you think may be useful to more users, you can share it as a GitHub [gist](https://gist.github.com) and link to it in the [wiki](https://github.com/gollum/gollum/wiki/Custom-macros).
|
||||
|
||||
Before submitting an issue, **please carefully look through the following places** to make sure your problem is not already addressed:
|
||||
|
||||
1. The issue tracker.
|
||||
1. The [README](https://github.com/gollum/gollum/blob/master/README.md).
|
||||
1. The project's [wiki](https://github.com/gollum/gollum/wiki).
|
||||
|
||||
Security vulnerabilities can be reported directly to the maintainers using these GPG keys:
|
||||
|
||||
* [@dometto](https://keys.openpgp.org/vks/v1/by-fingerprint/02354CC9F820B52CC2791979BB8CCC95FD83B795)
|
||||
|
||||
Lastly, please **consider helping out** by opening a Pull Request!
|
||||
|
||||
## Triaging Issues [](https://www.codetriage.com/gollum/gollum)
|
||||
|
||||
You can triage issues which may include reproducing bug reports or asking for vital information, such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to gollum on CodeTriage](https://www.codetriage.com/gollum/gollum).
|
||||
|
||||
|
||||
## Opening a Pull Request
|
||||
|
||||
Pull Requests fixing bugs, implementing new features, or updating documentation and dependencies are all very welcome! If you would like to help out with the project, you can pick an open issue from the issue tracker. We're more than happy to help you get started! Here's how you can proceed:
|
||||
|
||||
1. Fork and clone Gollum.
|
||||
2. Create a thoughtfully named topic branch to contain your changes.
|
||||
3. If you haven't installed dependencies yet, navigate to your clone and execute:
|
||||
```
|
||||
[sudo] bundle install
|
||||
```
|
||||
4. Hack away.
|
||||
5. Add your own tests and make sure they're all still passing.
|
||||
6. If some of your changes deserve a mention on Gollum's home page, edit the README accordingly.
|
||||
7. If necessary, rebase your commits into logical chunks, without errors.
|
||||
8. Push the branch to your fork on GitHub.
|
||||
9. Create a pull request for Gollum.
|
||||
|
||||
**Notes:**
|
||||
* Do not change Gollum's version numbers, we will do that on our own.
|
||||
|
||||
### Running tests
|
||||
|
||||
1. Install [Bundler](http://bundler.io/).
|
||||
2. Navigate to the cloned source of Gollum.
|
||||
3. Install dependencies:
|
||||
```
|
||||
[sudo] bundle install
|
||||
```
|
||||
4. Run the tests:
|
||||
```
|
||||
bundle exec rake test
|
||||
```
|
||||
|
||||
To profile slow tests, you can use `bundle exec rake test TESTOPTS="--verbose"`.
|
||||
|
||||
### Working with test repositories
|
||||
|
||||
An example of how to add a test file to the bare repository lotr.git.
|
||||
|
||||
```
|
||||
mkdir tmp
|
||||
cd tmp
|
||||
git clone ../test/examples/lotr.git/
|
||||
git log
|
||||
echo "test" > test.md
|
||||
git add .
|
||||
git commit -am "Add test"
|
||||
git push ../lotr.git/ master
|
||||
```
|
||||
|
||||
## Updating static assets
|
||||
|
||||
This is necessary whenever changes have been made to the assets in `lib/gollum/public/gollum/javascript` (mostly SASS, CSS, and JS files), to ensure the changes are also present in the [released](#releasing-the-gem) version of the gem. Steps:
|
||||
|
||||
1. `git rm -r lib/gollum/public/assets`
|
||||
1. `bundle exec rake precompile`
|
||||
1. `git add lib/gollum/public/assets`
|
||||
1. `git commit`
|
||||
|
||||
## Releasing the gem
|
||||
|
||||
Gollum uses [Semantic Versioning](http://semver.org/).
|
||||
|
||||
x.y.z
|
||||
|
||||
For z releases:
|
||||
|
||||
```
|
||||
rake bump
|
||||
rake release
|
||||
```
|
||||
|
||||
For x.y releases:
|
||||
|
||||
```
|
||||
# First update VERSION in lib/gollum.rb and then:
|
||||
rake gemspec
|
||||
rake release
|
||||
```
|
||||
@@ -0,0 +1,29 @@
|
||||
FROM ruby:2.7
|
||||
ENV DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libicu-dev \
|
||||
cmake
|
||||
|
||||
COPY Gemfile* /tmp/
|
||||
COPY gollum.gemspec* /tmp/
|
||||
WORKDIR /tmp
|
||||
RUN bundle install
|
||||
|
||||
RUN gem install \
|
||||
asciidoctor \
|
||||
creole \
|
||||
wikicloth \
|
||||
org-ruby \
|
||||
RedCloth \
|
||||
bibtex-ruby \
|
||||
&& echo "gem-extra complete"
|
||||
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
RUN bundle exec rake install
|
||||
|
||||
VOLUME /wiki
|
||||
WORKDIR /wiki
|
||||
COPY docker-run.sh /docker-run.sh
|
||||
ENTRYPOINT ["/docker-run.sh"]
|
||||
@@ -1,4 +1,9 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
if RUBY_PLATFORM == 'java'
|
||||
gem 'warbler'
|
||||
end
|
||||
|
||||
gemspec
|
||||
gem 'rake', '~> 10.0.3'
|
||||
|
||||
gem 'rake', '~> 13.0'
|
||||
@@ -1,3 +1,78 @@
|
||||
# 5.2.3 2021-04-18
|
||||
|
||||
* Fix bug preventing page titles from being displayed
|
||||
|
||||
# 5.2.1 2021-02-25
|
||||
|
||||
* Fix include call to a missing asset (@benjaminwil). This caused slow first page loads on JRuby.
|
||||
|
||||
# 5.2 2021-02-24
|
||||
|
||||
* Improved styling and Primer upgrade (@benjaminwil)
|
||||
* Add redirect to rename commit (@ViChyavIn)
|
||||
* Updated dependencies
|
||||
* Bugfixes
|
||||
|
||||
# 5.1.2
|
||||
|
||||
* Guard against malicious filenames in breadcrumbs
|
||||
|
||||
# 5.1
|
||||
|
||||
* Bugfixes
|
||||
* Add autosave feature (#1576)
|
||||
* Add Add quick access to diff of each commit in the history
|
||||
|
||||
# 5.0 / 2020-03-17
|
||||
|
||||
This is a major new release that introduces many new features, bugfixes, and removes major limitations. See [here](https://github.com/gollum/gollum/wiki/5.0-release-notes) for a list of changes.
|
||||
|
||||
**Note**: due to changes to the way in which Gollum handles filenames, you may have to change some links in your wiki when migrating from gollum 4.x. See the [release notes](https://github.com/gollum/gollum/wiki/5.0-release-notes#migrating-your-wiki) for more details. You may be find the `bin/gollum-migrate-tags` script helpful to accomplish this. Also see the `--lenient-tag-lookup` option for making tag lookup backwards compatible with 4.x, though note that this will decrease performance on large wikis with many tags.
|
||||
|
||||
Many thanks to all the users who have provided feedback, and everyone who has chipped in in the development process!
|
||||
|
||||
Many of these changes have been made possible by removing the default grit adapter in favour of the new [rugged adapter](https://github.com/gollum/rugged_adapter).
|
||||
|
||||
# 4.1.4 /2018-01-10
|
||||
|
||||
* Depend on new version of gollum-lib that relies on a patched version of sanitize, which solves a vulnerability (CVE-2018-3740). See https://github.com/gollum/gollum-lib/pull/296.
|
||||
|
||||
# 4.1.3 /2018-17-09
|
||||
|
||||
* Solves a vulnerability in the File view and All Pages view that would allow XSS.
|
||||
|
||||
# 4.1.2 /2017-08-07
|
||||
|
||||
* Lock to a newer version of gollum-lib to avoid installing an outdated and vulnerable dependency (nokogiri) on ruby 2.0. See https://github.com/gollum/gollum-lib/pull/279. Note: this breaks semantic versioning so those using outdated rubies will discover the problem on update.
|
||||
|
||||
# 4.1.0 /2017-03-09
|
||||
|
||||
* Added file deletion functionality to file view
|
||||
* Various performance improvements
|
||||
* Emoji support
|
||||
|
||||
# 4.0.0 /2015-04-11
|
||||
|
||||
* Now compatible with JRuby (via the [rjgit](https://github.com/repotag/rjgit) [adapter](https://github.com/repotag/gollum-lib_rjgit_adapter))
|
||||
|
||||
# 3.1.1 /2014-12-04
|
||||
|
||||
* Security fix for [remote code execution issue](https://github.com/gollum/gollum/issues/913). Please update!
|
||||
|
||||
# 3.1 / 2014-11-28
|
||||
|
||||
* New features
|
||||
* Drag-and-drop uploading in the editor [@lucas-clemente](https://github.com/lucas-clemente)
|
||||
* Latest changes view [@etienneCharignon](https://github.com/etienneCharignon) (#707)
|
||||
* Option `--no-edit` to disable editing from the web interface [@bambycha](https://github.com/bambycha) (#879)
|
||||
* Option `--mathjax-config` to specify custom mathjax configuration [@hardywu](https://github.com/hardywu) (#842)
|
||||
* Major enhancements
|
||||
* Made the Gollum theme responsive [@rtrvrtg](https://github.com/rtrvrtg) (#831)
|
||||
* Depends on new [gollum-lib](https://github.com/gollum/gollum-lib) `4.0.0`
|
||||
* Allows specifiying [git adapter](https://github.com/gollum/gollum/wiki/Git-adapters) with `--adapter` [@bartkamphorst](https://github.com/bartkamphorst), [@dometto](https://github.com/dometto)
|
||||
* Numerous bugfixes
|
||||
* **NB**: please pass `--h1-title` if you do not want page titles to default to the page's filepath. See [here](https://github.com/gollum/gollum/wiki/Page-titles).
|
||||
|
||||
# 2.4.11 / 2013-01-08
|
||||
|
||||
* Numerous security issues have been fixed. Please update to `2.4.11`
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vulputate tincidunt sollicitudin. Quisque sit amet leo sed nunc eleifend rhoncus in consectetur leo. Vivamus posuere semper convallis. Duis malesuada lacus sed erat lobortis tincidunt mattis ligula consectetur. Sed aliquam vulputate eros at euismod. Aenean egestas lorem ligula, quis faucibus turpis. Curabitur a eros in ipsum gravida ornare. Sed elementum enim vel mi scelerisque dapibus. Nulla id libero ligula, quis tempus sem. Morbi nec felis tortor, ac cursus risus. Mauris elementum tortor id lacus eleifend non lobortis tellus pharetra. Etiam posuere cursus vestibulum. $x \lt y$
|
||||
|
||||
Morbi tincidunt dolor vel massa dictum volutpat. Vestibulum quis nibh metus, id tincidunt nisl. Vivamus eget sem ac risus eleifend rhoncus at eu nisl. Nunc elit massa, vulputate ac gravida eget, condimentum quis justo. Integer scelerisque, libero vel consequat ultricies, eros libero sagittis libero, pellentesque bibendum quam massa ut orci. Maecenas sit amet urna eget quam aliquam posuere. Nulla facilisi. Duis imperdiet augue sit amet metus ornare et hendrerit dui feugiat. Aenean a lacus neque. Sed eu enim tincidunt dolor pharetra porttitor. Vestibulum ut felis dui, rutrum iaculis orci. Duis eu bibendum tortor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse mollis sagittis purus sit amet sollicitudin. Phasellus vel interdum erat.
|
||||
@@ -1,6 +1,6 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) Tom Preston-Werner, Rick Olson
|
||||
Copyright (c) Tom Preston-Werner, Rick Olson, Dawa Ometto, Bart Kamphorst
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the 'Software'), to deal
|
||||
|
||||
@@ -1,204 +1,156 @@
|
||||
gollum -- A wiki built on top of Git
|
||||
gollum -- A git-based Wiki
|
||||
====================================
|
||||
|
||||
[](http://rubygems.org/gems/gollum)
|
||||
[](http://travis-ci.org/gollum/gollum)
|
||||
[](https://gemnasium.com/gollum/gollum)
|
||||
[](http://badge.fury.io/rb/gollum)
|
||||

|
||||
[](https://www.codetriage.com/gollum/gollum)
|
||||
[](https://dometto-cuttingedge.herokuapp.com/github/gollum/gollum/info)
|
||||
|
||||
|
||||
**Gollum version 5.0 is out!** See [here](https://github.com/gollum/gollum/wiki/5.0-release-notes) for a list of changes and new features compared to Gollum version 4.x, and see some [Screenshots](https://github.com/gollum/gollum/wiki/Screenshots) of Gollum's features.
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Gollum is a simple wiki system built on top of Git that powers GitHub Wikis.
|
||||
Gollum is a simple wiki system built on top of Git. A Gollum Wiki is simply a git repository of a specific nature:
|
||||
* A Gollum repository's contents are human-editable text or markup files.
|
||||
* Pages may be organized into directories any way you choose.
|
||||
* Other content can also be included, for example images, PDFs and headers/footers for your pages.
|
||||
* Gollum pages:
|
||||
* May be written in a variety of [markups](#markups).
|
||||
* Can be edited with your favourite system editor or IDE (changes will be visible after committing) or with the built-in web interface.
|
||||
* Can be displayed in all versions, reverted, etc.
|
||||
* Gollum strives to be compatible with GitHub wikis (see `--lenient-tag-lookup`)
|
||||
* Gollum supports advanced functionality like:
|
||||
* [UML diagrams](https://github.com/gollum/gollum/wiki#plantuml-diagrams)
|
||||
* [BibTeX and Citation support](https://github.com/gollum/gollum/wiki/BibTeX-and-Citations)
|
||||
* Annotations using [CriticMarkup](https://github.com/gollum/gollum/wiki#criticmarkup-annotations)
|
||||
* Mathematics via [MathJax](https://github.com/gollum/gollum/wiki#mathematics)
|
||||
* [Macros](https://github.com/gollum/gollum/wiki/Standard-Macros)
|
||||
* [Redirects](https://github.com/gollum/gollum/wiki#redirects)
|
||||
* [RSS Feed](https://github.com/gollum/gollum/wiki/5.0-release-notes#rss-feed) of latest changes
|
||||
* ...and [more](https://github.com/gollum/gollum/wiki)
|
||||
|
||||
Gollum wikis are simply Git repositories that adhere to a specific format.
|
||||
Gollum pages may be written in a variety of formats and can be edited in a
|
||||
number of ways depending on your needs. You can edit your wiki locally:
|
||||
### SYSTEM REQUIREMENTS
|
||||
|
||||
* With your favorite text editor or IDE (changes will be visible after committing).
|
||||
* With the built-in web interface.
|
||||
* With the Gollum Ruby API.
|
||||
|
||||
Gollum follows the rules of [Semantic Versioning](http://semver.org/) and uses
|
||||
[TomDoc](http://tomdoc.org/) for inline documentation.
|
||||
|
||||
## SYSTEM REQUIREMENTS
|
||||
|
||||
- Python 2.5+ (2.7.3 recommended)
|
||||
- Ruby 1.8.7+ (1.9.3 recommended)
|
||||
- Unix like operating system (OS X, Ubuntu, Debian, and more)
|
||||
- Will not work on Windows (because of [grit](https://github.com/github/grit))
|
||||
|
||||
## SECURITY
|
||||
|
||||
Don't enable `--custom-css` or `--custom-js` unless you trust every user who has the ability to edit the wiki.
|
||||
A better solution with more security is being tracked in [#665](https://github.com/gollum/gollum/issues/665).
|
||||
Gollum runs on Unix-like systems using its [adapter](https://github.com/gollum/rugged_adapter) for [rugged](https://github.com/libgit2/rugged) by default. You can also run Gollum on [JRuby](https://github.com/jruby/jruby) via its [adapter](https://github.com/repotag/gollum-lib_rjgit_adapter) for [RJGit](https://github.com/repotag/rjgit/). On Windows, Gollum runs only on JRuby.
|
||||
|
||||
## INSTALLATION
|
||||
|
||||
The best way to install Gollum is with RubyGems:
|
||||
1. Ruby is best installed either via [RVM](https://rvm.io/) or a package manager of choice.
|
||||
2. Gollum is best installed via RubyGems:
|
||||
```
|
||||
[sudo] gem install gollum
|
||||
```
|
||||
|
||||
```bash
|
||||
$ [sudo] gem install gollum
|
||||
```
|
||||
Installation examples for individual systems can be seen [here](https://github.com/gollum/gollum/wiki/Installation).
|
||||
|
||||
If you're installing from source, you can use [Bundler][bundler] to pick up all the
|
||||
gems:
|
||||
To run, simply:
|
||||
|
||||
```bash
|
||||
$ bundle install
|
||||
```
|
||||
1. Run: `gollum /path/to/wiki` where `/path/to/wiki` is an initialized Git repository.
|
||||
2. Open `http://localhost:4567` in your browser.
|
||||
|
||||
In order to use the various formats that Gollum supports, you will need to
|
||||
separately install the necessary dependencies for each format. You only need
|
||||
to install the dependencies for the formats that you plan to use.
|
||||
See [below](#running-from-source) for information on running Gollum from source, as a Rack app, and more.
|
||||
|
||||
* [ASCIIDoc](http://www.methods.co.nz/asciidoc/) -- `brew install asciidoc` on mac or `apt-get install -y asciidoc` on Ubuntu
|
||||
* [Creole](http://wikicreole.org/) -- `gem install creole`
|
||||
* [Markdown](http://daringfireball.net/projects/markdown/) -- `gem install redcarpet`
|
||||
* [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown) -- `gem install github-markdown`
|
||||
* [Org](http://orgmode.org/) -- `gem install org-ruby`
|
||||
* [Pod](http://search.cpan.org/dist/perl/pod/perlpod.pod) -- `Pod::Simple::HTML` comes with Perl >= 5.10. Lower versions should install Pod::Simple from CPAN.
|
||||
### Markups
|
||||
|
||||
Gollum allows using different markup languages on different wiki pages. It presently ships with support for the following markups:
|
||||
* [Markdown](http://daringfireball.net/projects/markdown/syntax) (see [below](#Markdown-flavors) for more information on Markdown flavors)
|
||||
* [RDoc](http://rdoc.sourceforge.net/)
|
||||
* [ReStructuredText](http://docutils.sourceforge.net/rst.html) -- `easy_install docutils`
|
||||
* [Textile](http://www.textism.com/tools/textile/) -- `gem install RedCloth`
|
||||
* [MediaWiki](http://www.mediawiki.org/wiki/Help:Formatting) -- `gem install wikicloth`
|
||||
|
||||
[bundler]: http://gembundler.com/
|
||||
You can easily activate support for other markups by installing additional renderers (any that are supported by [github-markup](https://github.com/github/markup)):
|
||||
* [AsciiDoc](http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/) -- `[sudo] gem install asciidoctor`
|
||||
* [Creole](http://www.wikicreole.org/wiki/CheatSheet) -- `[sudo] gem install creole`
|
||||
* [MediaWiki](http://www.mediawiki.org/wiki/Help:Formatting) -- `[sudo] gem install wikicloth`
|
||||
* [Org](http://orgmode.org/worg/dev/org-syntax.html) -- `[sudo] gem install org-ruby`
|
||||
* [Pod](http://perldoc.perl.org/perlpod.html) -- requires Perl >= 5.10 (the `perl` command must be available on your command line)
|
||||
* Lower versions should install `Pod::Simple` from CPAN.
|
||||
* [ReStructuredText](http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html) -- requires python >= 2 (the `python2` command must be available on your command line)
|
||||
* Note that Gollum will also need you to install `docutils` for your Python 2.
|
||||
* [Textile](http://redcloth.org/hobix.com/textile/quick.html) -- `[sudo] gem install RedCloth`
|
||||
|
||||
### Markdown flavors
|
||||
|
||||
## SYNTAX
|
||||
By default, Gollum ships with the `kramdown` gem to render Markdown. However, you can use any [Markdown renderer supported by github-markup](https://github.com/github/markup/blob/master/lib/github/markup/markdown.rb). This includes [CommonMark](https://commonmark.org/) support via the `commonmarker` gem. The first installed renderer from the list will be used (e.g., `redcarpet` will NOT be used if `github/markdown` is installed). Just `gem install` the renderer of your choice.
|
||||
|
||||
Gollum supports a variety of formats and extensions (Markdown, MediaWiki, Textile, …).
|
||||
On top of these formats Gollum lets you insert headers, footers, links, image, math and more.
|
||||
See [here](https://github.com/gollum/gollum/wiki/Custom-rendering-gems) for instructions on how to use custom rendering gems and set custom options.
|
||||
|
||||
Check out the [Gollum Wiki](https://github.com/gollum/gollum/wiki) for all of Gollum's formats and syntactic options.
|
||||
## RUNNING FROM SOURCE
|
||||
|
||||
1. `git clone https://github.com/gollum/gollum`
|
||||
2. `cd gollum`
|
||||
3. `[sudo] bundle install`
|
||||
4. `bundle exec bin/gollum`
|
||||
5. Open `http://localhost:4567` in your browser.
|
||||
|
||||
## RUNNING
|
||||
### Rack
|
||||
|
||||
To view and edit your Gollum repository locally via the built in web
|
||||
interface, simply install the Gollum gem, navigate to your repository via the
|
||||
command line, and run the executable:
|
||||
Gollum can also be run with any [rack-compatible web server](https://github.com/rack/rack#supported-web-servers). More on that [over here](https://github.com/gollum/gollum/wiki/Gollum-via-Rack).
|
||||
|
||||
```bash
|
||||
$ gollum
|
||||
```
|
||||
### Rack, with an authentication server
|
||||
|
||||
This will start up a web server running the Gollum frontend and you can view
|
||||
and edit your wiki at http://localhost:4567. To get help on the command line
|
||||
utility, you can run it like so:
|
||||
Gollum can also be run alongside a CAS (Central Authentication Service) SSO (single sign-on) server. With a bit of tweaking, this adds basic user-support to Gollum. To see an example and an explanation, navigate [over here](https://github.com/gollum/gollum/wiki/Gollum-via-Rack-and-CAS-SSO).
|
||||
|
||||
```bash
|
||||
$ gollum --help
|
||||
```
|
||||
### Docker
|
||||
|
||||
Note that the gollum server will not run on Windows because of [an issue](https://github.com/rtomayko/posix-spawn/issues/9) with posix-spawn (which is used by Grit).
|
||||
Gollum can also be run via [Docker](https://www.docker.com/). More on that [over here](https://github.com/gollum/gollum/wiki/Gollum-via-Docker).
|
||||
|
||||
### RACK
|
||||
### Service
|
||||
|
||||
You can also run gollum with any rack-compatible server by placing this config.ru
|
||||
file inside your wiki repository. This allows you to utilize any Rack middleware
|
||||
like Rack::Auth, OmniAuth, etc.
|
||||
Gollum can also be run as a service. More on that [over here](https://github.com/gollum/gollum/wiki/Gollum-as-a-service).
|
||||
|
||||
```ruby
|
||||
#!/usr/bin/env ruby
|
||||
require 'rubygems'
|
||||
require 'gollum/app'
|
||||
## CONFIGURATION
|
||||
|
||||
gollum_path = File.expand_path(File.dirname(__FILE__)) # CHANGE THIS TO POINT TO YOUR OWN WIKI REPO
|
||||
Precious::App.set(:gollum_path, gollum_path)
|
||||
Precious::App.set(:default_markup, :markdown) # set your favorite markup language
|
||||
Precious::App.set(:wiki_options, {:universal_toc => false})
|
||||
run Precious::App
|
||||
```
|
||||
Gollum comes with the following command line options:
|
||||
|
||||
Your Rack middleware can pass author details to Gollum in a Hash in the session under the 'gollum.author' key.
|
||||
| Option | Arguments | Description |
|
||||
| ----------------- | --------- | ----------- |
|
||||
| --host | [HOST] | Specify the hostname or IP address to listen on. Default: '0.0.0.0'.<sup>1</sup> |
|
||||
| --port | [PORT] | Specify the port to bind Gollum with. Default: `4567`. |
|
||||
| --config | [FILE] | Specify path to Gollum's configuration file. |
|
||||
| --ref | [REF] | Specify the git branch to serve. Default: `master`. |
|
||||
| --bare | none | Tell Gollum that the git repository should be treated as bare. |
|
||||
| --adapter | [ADAPTER] | Launch Gollum using a specific git adapter. Default: `rugged`.<sup>2</sup> |
|
||||
| --base-path | [PATH] | Specify the leading portion of all Gollum URLs (path info). Setting this to `/wiki` will make the wiki accessible under `http://localhost:4567/wiki/`. Default: `/`. |
|
||||
| --page-file-dir | [PATH] | Specify the subdirectory for all pages. If set, Gollum will only serve pages from this directory and its subdirectories. Default: repository root. |
|
||||
| --static, --no-static | none | Use static assets. Defaults to false in development/test, true in production/staging. |
|
||||
| --assets | [PATH] | Set the path to look for static assets. |
|
||||
| --css | none | Tell Gollum to inject custom CSS into each page. Uses `custom.css` from wiki root.<sup>3</sup> |
|
||||
| --js | none | Tell Gollum to inject custom JS into each page. Uses `custom.js` from wiki root.<sup>3</sup> |
|
||||
| --no-edit | none | Disable the feature of editing pages. |
|
||||
| --follow-renames, --no-follow-renames | none | Follow pages across renames in the History view. Default: true.
|
||||
| --allow-uploads | [MODE] | Enable file uploads. If set to `dir`, Gollum will store all uploads in the `/uploads/` directory in repository root. If set to `page`, Gollum will store each upload at the currently edited page.<sup>4</sup> |
|
||||
| --mathjax | none | Enables MathJax (renders mathematical equations). By default, uses the `TeX-AMS-MML_HTMLorMML` config with the `autoload-all` extension.<sup>5</sup> |
|
||||
| --critic-markup | none | Enable support for annotations using [CriticMarkup](http://criticmarkup.com/). |
|
||||
| --irb | none | Launch Gollum in "console mode", with a [predefined API](https://github.com/gollum/gollum-lib/). |
|
||||
| --h1-title | none | Tell Gollum to use the first `<h1>` as page title. |
|
||||
| --no-display-metadata | none | Do not render metadata tables in pages. |
|
||||
| --user-icons | [MODE] | Tell Gollum to use specific user icons for history view. Can be set to `gravatar`, `identicon` or `none`. Default: `none`. |
|
||||
| --mathjax-config | [FILE] | Specify path to a custom MathJax configuration. If not specified, uses the `mathjax.config.js` file from repository root. |
|
||||
| --template-dir | [PATH] | Specify custom mustache template directory. Only overrides templates that exist in this directory. |
|
||||
| --template-page | none | Use _Template in root as a template for new pages. Must be committed. |
|
||||
| --emoji | none | Parse and interpret emoji tags (e.g. `:heart:`) except when the leading colon is backslashed (e.g. `\:heart:`). |
|
||||
| --lenient-tag-lookup | none | Internal links resolve case-insensitively, will treat spaces as hyphens, and will match the first page found with a certain filename, anywhere in the repository. Provides compatibility with Gollum 4.x. |
|
||||
| --help | none | Display the list of options on the command line. |
|
||||
| --version | none | Display the current version of Gollum. |
|
||||
| --versions | none | Display the current version of Gollum and auxiliary gems. |
|
||||
|
||||
## CONFIG FILE
|
||||
**Notes:**
|
||||
|
||||
Gollum optionally takes a `--config file`. See [config.rb](https://github.com/gollum/gollum/blob/master/config.rb) for an example.
|
||||
1. The `0.0.0.0` IP address allows remote access. Should you wish for Gollum to turn into a personal Wiki, use `127.0.0.1`.
|
||||
2. Before using `--adapter`, you should probably read [this](https://github.com/gollum/gollum/wiki/Git-adapters) first.
|
||||
3. When `--css` or `--js` is used, respective files must be committed to your git repository or you will get a 302 redirect to the create a page.
|
||||
4. Files can be uploaded simply by dragging and dropping them onto the editor's text area when `--allow-uploads` is used.
|
||||
|
||||
## CUSTOM CSS/JS
|
||||
### Config file
|
||||
|
||||
The `--css` flag will inject `custom.css` from the root of your git repository into each page. `custom.css` must be commited to git or you will get a 302 redirect to the create page.
|
||||
When `--config` option is used, certain inner parts of Gollum can be customized. This is used throughout our wiki for certain user-level alterations, among which [customizing supported markups](https://github.com/gollum/gollum/wiki/Formats-and-extensions) will probably stand out.
|
||||
|
||||
The `--js` flag will inject `custom.js` from the root of your git repository into each page. `custom.js` must be commited to git or you will get a 302 redirect to the create page.
|
||||
**All of the mentioned alterations work both for Gollum's config file (`config.rb`) and Rack's config file (`config.ru`).**
|
||||
|
||||
## CONTRIBUTING
|
||||
|
||||
## API DOCUMENTATION
|
||||
Please consider helping out! See [CONTRIBUTING](CONTRIBUTING.md) for information on how to submit issues, and how to start hacking on gollum.
|
||||
|
||||
The [Gollum API](https://github.com/gollum/gollum-lib/) allows you to retrieve
|
||||
raw or formatted wiki content from a Git repository, write new content to the
|
||||
repository, and collect various meta data about the wiki as a whole.
|
||||
## THANKS TO
|
||||
|
||||
|
||||
## CONTRIBUTE
|
||||
|
||||
If you'd like to hack on Gollum, start by forking the repo on GitHub:
|
||||
|
||||
http://github.com/gollum/gollum
|
||||
|
||||
To get all of the dependencies, install the gem first. The best way to get
|
||||
your changes merged back into core is as follows:
|
||||
|
||||
1. Clone down your fork
|
||||
1. Create a thoughtfully named topic branch to contain your change
|
||||
1. Hack away
|
||||
1. Add tests and make sure everything still passes by running `rake`
|
||||
1. If you are adding new functionality, document it in the README
|
||||
1. Do not change the version number, I will do that on my end
|
||||
1. If necessary, rebase your commits into logical chunks, without errors
|
||||
1. Push the branch up to GitHub
|
||||
1. Send a pull request to the gollum/gollum project.
|
||||
|
||||
## RELEASING
|
||||
|
||||
Gollum uses [Semantic Versioning](http://semver.org/).
|
||||
|
||||
x.y.z
|
||||
|
||||
For z releases:
|
||||
|
||||
```bash
|
||||
$ rake bump
|
||||
$ rake release
|
||||
```
|
||||
|
||||
For x.y releases:
|
||||
|
||||
```bash
|
||||
Update VERSION in lib/gollum.rb
|
||||
$ rake gemspec
|
||||
$ rake release
|
||||
```
|
||||
|
||||
## BUILDING THE GEM FROM MASTER
|
||||
|
||||
```bash
|
||||
$ gem uninstall -aIx gollum
|
||||
$ git clone https://github.com/gollum/gollum.git
|
||||
$ cd gollum
|
||||
gollum$ rake build
|
||||
gollum$ gem install --no-ri --no-rdoc pkg/gollum*.gem
|
||||
```
|
||||
|
||||
## RUN THE TESTS
|
||||
|
||||
```bash
|
||||
$ bundle install
|
||||
$ bundle exec rake test
|
||||
```
|
||||
|
||||
## WORK WITH TEST REPOS
|
||||
|
||||
An example of how to add a test file to the bare repository lotr.git.
|
||||
|
||||
```bash
|
||||
$ mkdir tmp; cd tmp
|
||||
$ git clone ../lotr.git/ .
|
||||
Cloning into '.'...
|
||||
done.
|
||||
$ git log
|
||||
$ echo "test" > test.md
|
||||
$ git add . ; git commit -am "Add test"
|
||||
$ git push ../lotr.git/ master
|
||||
```
|
||||
[](https://saucelabs.com)
|
||||
|
||||
@@ -71,6 +71,7 @@ Rake::TestTask.new(:test) do |test|
|
||||
test.libs << 'lib' << 'test' << '.'
|
||||
test.pattern = 'test/**/test_*.rb'
|
||||
test.verbose = true
|
||||
test.warning = false
|
||||
end
|
||||
|
||||
desc "Generate RCov test coverage and open in your browser"
|
||||
@@ -107,20 +108,23 @@ end
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
desc 'Create a release build'
|
||||
desc 'Create a release build and push to rubygems'
|
||||
task :release => :build do
|
||||
unless `git branch` =~ /^\* master$/
|
||||
puts "You must be on the master branch to release!"
|
||||
exit!
|
||||
end
|
||||
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
||||
sh "git pull"
|
||||
sh "git pull --rebase origin master"
|
||||
sh "git tag v#{version}"
|
||||
sh "git push origin master"
|
||||
sh "git push origin v#{version}"
|
||||
sh "gem push pkg/#{name}-#{version}.gem"
|
||||
end
|
||||
|
||||
desc 'Publish to rubygems. Same as release'
|
||||
task :publish => :release
|
||||
|
||||
desc 'Build gem'
|
||||
task :build => :gemspec do
|
||||
sh "mkdir -p pkg"
|
||||
@@ -128,6 +132,11 @@ task :build => :gemspec do
|
||||
sh "mv #{gem_file} pkg"
|
||||
end
|
||||
|
||||
desc "Build and install"
|
||||
task :install => :build do
|
||||
sh "gem install --local --no-document pkg/#{name}-#{version}.gem"
|
||||
end
|
||||
|
||||
desc 'Update gemspec'
|
||||
task :gemspec => :validate do
|
||||
# read spec file and split out manifest section
|
||||
@@ -169,3 +178,21 @@ task :validate do
|
||||
exit!
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Precompile assets'
|
||||
task :precompile do
|
||||
require './lib/gollum/app.rb'
|
||||
Precious::App.set(:environment, :production)
|
||||
env = Precious::Assets.sprockets
|
||||
path = ENV.fetch('GOLLUM_ASSETS_PATH', ::File.join(File.dirname(__FILE__), 'lib/gollum/public/assets'))
|
||||
manifest = Sprockets::Manifest.new(env, path)
|
||||
Sprockets::Helpers.configure do |config|
|
||||
config.environment = env
|
||||
config.prefix = Precious::Assets::ASSET_URL
|
||||
config.digest = true
|
||||
config.public_path = path
|
||||
config.manifest = manifest
|
||||
end
|
||||
puts "Precompiling assets to #{path}..."
|
||||
manifest.compile(Precious::Assets::MANIFEST)
|
||||
end
|
||||
|
||||
@@ -2,112 +2,217 @@
|
||||
|
||||
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
||||
|
||||
help = <<HELP
|
||||
Gollum is a multi-format Wiki Engine/API/Frontend.
|
||||
|
||||
Basic Command Line Usage:
|
||||
gollum [OPTIONS] [PATH]
|
||||
|
||||
PATH The path to the Gollum repository (default .).
|
||||
|
||||
Options:
|
||||
HELP
|
||||
|
||||
require 'optparse'
|
||||
require 'rubygems'
|
||||
require 'gollum'
|
||||
require 'erb'
|
||||
require 'sprockets'
|
||||
|
||||
exec = {}
|
||||
options = { 'port' => 4567, 'bind' => '0.0.0.0' }
|
||||
wiki_options = {}
|
||||
exec = {}
|
||||
options = {
|
||||
:port => 4567,
|
||||
:bind => '0.0.0.0',
|
||||
}
|
||||
wiki_options = {
|
||||
:allow_uploads => false,
|
||||
:allow_editing => true,
|
||||
}
|
||||
|
||||
opts = OptionParser.new do |opts|
|
||||
opts.banner = help
|
||||
# define program name (although this defaults to the name of the file, just in case...)
|
||||
opts.program_name = 'gollum'
|
||||
|
||||
opts.on("--port [PORT]", "Bind port (default 4567).") do |port|
|
||||
options['port'] = port.to_i
|
||||
# set basic info for the '--help' command (options will be appended automatically from the below definitions)
|
||||
opts.banner = '
|
||||
Gollum is a multi-format Wiki Engine/API/Frontend.
|
||||
|
||||
Usage:
|
||||
gollum [options] [git-repo]
|
||||
|
||||
Arguments:
|
||||
[git-repo] Path to the git repository being served. If not specified, current working directory is used.
|
||||
|
||||
Notes:
|
||||
Paths for all options are relative to <git-repo> unless absolute.
|
||||
This message is only a basic description. For more information, please visit:
|
||||
https://github.com/gollum/gollum
|
||||
|
||||
OPTIONS'
|
||||
|
||||
# define gollum options
|
||||
opts.separator ''
|
||||
opts.separator ' Major:'
|
||||
|
||||
opts.on('-h', '--host [HOST]', 'Specify the hostname or IP address to listen on. Default: \'0.0.0.0\'.') do |host|
|
||||
options[:bind] = host
|
||||
end
|
||||
opts.on('-p', '--port [PORT]', 'Specify the port to bind Gollum with. Default: \'4567\'.') do |port|
|
||||
begin
|
||||
# don't use 'port.to_i' here... it doesn't raise errors which might result in a nice confusion later on
|
||||
options[:port] = Integer(port)
|
||||
rescue ArgumentError
|
||||
puts "Error: '#{port}' is not a valid port number."
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
opts.on('-c', '--config [FILE]', 'Specify path to the Gollum\'s configuration file.') do |file|
|
||||
options[:config] = file
|
||||
end
|
||||
opts.on('-r', '--ref [REF]', 'Specify the branch to serve. Default: \'master\'.') do |ref|
|
||||
wiki_options[:ref] = ref
|
||||
end
|
||||
opts.on("--bare", "Declare '<git-repo>' to be bare.") do
|
||||
wiki_options[:repo_is_bare] = true
|
||||
end
|
||||
opts.on('-a', '--adapter [ADAPTER]', 'Launch Gollum using a specific git adapter. Default: \'rugged\'.') do |adapter|
|
||||
Gollum::GIT_ADAPTER = adapter
|
||||
end
|
||||
opts.on('-b', '--base-path [PATH]', 'Specify the leading portion of all Gollum URLs (path info). Default: \'/\'.',
|
||||
'Example: setting this to \'/wiki\' will make the wiki accessible under \'http://localhost:4567/wiki/\'.') do |base_path|
|
||||
|
||||
# first trim a leading slash, if any
|
||||
base_path.sub!(/^\/+/, '')
|
||||
|
||||
# make a backup of the option and sanitize it
|
||||
base_path_original = base_path.dup
|
||||
base_path = ERB::Util.url_encode(base_path)
|
||||
base_path.gsub!('%2F', '/')
|
||||
|
||||
# then let the user know if we changed the URL
|
||||
unless base_path_original == base_path
|
||||
puts <<MSG
|
||||
Warning: your base-path has been sanitized:
|
||||
- original: "#{base_path_original}"
|
||||
- sanitized: "#{base_path}"
|
||||
MSG
|
||||
end
|
||||
|
||||
# and finally, let others enjoy our hard work:
|
||||
wiki_options[:base_path] = base_path unless base_path.empty?
|
||||
end
|
||||
opts.on('--page-file-dir [PATH]', 'Specify the subdirectory for all pages. Default: repository root.',
|
||||
'Example: setting this to \'pages\' will make Gollum serve only pages at \'<git-repo>/pages/*\'.') do |path|
|
||||
wiki_options[:page_file_dir] = path
|
||||
end
|
||||
opts.on('--static', 'Use static assets. Defaults to false in development/test, defaults to true in production/staging.') do
|
||||
wiki_options[:static] = true
|
||||
end
|
||||
opts.on('--no-static', 'Do not use static assets (even when in production/staging).') do
|
||||
wiki_options[:static] = false
|
||||
end
|
||||
opts.on('--assets [PATH]', 'Set the path to look for static assets. Only used if --static is set to true, or environment is production/staging. Default: ./public/assets') do |path|
|
||||
wiki_options[:static_assets_path] = path
|
||||
end
|
||||
opts.on('--css', 'Inject custom CSS into each page. The \'<wiki-root>/custom.css\' file is used (must be committed).') do
|
||||
wiki_options[:css] = true
|
||||
end
|
||||
opts.on('--js', 'Inject custom JavaScript into each page. The \'<wiki-root>/custom.js\' file is used (must be committed).') do
|
||||
wiki_options[:js] = true
|
||||
end
|
||||
opts.on('--no-edit', 'Disable the feature of editing pages.') do
|
||||
wiki_options[:allow_editing] = false
|
||||
end
|
||||
opts.on('--follow-renames', 'Follow pages across renames in the History view. Default: true.') do
|
||||
wiki_options[:follow_renames] = true
|
||||
end
|
||||
opts.on('--no-follow-renames', 'Do not follow pages across renames in the History view.') do
|
||||
wiki_options[:follow_renames] = false
|
||||
end
|
||||
opts.on('--allow-uploads [MODE]', [:dir, :page], 'Enable file uploads.',
|
||||
'If set to \'dir\', Gollum will store all uploads in the \'<git-repo>/uploads/\' directory.',
|
||||
'If set to \'page\', Gollum will store uploads per page in \'<git-repo>/uploads/[pagename]\'.') do |mode|
|
||||
wiki_options[:allow_uploads] = true
|
||||
wiki_options[:per_page_uploads] = true if mode == :page
|
||||
end
|
||||
opts.on('--mathjax', 'Enable MathJax (renders mathematical equations).',
|
||||
'By default, uses the \'TeX-AMS-MML_HTMLorMML\' config with the \'autoload-all\' extension.') do
|
||||
wiki_options[:mathjax] = true
|
||||
wiki_options[:mathjax_config] = 'mathjax.config.js'
|
||||
end
|
||||
opts.on('--critic-markup', 'Enable support for annotations using CriticMarkup.') do
|
||||
wiki_options[:critic_markup] = true
|
||||
end
|
||||
opts.on('--irb', 'Launch Gollum in \'console mode\', with a predefined API.') do
|
||||
options[:irb] = true
|
||||
end
|
||||
|
||||
opts.on("--host [HOST]", "Hostname or IP address to listen on (default 0.0.0.0).") do |host|
|
||||
options['bind'] = host
|
||||
end
|
||||
opts.separator ''
|
||||
opts.separator ' Minor:'
|
||||
|
||||
opts.on("--version", "Display current version.") do
|
||||
puts "Gollum " + Gollum::VERSION
|
||||
opts.on('--h1-title', 'Use the first \'<h1>\' as page title.') do
|
||||
wiki_options[:h1_title] = true
|
||||
end
|
||||
opts.on('--no-display-metadata', 'Do not render metadata tables in pages.') do
|
||||
wiki_options[:display_metadata] = false
|
||||
end
|
||||
opts.on('--user-icons [MODE]', [:gravatar, :identicon], 'Use specific user-icons for history view.',
|
||||
'Can be set to \'gravatar\' or \'identicon\'. Default: standard avatar.') do |mode|
|
||||
wiki_options[:user_icons] = mode.to_s
|
||||
end
|
||||
opts.on('--template-dir [PATH]', 'Specify custom mustache template directory. Only overrides templates that exist in this directory.') do |path|
|
||||
wiki_options[:template_dir] = path
|
||||
end
|
||||
opts.on('--template-page', 'Use _Template.{ext} as a template for new pages.') do
|
||||
wiki_options[:template_page] = true
|
||||
end
|
||||
opts.on('--lenient-tag-lookup', 'Internal links resolve case-insensitively, will treat spaces as hyphens, and will match the first page found with a certain filename, anywhere in the repository. Provides compatibility with Gollum 4.x.') do
|
||||
wiki_options[:case_insensitive_tag_lookup] = true
|
||||
wiki_options[:global_tag_lookup] = true
|
||||
wiki_options[:hyphened_tag_lookup] = true
|
||||
end
|
||||
opts.on('--emoji', 'Parse and interpret emoji tags (e.g. :heart:) except when the leading colon is backslashed (e.g. \\:heart:).') do
|
||||
wiki_options[:emoji] = true
|
||||
end
|
||||
opts.separator ''
|
||||
opts.separator ' Common:'
|
||||
|
||||
opts.on('--help', 'Display this message.') do
|
||||
puts opts
|
||||
exit 0
|
||||
end
|
||||
opts.on('--version', 'Display the current version of Gollum.') do
|
||||
puts 'Gollum ' + Gollum::VERSION
|
||||
exit 0
|
||||
end
|
||||
opts.on('--versions', 'Display the current version of Gollum and auxiliary gems.') do
|
||||
require 'gollum-lib'
|
||||
puts 'Gollum ' + Gollum::VERSION
|
||||
puts "Running on: #{RUBY_PLATFORM} with Ruby version #{RUBY_VERSION}"
|
||||
puts 'Using:'
|
||||
loaded_gemspecs = Gem.loaded_specs
|
||||
gollum_gems = ['gollum-lib', 'gollum-rjgit_adapter', 'rjgit', 'gollum-rugged_adapter', 'rugged']
|
||||
puts Gem.loaded_specs.select{|name, spec| gollum_gems.include?(name)}.map {|name, spec| "#{name} #{spec.version}"}
|
||||
puts "Markdown rendering gem: #{GitHub::Markup::Markdown.implementation_name}"
|
||||
puts 'Other renderering gems:'
|
||||
renderer_gems = ['RedCloth', 'org-ruby', 'creole', 'asciidoctor', 'wikicloth']
|
||||
renderer_gems.each do |renderer|
|
||||
begin
|
||||
require renderer
|
||||
rescue LoadError
|
||||
end
|
||||
end
|
||||
results = Gem.loaded_specs.select{|name, spec| renderer_gems.include?(name)}.map {|name, spec| "#{name} #{spec.version}"}
|
||||
puts results.empty? ? 'none' : results
|
||||
exit 0
|
||||
end
|
||||
|
||||
opts.on("--config [CONFIG]", "Path to additional configuration file") do |config|
|
||||
options['config'] = config
|
||||
end
|
||||
|
||||
opts.on("--irb", "Start an irb process with gollum loaded for the current wiki.") do
|
||||
options['irb'] = true
|
||||
end
|
||||
|
||||
opts.on("--css", "Inject custom css. Uses custom.css from root repository") do
|
||||
wiki_options[:css] = true
|
||||
end
|
||||
|
||||
opts.on("--js", "Inject custom js. Uses custom.js from root repository") do
|
||||
wiki_options[:js] = true
|
||||
end
|
||||
|
||||
opts.on("--page-file-dir [PATH]", "Specify the sub directory for all page files (default: repository root).") do |path|
|
||||
wiki_options[:page_file_dir] = path
|
||||
end
|
||||
|
||||
opts.on("--base-path [PATH]", "Specify the base path.") do |path|
|
||||
wiki_options[:base_path] = path
|
||||
end
|
||||
|
||||
opts.on("--gollum-path [PATH]", "Specify the gollum path.") do |path|
|
||||
wiki_options[:gollum_path] = path
|
||||
end
|
||||
|
||||
opts.on("--ref [REF]", "Specify the repository ref to use (default: master).") do |ref|
|
||||
wiki_options[:ref] = ref
|
||||
end
|
||||
|
||||
opts.on("--no-live-preview", "Disables livepreview.") do
|
||||
wiki_options[:live_preview] = false
|
||||
end
|
||||
|
||||
opts.on("--mathjax", "Enables mathjax.") do
|
||||
wiki_options[:mathjax] = true
|
||||
end
|
||||
|
||||
opts.on("--user-icons [SOURCE]", "Set the history user icons. Valid values: gravatar, identicon, none. Default: none.") do |source|
|
||||
wiki_options[:user_icons] = source
|
||||
end
|
||||
|
||||
opts.on("--show-all", "Shows all files in file view. By default only valid pages are shown.") do
|
||||
wiki_options[:show_all] = true
|
||||
end
|
||||
|
||||
opts.on("--collapse-tree", "Collapse file view tree. By default, expanded tree is shown.") do
|
||||
wiki_options[:collapse_tree] = true
|
||||
end
|
||||
opts.on("--h1-title", "Sets page title to value of first h1") do
|
||||
wiki_options[:h1_title] = true
|
||||
end
|
||||
opts.separator ''
|
||||
end
|
||||
|
||||
# Read command line options into `options` hash
|
||||
begin
|
||||
opts.parse!
|
||||
rescue OptionParser::InvalidOption
|
||||
puts "gollum: #{$!.message}"
|
||||
puts "gollum: try 'gollum --help' for more information"
|
||||
rescue OptionParser::InvalidOption => e
|
||||
puts "gollum: #{e.message}"
|
||||
puts 'gollum: try \'gollum --help\' for more information'
|
||||
exit
|
||||
end
|
||||
|
||||
# --gollum-path wins over ARGV[0]
|
||||
gollum_path = wiki_options[:gollum_path] ?
|
||||
wiki_options[:gollum_path] :
|
||||
ARGV[0] || Dir.pwd
|
||||
gollum_path = ARGV[0] || Dir.pwd
|
||||
|
||||
if options['irb']
|
||||
if options[:irb]
|
||||
require 'irb'
|
||||
# http://jameskilton.com/2009/04/02/embedding-irb-into-your-ruby-application/
|
||||
module IRB # :nodoc:
|
||||
@@ -135,30 +240,39 @@ if options['irb']
|
||||
begin
|
||||
require 'gollum-lib'
|
||||
wiki = Gollum::Wiki.new(gollum_path, wiki_options)
|
||||
if !wiki.exist? then raise Grit::InvalidGitRepositoryError end
|
||||
puts "Loaded Gollum wiki at #{File.expand_path(gollum_path).inspect}."
|
||||
if !wiki.exist? then
|
||||
raise Gollum::InvalidGitRepositoryError
|
||||
end
|
||||
|
||||
puts
|
||||
puts 'Loaded Gollum wiki at:'
|
||||
puts "#{File.expand_path(gollum_path).inspect}"
|
||||
puts
|
||||
puts 'Example API calls:'
|
||||
puts %( page = wiki.page('page-name'))
|
||||
puts %( # => <Gollum::Page>)
|
||||
puts
|
||||
puts %( page.raw_data)
|
||||
puts %( # => "# My wiki page")
|
||||
puts %( # => '# My wiki page')
|
||||
puts
|
||||
puts %( page.formatted_data)
|
||||
puts %( # => "<h1>My wiki page</h1>")
|
||||
puts %( # => '<h1>My wiki page</h1>')
|
||||
puts
|
||||
puts 'Full API documentation at:'
|
||||
puts 'https://github.com/gollum/gollum-lib'
|
||||
puts
|
||||
puts "Check out the Gollum README for more."
|
||||
IRB.start_session(binding)
|
||||
rescue Grit::InvalidGitRepositoryError, Grit::NoSuchPathError
|
||||
rescue Gollum::InvalidGitRepositoryError, Gollum::NoSuchPathError
|
||||
puts "Invalid Gollum wiki at #{File.expand_path(gollum_path).inspect}"
|
||||
exit 0
|
||||
end
|
||||
else
|
||||
require 'gollum/app'
|
||||
Precious::App.set(:environment, ENV.fetch('RACK_ENV', :production).to_sym)
|
||||
Precious::App.set(:gollum_path, gollum_path)
|
||||
Precious::App.set(:wiki_options, wiki_options)
|
||||
|
||||
if cfg = options['config']
|
||||
if cfg = options[:config]
|
||||
# If the path begins with a '/' it will be considered an absolute path,
|
||||
# otherwise it will be relative to the CWD
|
||||
cfg = File.join(Dir.getwd, cfg) unless cfg.slice(0) == File::SEPARATOR
|
||||
@@ -167,29 +281,12 @@ else
|
||||
|
||||
base_path = wiki_options[:base_path]
|
||||
|
||||
if wiki_options[:base_path].nil?
|
||||
if base_path.nil?
|
||||
Precious::App.run!(options)
|
||||
else
|
||||
require 'rack'
|
||||
|
||||
class MapGollum
|
||||
def initialize base_path
|
||||
@mg = Rack::Builder.new do
|
||||
map '/' do
|
||||
run Proc.new { [ 302, {'Location'=> "/#{base_path}" }, [] ] }
|
||||
end
|
||||
|
||||
map "/#{base_path}" do
|
||||
run Precious::App
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def call(env)
|
||||
@mg.call(env)
|
||||
end
|
||||
end
|
||||
# Rack::Handler does not work with Ctrl + C. Use Rack::Server instead.
|
||||
Rack::Server.new(:app => MapGollum.new(base_path), :Port => options['port'], :Host => options['bind']).start
|
||||
Rack::Server.new(:app => Precious::MapGollum.new(base_path), :Port => options[:port], :Host => options[:bind]).start
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
#!/usr/bin/env ruby
|
||||
#coding:utf-8
|
||||
require 'optparse'
|
||||
require 'pathname'
|
||||
require 'rubygems'
|
||||
|
||||
wiki_options = {}
|
||||
options = {}
|
||||
|
||||
migrate_options = {
|
||||
:hyphenate => true
|
||||
}
|
||||
|
||||
def setting(const)
|
||||
Object.const_defined?(const.upcase) && Object.const_get(const.upcase)
|
||||
end
|
||||
|
||||
opts = OptionParser.new do |opts|
|
||||
opts.banner = <<EOF
|
||||
Use this tool to migrate a wiki repository created under Gollum versions 4.x or earlier to a 5.x compatibile repo.
|
||||
It finds and repairs Gollum link tags that no longer work under 5.x for three reasons:
|
||||
|
||||
* 5.x wiki internal links may contain spaces. [[Bilbo Baggins]] and [[Bilbo-Baggins]] therefore link to distinct pages.
|
||||
* 5.x wiki internal links are case senitive
|
||||
* 5.x wiki internal links are no longer 'global'.
|
||||
|
||||
* NB: you can use the --lenient-tag-lookup option in gollum >= 5.x to enable 4.x-backwards compatible tags.
|
||||
|
||||
See https://github.com/gollum/gollum/wiki/5.0-release-notes#filename-handling for more information.
|
||||
Usage of this script comes without any warranty.
|
||||
|
||||
Usage: gollum-migrate-tags /path/to/repo
|
||||
|
||||
NB: without the --write flag, this will be a 'dry run' that doesn't actually make any changes, but outputs the changes that would be made.
|
||||
|
||||
You can use the --page-file-dir and --config options as you would normally with gollum.
|
||||
|
||||
Requires a non-bare repository. Recommended usage:
|
||||
|
||||
1. Clone your wiki's repository to create a backup.
|
||||
2. Run this script on your cloned repo.
|
||||
3. If all looks sane, run the script with the --write option. This will overwrite files in your working directory, but not commit the changes, so you have time to review them.
|
||||
4. Do a 'git diff' to inspect the changes.
|
||||
5. Commit the changes if all looks sane, and push/pull them back into your original repo.
|
||||
|
||||
Options:
|
||||
EOF
|
||||
opts.on('-c', '--config [FILE]', 'Specify path to the Gollum\'s configuration file.') do |file|
|
||||
options[:config] = file
|
||||
end
|
||||
|
||||
opts.on('--page-file-dir [PATH]', 'Specify the subdirectory for all pages. Default: repository root.') do |path|
|
||||
wiki_options[:page_file_dir] = path
|
||||
end
|
||||
|
||||
opts.on('--prefer-relative-links', 'When specified, will try to replace broken links with relative links (\'[[Foo/Bar]]\' instead of \'[[/Subdir/Foo/Bar]]\') where possible.') do
|
||||
migrate_options[:prefer_relative] = true
|
||||
end
|
||||
|
||||
opts.on('--hyphenate', 'Default. Repair links that use spaces instead of hyphens: [[Bilbo Baggins]] -> [[Bilbo-Baggins]]') do
|
||||
migrate_options[:hyphenate] = true
|
||||
end
|
||||
|
||||
opts.on('--no-hyphenate', 'Turn off the --hyphenate option.') do
|
||||
migrate_options[:hyphenate] = false
|
||||
end
|
||||
|
||||
opts.on('--run-silent', 'Don\'t output anything.') do
|
||||
migrate_options[:run_silent] = true
|
||||
end
|
||||
|
||||
opts.on('--write', 'No dry run: actually perform the substitutions.') do
|
||||
migrate_options[:no_dry_run] = true
|
||||
end
|
||||
end
|
||||
|
||||
# Read command line options into `options` hash
|
||||
begin
|
||||
opts.parse!
|
||||
migrate_options.each do |setting, value|
|
||||
const = setting.to_s.upcase
|
||||
Object.const_set(const, value) unless Object.const_defined?(const)
|
||||
end
|
||||
wiki_options[:page_file_dir] = setting(:page_file_dir) ? setting(:page_file_dir) : wiki_options[:page_file_dir] # Allow settings :page_file_dir through PAGE_FILE_DIR constant.
|
||||
rescue OptionParser::InvalidOption
|
||||
puts "gollum-migrate-tags: #{$!.message}"
|
||||
puts "gollum-migrate-tags: try 'gollum-migrate-tags --help' for more information"
|
||||
exit
|
||||
end
|
||||
|
||||
REPO = ARGV[0] || Dir.pwd
|
||||
|
||||
require 'gollum-lib'
|
||||
|
||||
if cfg = options[:config]
|
||||
# If the path begins with a '/' it will be considered an absolute path,
|
||||
# otherwise it will be relative to the CWD
|
||||
cfg = File.join(Dir.getwd, cfg) unless cfg.slice(0) == File::SEPARATOR
|
||||
require cfg
|
||||
end
|
||||
|
||||
class Gollum::Filter::CodeMigrator < Gollum::Filter::Code
|
||||
def extract(data)
|
||||
case @markup.format
|
||||
when :asciidoc
|
||||
data.gsub!(/^(\[source,([^\r\n]*)\]\n)?----\n(.+?)\n----$/m) do
|
||||
cache_codeblock($~.to_s)
|
||||
end
|
||||
when :org
|
||||
org_headers = %r{([ \t]*#\+HEADER[S]?:[^\r\n]*\n)*}
|
||||
org_name = %r{([ \t]*#\+NAME:[^\r\n]*\n)?}
|
||||
org_lang = %r{[ ]*([^\n \r]*)[ ]*[^\r\n]*}
|
||||
org_begin = %r{([ \t]*)#\+BEGIN_SRC#{org_lang}\r?\n}
|
||||
org_end = %r{\r?\n[ \t]*#\+END_SRC[ \t\r]*}
|
||||
data.gsub!(/^#{org_headers}#{org_name}#{org_begin}(.+?)#{org_end}$/mi) do
|
||||
cache_codeblock($~.to_s)
|
||||
end
|
||||
when :markdown
|
||||
data.gsub!(/^([ ]{0,3})(~~~+) ?([^\r\n]+)?\r?\n(.+?)\r?\n[ ]{0,3}(~~~+)[ \t\r]*$/m) do
|
||||
m_indent = Regexp.last_match[1]
|
||||
m_start = Regexp.last_match[2] # ~~~
|
||||
m_lang = Regexp.last_match[3]
|
||||
m_code = Regexp.last_match[4]
|
||||
m_end = Regexp.last_match[5] # ~~~
|
||||
# The closing code fence must be at least as long as the opening fence
|
||||
next '' if m_end.length < m_start.length
|
||||
lang = m_lang ? m_lang.strip.split.first : nil
|
||||
cache_codeblock($~.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
data.gsub!(/^([ ]{0,3})``` ?([^\r\n]+)?\r?\n(.+?)\r?\n[ ]{0,3}```[ \t]*\r?$/m) do
|
||||
cache_codeblock($~.to_s)
|
||||
end
|
||||
data
|
||||
end
|
||||
|
||||
def process(data)
|
||||
return data if data.nil? || data.size.zero? || @map.size.zero?
|
||||
@map.each do |id, block| ## Just put the code blocks back in verbatim
|
||||
data.gsub!(id, block)
|
||||
end
|
||||
data
|
||||
end
|
||||
|
||||
def cache_codeblock(block)
|
||||
id = "#{open_pattern}#{Digest::SHA1.hexdigest(block)}#{close_pattern}"
|
||||
@map[id] = block
|
||||
id
|
||||
end
|
||||
end
|
||||
|
||||
class ::Gollum::Filter::TagMigrator < Gollum::Filter::Tags
|
||||
def process_tag(tag)
|
||||
link_part, extra = parse_tag_parts(tag)
|
||||
orig_tag = %{[[#{tag}]]}
|
||||
return orig_tag if link_part.nil?
|
||||
|
||||
img_args = extra ? [extra, link_part] : [link_part]
|
||||
mime = MIME::Types.type_for(::File.extname(img_args.first.to_s)).first
|
||||
|
||||
# For any kind of tag other than an internal link: just return the tag.
|
||||
if tag =~ /^_TOC_/ || link_part =~ /^_$/ || link_part =~ /^#{INCLUDE_TAG}/ || (mime && mime.content_type =~ /^image/) || process_external_link_tag(link_part, extra) || process_file_link_tag(link_part, extra)
|
||||
return orig_tag
|
||||
end
|
||||
|
||||
# Try to resolve it as an internal Page link tag.
|
||||
link = link_part
|
||||
page = find_page_or_file_from_path(link)
|
||||
anchor = nil
|
||||
|
||||
if page.nil? # No match yet, now try finding the page with anchor removed
|
||||
if pos = link.rindex('#')
|
||||
anchor = link[pos..-1]
|
||||
link = link[0...pos]
|
||||
end
|
||||
|
||||
if link.empty? && anchor # Internal anchor link, don't search for the page but return the original tag
|
||||
return orig_tag
|
||||
end
|
||||
|
||||
page = find_page_or_file_from_path(link)
|
||||
end
|
||||
|
||||
if page
|
||||
# Great, the link is not broken. Return the original tag.
|
||||
return orig_tag
|
||||
else
|
||||
possibles = find_linked(link)
|
||||
if possibles.empty?
|
||||
log(:info, "Found no candidates for broken link: #{orig_tag}")
|
||||
return orig_tag
|
||||
else
|
||||
if possibles.size > 1
|
||||
log(:empty)
|
||||
log(:warn, "Found multiple possibilities for the link '#{orig_tag}':")
|
||||
possibles.map! {|p| Pathname.new(p)}
|
||||
possibles.sort!
|
||||
possibles.each{|p| log(:none, "* #{p}")}
|
||||
log(:warn,"Picking #{possibles.first}")
|
||||
log(:empty)
|
||||
end
|
||||
pick = possibles.first
|
||||
return tag_for_pick(pick, orig_tag, extra, anchor, @markup.page.path)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def tag_for_pick(pick, orig_tag, extra, anchor, linking_page_path)
|
||||
pick = if setting(:prefer_relative)
|
||||
overlapping_path = Pathname.new(linking_page_path).dirname.to_s
|
||||
overlapping_path = overlapping_path == '.' ? '' : ::File.join('/', overlapping_path)
|
||||
relative_path = pick.to_s.match(/^#{overlapping_path}\/(.+)/)
|
||||
relative_path ? relative_path[1] : pick
|
||||
else
|
||||
pick
|
||||
end
|
||||
new_tag = extra.nil? ? %{[[#{pick}#{anchor}]]} : %{[[#{extra}|#{pick}#{anchor}]]}
|
||||
log(:info, "#{@markup.page.path}: Changing #{orig_tag} -> #{new_tag}")
|
||||
new_tag
|
||||
end
|
||||
end
|
||||
|
||||
class ::Gollum::Filter::PlainTextMigrator < Gollum::Filter::PlainText
|
||||
def extract(data)
|
||||
data
|
||||
end
|
||||
end
|
||||
|
||||
filter_chain = [:PlainTextMigrator, :CodeMigrator, :TagMigrator]
|
||||
|
||||
wiki = ::Gollum::Wiki.new(REPO, wiki_options.merge({:filter_chain => filter_chain}))
|
||||
TREE = wiki.tree_list(wiki.ref, true, true).map {|file| ::File.join('/', file.path)}
|
||||
|
||||
def find_linked(link)
|
||||
link.gsub!(' ', '-') if setting(:hyphenate) # Match paths containing dashes instead of spaces
|
||||
# If the link has no explicit file extension, test against the link + the '.' character.
|
||||
# This is to avoid that 'Samwi' matches 'Samwise.md'
|
||||
# If it has an explicit file extension ('Samwi.md'), just test against that.
|
||||
test_path = ::File.extname(link).empty? ? /#{link}\..+/ : link
|
||||
# Select pages from the wiki whose path =~ 'Foo/Bar/Samwi.*'
|
||||
# Match case-insenstively to mimic 4.x behavior!
|
||||
TREE.select {|path| path =~ /^\/(.*\/)?#{test_path}/i}
|
||||
end
|
||||
|
||||
def log(kind, msg = nil)
|
||||
unless setting(:run_silent)
|
||||
if kind == :none
|
||||
puts msg
|
||||
elsif kind == :empty
|
||||
puts
|
||||
else
|
||||
puts "[#{kind.to_s.upcase}] #{msg}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
wiki.pages.each do |page|
|
||||
log(:info,"Page #{page.path}")
|
||||
new_data = page.formatted_data
|
||||
if setting(:no_dry_run)
|
||||
path = ::File.join(wiki.path, page.path)
|
||||
f = File.new(path, 'w')
|
||||
f.write(new_data)
|
||||
f.close
|
||||
end
|
||||
log(:none, '====')
|
||||
end
|
||||
@@ -1,28 +1,11 @@
|
||||
# Example gollum config
|
||||
# gollum ../wiki --config config.rb
|
||||
#
|
||||
# or run from source with
|
||||
#
|
||||
# bundle exec bin/gollum ../wiki/ --config config.rb
|
||||
|
||||
# Remove const to avoid
|
||||
# warning: already initialized constant FORMAT_NAMES
|
||||
#
|
||||
# only remove if it's defined.
|
||||
# constant Gollum::Page::FORMAT_NAMES not defined (NameError)
|
||||
Gollum::Page.send :remove_const, :FORMAT_NAMES if defined? Gollum::Page::FORMAT_NAMES
|
||||
# limit to one format
|
||||
Gollum::Page::FORMAT_NAMES = { :markdown => "Markdown" }
|
||||
|
||||
=begin
|
||||
Valid formats are:
|
||||
{ :markdown => "Markdown",
|
||||
:textile => "Textile",
|
||||
:rdoc => "RDoc",
|
||||
:org => "Org-mode",
|
||||
:creole => "Creole",
|
||||
:rest => "reStructuredText",
|
||||
:asciidoc => "AsciiDoc",
|
||||
:mediawiki => "MediaWiki",
|
||||
:pod => "Pod" }
|
||||
This file can be used to (e.g.):
|
||||
- alter certain inner parts of Gollum,
|
||||
- extend it with your stuff.
|
||||
|
||||
It is especially useful for customizing supported formats/markups. For more information and examples:
|
||||
- https://github.com/gollum/gollum#config-file
|
||||
|
||||
=end
|
||||
|
||||
# enter your Ruby code here ...
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
=begin
|
||||
You should use this file, if you wish to:
|
||||
- launch Gollum as a Rack app,
|
||||
- alter certain startup behaviour of Gollum.
|
||||
|
||||
For more information and examples:
|
||||
- https://github.com/gollum/gollum/wiki/Gollum-via-Rack
|
||||
- https://github.com/gollum/gollum#config-file
|
||||
|
||||
=end
|
||||
|
||||
# enter your Ruby code here ...
|
||||
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env ruby
|
||||
#
|
||||
# Distributed under the terms of the MIT License.
|
||||
#
|
||||
# Author: Sam Baskinger <basking2@yahoo.com>
|
||||
#
|
||||
# Description: gollum-post is an example script that shows how
|
||||
# to post a file to Gollum. This may be used
|
||||
# to build scripts around CI/CD pipelines that
|
||||
# publish their documentation to Gollum.
|
||||
#
|
||||
|
||||
require 'uri'
|
||||
require 'mechanize'
|
||||
require 'digest'
|
||||
|
||||
GOLLUM=URI('https://mygollum.server')
|
||||
|
||||
m = Mechanize.new()
|
||||
|
||||
page="TestPage"
|
||||
path="/automated/docs"
|
||||
format="asciidoc"
|
||||
content="""
|
||||
= This is #{page}
|
||||
|
||||
This page is automatically generated.
|
||||
"""
|
||||
message='Posting current documentation.'
|
||||
|
||||
# Check if the page exists.
|
||||
p = m.get("#{GOLLUM}#{path}/#{page}")
|
||||
|
||||
# If we were redirected to the creat page...
|
||||
if p.uri.to_s =~ /\/gollum\/create/
|
||||
|
||||
# ... then create the page.
|
||||
p = m.post("#{GOLLUM}/gollum/create",
|
||||
'keybinding' => 'default',
|
||||
'page' => page,
|
||||
'path' => path,
|
||||
'format' => 'asciidoc',
|
||||
'message' => 'Publish bot.',
|
||||
'content' => content)
|
||||
else
|
||||
# ... else, get the previous content and update it.
|
||||
p = m.get("#{GOLLUM}/gollum/edit#{path}/#{page}")
|
||||
|
||||
# Get the previous content. You _could_ check if this is unchanged at this
|
||||
# step and post nothing.
|
||||
previous_content = p.xpath('//textarea[@id="gollum-editor-body"]')[0].text
|
||||
|
||||
# The previous ETag is the Git SHA-1. We need this to replace the previous contents.
|
||||
prev_etag = Digest::SHA1.hexdigest("blob #{previous_content.length}\0#{previous_content}")
|
||||
|
||||
# Post the updated document using the ETag of the previous document to avoid collisions.
|
||||
p = m.post("#{GOLLUM}/gollum/edit#{path}/#{page}",
|
||||
'keybinding' => 'default',
|
||||
'page' => page,
|
||||
'path' => path,
|
||||
'format' => 'asciidoc',
|
||||
'message' => message,
|
||||
'etag' => prev_etag,
|
||||
'content' => content)
|
||||
end
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
GOLLUM_USER=gollum
|
||||
GOLLUM_BASE=/home/gollum/wiki
|
||||
GOLLUM_OPTS="--config /home/gollum/config.rb"
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/sbin/runscript
|
||||
# Distributed under the terms of the MIT License
|
||||
|
||||
NAME=gollum
|
||||
PID=/var/run/${NAME}.pid
|
||||
EXEC=/usr/local/bin/gollum
|
||||
LOG=/var/log/gollum.log
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start() {
|
||||
# Change log file to be owned by GOLLUM_USER
|
||||
touch "${LOG}"
|
||||
chown "${GOLLUM_USER}" "${LOG}"
|
||||
|
||||
ebegin "Starting Gollum"
|
||||
start-stop-daemon --start \
|
||||
--name "${NAME}" \
|
||||
--user "${GOLLUM_USER}" \
|
||||
--pidfile "${PID}" \
|
||||
--make-pidfile --background \
|
||||
--stderr "${LOG}" \
|
||||
--exec "${EXEC}" -- $GOLLUM_OPTS "$GOLLUM_BASE"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping Gollum"
|
||||
start-stop-daemon --stop \
|
||||
--name "${NAME}" \
|
||||
--user "${GOLLUM_USER}" \
|
||||
--pidfile "${PID}"
|
||||
eend $?
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Gollum wiki server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=%i
|
||||
ExecStart=/usr/bin/gollum
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,79 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: gollum
|
||||
# Required-Start: $local_fs $remote_fs $network $syslog
|
||||
# Required-Stop: $local_fs $remote_fs $network $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# X-Interactive: true
|
||||
# Short-Description: Start/stop gollum wiki
|
||||
### END INIT INFO
|
||||
|
||||
# Distributed under the terms of the MIT License
|
||||
|
||||
set -e
|
||||
|
||||
# Edit these settings to your liking:
|
||||
GOLLUM_USER=gollum
|
||||
GOLLUM_BASE=/var/lib/gollum/.git
|
||||
GOLLUM_OPTS="--bare"
|
||||
|
||||
NAME=gollum
|
||||
PID=/var/run/${NAME}.pid
|
||||
EXEC=/usr/local/bin/gollum
|
||||
LOG=/var/log/gollum.log
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
start ()
|
||||
{
|
||||
# Change log file to be owned by GOLLUM_USER
|
||||
touch "${LOG}"
|
||||
chown "${GOLLUM_USER}" "${LOG}"
|
||||
|
||||
log_daemon_msg "Starting Gollum"
|
||||
start-stop-daemon --start \
|
||||
--name "${NAME}" \
|
||||
--user "${GOLLUM_USER}" \
|
||||
--chuid "${GOLLUM_USER}" \
|
||||
--pidfile "${PID}" \
|
||||
--make-pidfile --background \
|
||||
--startas /bin/sh -- -c "exec ${EXEC} $GOLLUM_OPTS \"$GOLLUM_BASE\" > \"${LOG}\" 2>&1"
|
||||
log_end_msg $?
|
||||
}
|
||||
|
||||
stop ()
|
||||
{
|
||||
log_daemon_msg "Stopping Gollum"
|
||||
start-stop-daemon --stop \
|
||||
--user "${GOLLUM_USER}" \
|
||||
--signal INT \
|
||||
--pidfile "${PID}" \
|
||||
--retry 10
|
||||
log_end_msg $?
|
||||
}
|
||||
|
||||
status ()
|
||||
{
|
||||
status_of_proc -p $PID $EXEC $NAME
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
*)
|
||||
log_success_msg "Usage: $0 {start|stop|restart|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Initialize the wiki
|
||||
if [ ! -d .git ]; then
|
||||
git init
|
||||
fi
|
||||
|
||||
# Start gollum service
|
||||
gollum --mathjax
|
||||
@@ -1,32 +0,0 @@
|
||||
Sanitization Rules
|
||||
==================
|
||||
|
||||
Gollum uses the [Sanitize](http://wonko.com/post/sanitize) gem for HTML
|
||||
sanitization.
|
||||
|
||||
See `lib/gollum.rb` for actual settings.
|
||||
|
||||
## ALLOWED TAGS
|
||||
|
||||
a, abbr, acronym, address, area, b, big, blockquote, br, button, caption,
|
||||
center, cite, code, col, colgroup, dd, del, dfn, dir, div, dl, dt, em,
|
||||
fieldset, font, form, h1, h2, h3, h4, h5, h6, hr, i, img, input, ins, kbd,
|
||||
label, legend, li, map, menu, ol, optgroup, option, p, pre, q, s, samp,
|
||||
select, small, span, strike, strong, sub, sup, table, tbody, td, textarea,
|
||||
tfoot, th, thead, tr, tt, u, ul, var
|
||||
|
||||
## ALLOWED ATTRIBUTES
|
||||
|
||||
abbr, accept, accept-charset, accesskey, action, align, alt, axis, border,
|
||||
cellpadding, cellspacing, char, charoff, charset, checked, cite, class, clear,
|
||||
cols, colspan, color, compact, coords, datetime, dir, disabled, enctype, for,
|
||||
frame, headers, height, href, hreflang, hspace, id, ismap, label, lang,
|
||||
longdesc, maxlength, media, method, multiple, name, nohref, noshade, nowrap,
|
||||
prompt, readonly, rel, rev, rows, rowspan, rules, scope, selected, shape,
|
||||
size, span, src, start, summary, tabindex, target, title, type, usemap,
|
||||
valign, value, vspace, width
|
||||
|
||||
## ALLOWED PROTOCOLS
|
||||
|
||||
a href: http, https, mailto
|
||||
img src: http, https
|
||||
@@ -5,37 +5,35 @@ require 'digest/sha1'
|
||||
require 'ostruct'
|
||||
|
||||
# external
|
||||
require 'grit'
|
||||
require 'i18n'
|
||||
require 'github/markup'
|
||||
require 'sanitize'
|
||||
require 'rhino' if RUBY_PLATFORM == 'java'
|
||||
|
||||
# internal
|
||||
require File.expand_path('../gollum/uri_encode_component', __FILE__)
|
||||
|
||||
# Set ruby to UTF-8 mode
|
||||
# This is required for Ruby 1.8.7 which gollum still supports.
|
||||
$KCODE = 'U' if RUBY_VERSION[0,3] == '1.8'
|
||||
require ::File.expand_path('../gollum/uri_encode_component', __FILE__)
|
||||
|
||||
module Gollum
|
||||
VERSION = '2.4.15'
|
||||
VERSION = '5.2.3'
|
||||
|
||||
::I18n.available_locales = [:en]
|
||||
::I18n.load_path = Dir[::File.expand_path("lib/gollum/locales") + "/*.yml"]
|
||||
|
||||
def self.assets_path
|
||||
::File.expand_path('gollum/public', ::File.dirname(__FILE__))
|
||||
end
|
||||
|
||||
class Error < StandardError; end
|
||||
class TemplateFilter
|
||||
@@filters = {}
|
||||
|
||||
class DuplicatePageError < Error
|
||||
attr_accessor :dir
|
||||
attr_accessor :existing_path
|
||||
attr_accessor :attempted_path
|
||||
def self.add_filter(pattern, &replacement)
|
||||
@@filters[pattern] = replacement
|
||||
end
|
||||
|
||||
def initialize(dir, existing, attempted, message = nil)
|
||||
@dir = dir
|
||||
@existing_path = existing
|
||||
@attempted_path = attempted
|
||||
super(message || "Cannot write #{@dir}/#{@attempted_path}, found #{@dir}/#{@existing_path}.")
|
||||
def self.apply_filters(data)
|
||||
@@filters.each do |pattern, replacement|
|
||||
data.gsub!(pattern, replacement.call)
|
||||
end
|
||||
data
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,27 +1,34 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
# encoding: UTF-8
|
||||
|
||||
require 'cgi'
|
||||
require 'sinatra'
|
||||
require 'sinatra/namespace'
|
||||
require 'gollum-lib'
|
||||
require 'mustache/sinatra'
|
||||
require 'useragent'
|
||||
require 'stringex'
|
||||
require 'json'
|
||||
require 'sprockets'
|
||||
require 'sprockets-helpers'
|
||||
require 'octicons'
|
||||
require 'sass'
|
||||
require 'pathname'
|
||||
|
||||
require 'gollum'
|
||||
require 'gollum/assets'
|
||||
require 'gollum/views/helpers'
|
||||
require 'gollum/views/helpers/locale_helpers'
|
||||
require 'gollum/views/layout'
|
||||
require 'gollum/views/editable'
|
||||
require 'gollum/views/has_page'
|
||||
require 'gollum/views/has_user_icons'
|
||||
require 'gollum/views/pagination'
|
||||
require 'gollum/views/rss.rb'
|
||||
require 'gollum/views/template_cascade'
|
||||
|
||||
require File.expand_path '../helpers', __FILE__
|
||||
|
||||
# Fix to_url
|
||||
class String
|
||||
alias :upstream_to_url :to_url
|
||||
# _Header => header which causes errors
|
||||
def to_url
|
||||
return nil if self.nil?
|
||||
upstream_to_url :exclude => ['_Header', '_Footer', '_Sidebar']
|
||||
end
|
||||
end
|
||||
#required to upload bigger binary files
|
||||
Gollum::set_git_timeout(120)
|
||||
Gollum::set_git_max_filesize(190 * 10**6)
|
||||
|
||||
# Run the frontend, based on Sinatra
|
||||
#
|
||||
@@ -34,41 +41,54 @@ end
|
||||
# }
|
||||
#
|
||||
# See the wiki.rb file for more details on wiki options
|
||||
|
||||
module Precious
|
||||
|
||||
# For use with the --base-path option.
|
||||
class MapGollum
|
||||
def initialize(base_path)
|
||||
@mg = Rack::Builder.new do
|
||||
|
||||
map "/#{base_path}" do
|
||||
run Precious::App
|
||||
end
|
||||
map '/' do
|
||||
run Proc.new { [302, { 'Location' => "/#{base_path}" }, []] }
|
||||
end
|
||||
map '/*' do
|
||||
run Proc.new { [302, { 'Location' => "/#{base_path}" }, []] }
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def call(env)
|
||||
@mg.call(env)
|
||||
end
|
||||
end
|
||||
|
||||
class App < Sinatra::Base
|
||||
register Mustache::Sinatra
|
||||
register Sinatra::Namespace
|
||||
include Precious::Helpers
|
||||
|
||||
Encoding.default_external = "UTF-8"
|
||||
|
||||
dir = File.dirname(File.expand_path(__FILE__))
|
||||
|
||||
# Detect unsupported browsers.
|
||||
Browser = Struct.new(:browser, :version)
|
||||
set :sprockets, ::Precious::Assets.sprockets(dir)
|
||||
|
||||
@@min_ua = [
|
||||
Browser.new('Internet Explorer', '10.0'),
|
||||
Browser.new('Chrome', '7.0'),
|
||||
Browser.new('Firefox', '4.0'),
|
||||
]
|
||||
|
||||
def supported_useragent?(user_agent)
|
||||
ua = UserAgent.parse(user_agent)
|
||||
@@min_ua.detect {|min| ua >= min }
|
||||
end
|
||||
|
||||
# We want to serve public assets for now
|
||||
set :public_folder, "#{dir}/public/gollum"
|
||||
set :static, true
|
||||
set :default_markup, :markdown
|
||||
|
||||
set :mustache, {
|
||||
# Tell mustache where the Views constant lives
|
||||
:namespace => Precious,
|
||||
# Tell mustache where the Views constant lives
|
||||
:namespace => Precious,
|
||||
|
||||
# Mustache templates live here
|
||||
:templates => "#{dir}/templates",
|
||||
# Mustache templates live here
|
||||
:templates => "#{dir}/templates",
|
||||
|
||||
# Tell mustache where the views are
|
||||
:views => "#{dir}/views"
|
||||
# Tell mustache where the views are
|
||||
:views => "#{dir}/views"
|
||||
}
|
||||
|
||||
# Sinatra error handling
|
||||
@@ -82,350 +102,573 @@ module Precious
|
||||
end
|
||||
|
||||
before do
|
||||
@base_url = url('/', false).chomp('/')
|
||||
settings.wiki_options[:allow_editing] = settings.wiki_options.fetch(:allow_editing, true)
|
||||
@allow_editing = settings.wiki_options[:allow_editing]
|
||||
@critic_markup = settings.wiki_options[:critic_markup]
|
||||
@redirects_enabled = settings.wiki_options.fetch(:redirects_enabled, true)
|
||||
@per_page_uploads = settings.wiki_options[:per_page_uploads]
|
||||
|
||||
@wiki_title = settings.wiki_options.fetch(:title, 'Gollum Wiki')
|
||||
|
||||
forbid unless @allow_editing || request.request_method == 'GET'
|
||||
|
||||
if settings.wiki_options[:template_dir]
|
||||
Precious::Views::Layout.extend Precious::Views::TemplateCascade
|
||||
Precious::Views::Layout.template_priority_path = settings.wiki_options[:template_dir]
|
||||
end
|
||||
|
||||
@base_url = url('/', false).chomp('/').force_encoding('utf-8')
|
||||
@page_dir = settings.wiki_options[:page_file_dir].to_s
|
||||
|
||||
# above will detect base_path when it's used with map in a config.ru
|
||||
settings.wiki_options.merge!({ :base_path => @base_url })
|
||||
@css = settings.wiki_options[:css]
|
||||
@js = settings.wiki_options[:js]
|
||||
@js = settings.wiki_options[:js]
|
||||
@mathjax_config = settings.wiki_options[:mathjax_config]
|
||||
|
||||
@use_static_assets = settings.wiki_options.fetch(:static, settings.environment != :development)
|
||||
@static_assets_path = settings.wiki_options.fetch(:static_assets_path, ::File.join(File.dirname(__FILE__), 'public/assets'))
|
||||
@mathjax_path = ::File.join(File.dirname(__FILE__), 'public/gollum/javascript/MathJax')
|
||||
|
||||
Sprockets::Helpers.configure do |config|
|
||||
config.environment = settings.sprockets
|
||||
config.environment.context_class.class_variable_set(:@@base_url, @base_url)
|
||||
config.prefix = "#{@base_url}/#{Precious::Assets::ASSET_URL}"
|
||||
config.digest = @use_static_assets
|
||||
if @use_static_assets
|
||||
config.public_path = @static_assets_path
|
||||
config.manifest = Sprockets::Manifest.new(settings.sprockets, @static_assets_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
get '/' do
|
||||
page_dir = settings.wiki_options[:page_file_dir].to_s
|
||||
redirect clean_url(::File.join(@base_url, page_dir, wiki_new.index_page))
|
||||
redirect clean_url(::File.join(@base_url, wiki_new.index_page))
|
||||
end
|
||||
|
||||
# path is set to name if path is nil.
|
||||
# if path is 'a/b' and a and b are dirs, then
|
||||
# path must have a trailing slash 'a/b/' or
|
||||
# extract_path will trim path to 'a'
|
||||
# name, path, version
|
||||
def wiki_page(name, path = nil, version = nil, exact = true)
|
||||
wiki = wiki_new
|
||||
|
||||
path = name if path.nil?
|
||||
name = extract_name(name) || wiki.index_page
|
||||
path = extract_path(path)
|
||||
path = '/' if exact && path.nil?
|
||||
|
||||
OpenStruct.new(:wiki => wiki, :page => wiki.paged(name, path, exact, version),
|
||||
:name => name, :path => path)
|
||||
end
|
||||
|
||||
def wiki_new
|
||||
Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
end
|
||||
|
||||
get '/data/*' do
|
||||
if page = wiki_page(params[:splat].first).page
|
||||
page.raw_data
|
||||
namespace '/gollum' do
|
||||
get '/feed/' do
|
||||
url = "#{env['rack.url_scheme']}://#{env['HTTP_HOST']}"
|
||||
changes = wiki_new.latest_changes(::Gollum::Page.log_pagination_options(
|
||||
per_page: settings.wiki_options.fetch(:pagination_count, 10),
|
||||
page_num: 0)
|
||||
)
|
||||
content_type :rss
|
||||
RSSView.new(@base_url, @wiki_title, url, changes).render
|
||||
end
|
||||
end
|
||||
|
||||
get '/edit/*' do
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@name = wikip.name
|
||||
@path = wikip.path
|
||||
get '/assets/mathjax/*' do
|
||||
env['PATH_INFO'].sub!('/gollum/assets/mathjax', '')
|
||||
Rack::Static.new(not_found_proc, {:root => @mathjax_path, :urls => ['']}).call(env)
|
||||
end
|
||||
|
||||
wiki = wikip.wiki
|
||||
if page = wikip.page
|
||||
if wiki.live_preview && page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent)
|
||||
live_preview_url = '/livepreview/index.html?page=' + encodeURIComponent(@name)
|
||||
if @path
|
||||
live_preview_url << '&path=' + encodeURIComponent(@path)
|
||||
end
|
||||
redirect to(live_preview_url)
|
||||
get '/assets/*' do
|
||||
env['PATH_INFO'].sub!("/#{Precious::Assets::ASSET_URL}", '')
|
||||
if @use_static_assets
|
||||
env['PATH_INFO'].sub!(Sprockets::Helpers.prefix, '') if @base_url
|
||||
Rack::Static.new(not_found_proc, {:root => @static_assets_path, :urls => ['']}).call(env)
|
||||
else
|
||||
@page = page
|
||||
@page.version = wiki.repo.log(wiki.ref, @page.path).first
|
||||
raw_data = page.raw_data
|
||||
@content = raw_data.respond_to?(:force_encoding) ? raw_data.force_encoding('UTF-8') : raw_data
|
||||
mustache :edit
|
||||
settings.sprockets.call(env)
|
||||
end
|
||||
else
|
||||
redirect to("/create/#{encodeURIComponent(@name)}")
|
||||
end
|
||||
end
|
||||
|
||||
post '/rename/*' do
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
halt 500 if wikip.nil?
|
||||
wiki = wikip.wiki
|
||||
page = wiki.paged(wikip.name, wikip.path, exact = true)
|
||||
rename = params[:rename]
|
||||
halt 500 if page.nil?
|
||||
halt 500 if rename.nil? or rename.empty?
|
||||
|
||||
# Fixup the rename if it is a relative path
|
||||
# In 1.8.7 rename[0] != rename[0..0]
|
||||
if rename[0..0] != '/'
|
||||
source_dir = ::File.dirname(page.path)
|
||||
source_dir = '' if source_dir == '.'
|
||||
(target_dir, target_name) = ::File.split(rename)
|
||||
target_dir = target_dir == '' ? source_dir : "#{source_dir}/#{target_dir}"
|
||||
rename = "#{target_dir}/#{target_name}"
|
||||
end
|
||||
|
||||
committer = Gollum::Committer.new(wiki, commit_message)
|
||||
commit = {:committer => committer}
|
||||
get '/last_commit_info' do
|
||||
content_type :json
|
||||
if page = wiki_page(params[:path]).page
|
||||
version = page.last_version
|
||||
{:author => version.author.name, :date => version.authored_date}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
success = wiki.rename_page(page, rename, commit)
|
||||
if !success
|
||||
get '/emoji/:name' do
|
||||
begin
|
||||
[200, {'Content-Type' => 'image/png'}, emoji(params['name'])]
|
||||
rescue ArgumentError
|
||||
not_found
|
||||
end
|
||||
end
|
||||
|
||||
get '/data/*' do
|
||||
if page = wiki_page(params[:splat].first).page
|
||||
page.raw_data
|
||||
end
|
||||
end
|
||||
|
||||
get %r{/(edit|create)/(\.redirects.gollum|(custom|mathjax\.config)\.(js|css))} do
|
||||
forbid('Changing this resource is not allowed.')
|
||||
end
|
||||
|
||||
post %r{/(delete|rename|edit|create)/(\.redirects.gollum|(custom|mathjax\.config)\.(js|css))} do
|
||||
forbid('Changing this resource is not allowed.')
|
||||
end
|
||||
|
||||
post %r{/revert/(\.redirects.gollum|(custom|mathjax\.config\.)\.(js|css)/.*/.*)} do
|
||||
forbid('Changing this resource is not allowed.')
|
||||
end
|
||||
|
||||
get '/edit/*' do
|
||||
forbid unless @allow_editing
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@name = wikip.fullname
|
||||
@path = wikip.path
|
||||
@upload_dest = find_upload_dest(wikip.fullpath)
|
||||
wiki = wikip.wiki
|
||||
@allow_uploads = wiki.allow_uploads
|
||||
if page = wikip.page
|
||||
@page = page
|
||||
@content = page.text_data
|
||||
@mathjax = wiki.mathjax
|
||||
@etag = page.sha
|
||||
mustache :edit
|
||||
else
|
||||
path = ::File.join('gollum/create', @path, @name)
|
||||
redirect to(clean_url(encodeURIComponent(path)))
|
||||
end
|
||||
end
|
||||
|
||||
# AJAX calls only
|
||||
post '/upload_file' do
|
||||
|
||||
wiki = wiki_new
|
||||
halt 405 unless wiki.allow_uploads
|
||||
|
||||
if params[:file]
|
||||
fullname = params[:file][:filename]
|
||||
tempfile = params[:file][:tempfile]
|
||||
end
|
||||
halt 500 unless tempfile.is_a? Tempfile
|
||||
|
||||
if wiki.per_page_uploads
|
||||
dir = request.referer.sub(request.base_url, '')
|
||||
# remove base path if it is set
|
||||
dir.sub!(/^#{wiki.base_path}/, '') if wiki.base_path
|
||||
# remove base_url and gollum/* subpath if necessary
|
||||
dir.sub!(/^\/gollum\/[-\w]+\//, '')
|
||||
# remove file extension
|
||||
dir.sub!(/#{::File.extname(dir)}$/, '')
|
||||
# revert escaped whitespaces
|
||||
dir.gsub!(/%20/, ' ')
|
||||
dir = ::File.join('uploads', dir)
|
||||
else
|
||||
# store all uploads together
|
||||
dir = 'uploads'
|
||||
end
|
||||
halt 500 if dir.include?('..')
|
||||
halt 500 unless Pathname(dir).relative?
|
||||
|
||||
ext = ::File.extname(fullname)
|
||||
format = ext.split('.').last || 'txt'
|
||||
filename = ::File.basename(fullname, ext)
|
||||
contents = ::File.read(tempfile)
|
||||
reponame = "#{dir}/#{filename}.#{format}"
|
||||
|
||||
options = { :message => "Uploaded file to #{reponame}" }
|
||||
options[:parent] = wiki.repo.head.commit if wiki.repo.head
|
||||
|
||||
author = session['gollum.author']
|
||||
unless author.nil?
|
||||
options.merge! author
|
||||
end
|
||||
|
||||
normalize = Gollum::Page.valid_extension?(fullname)
|
||||
|
||||
begin
|
||||
wiki.write_file(reponame, contents, options)
|
||||
redirect to(request.referer)
|
||||
rescue Gollum::IllegalDirectoryPath => e
|
||||
@message = e.message
|
||||
mustache :error
|
||||
rescue Gollum::DuplicatePageError
|
||||
halt 409 # Signal conflict
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
post '/rename/*' do
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
halt 500 if wikip.nil?
|
||||
wiki = wikip.wiki
|
||||
page = wikip.page
|
||||
rename = params[:rename]
|
||||
halt 500 if page.nil?
|
||||
halt 500 if rename.nil? or rename.empty?
|
||||
|
||||
# Fixup the rename if it is a relative path
|
||||
# In 1.8.7 rename[0] != rename[0..0]
|
||||
if rename[0..0] != '/'
|
||||
source_dir = ::File.dirname(page.path)
|
||||
source_dir = '' if source_dir == '.'
|
||||
(target_dir, target_name) = ::File.split(rename)
|
||||
target_dir = target_dir == '' ? source_dir : "#{source_dir}/#{target_dir}"
|
||||
rename = "#{target_dir}/#{target_name}"
|
||||
end
|
||||
|
||||
committer = Gollum::Committer.new(wiki, commit_message)
|
||||
commit = { :committer => committer }
|
||||
|
||||
success = wiki.rename_page(page, rename, commit)
|
||||
if !success
|
||||
# This occurs on NOOPs, for example renaming A => A
|
||||
redirect to("/#{page.escaped_url_path}")
|
||||
return
|
||||
end
|
||||
|
||||
# Renaming preserves format, so add the page's format to the renamed path to retrieve the renamed page
|
||||
new_path = "#{rename}.#{Gollum::Page.format_to_ext(page.format)}"
|
||||
# Add a redirect from the old page to the new
|
||||
wiki.add_redirect(page.url_path, clean_url(new_path), commit) if @redirects_enabled
|
||||
|
||||
committer.commit
|
||||
|
||||
page = wiki_page(new_path).page
|
||||
return if page.nil?
|
||||
redirect to("/#{page.escaped_url_path}")
|
||||
end
|
||||
committer.commit
|
||||
|
||||
wikip = wiki_page(rename)
|
||||
page = wiki.paged(wikip.name, wikip.path, exact = true)
|
||||
return if page.nil?
|
||||
redirect to("/#{page.escaped_url_path}")
|
||||
end
|
||||
post '/edit/*' do
|
||||
etag = params[:etag]
|
||||
path = "/#{clean_url(sanitize_empty_params(params[:path]))}"
|
||||
wiki = wiki_new
|
||||
page = wiki.page(::File.join(path, params[:page]))
|
||||
|
||||
post '/edit/*' do
|
||||
path = '/' + clean_url(sanitize_empty_params(params[:path])).to_s
|
||||
page_name = CGI.unescape(params[:page])
|
||||
wiki = wiki_new
|
||||
page = wiki.paged(page_name, path, exact = true)
|
||||
return if page.nil?
|
||||
committer = Gollum::Committer.new(wiki, commit_message)
|
||||
commit = {:committer => committer}
|
||||
return if page.nil?
|
||||
if etag != page.sha
|
||||
# Signal edit collision and return the page's most recent version
|
||||
halt 412, {etag: page.sha, text_data: page.text_data}.to_json
|
||||
end
|
||||
|
||||
update_wiki_page(wiki, page, params[:content], commit, page.name, params[:format])
|
||||
update_wiki_page(wiki, page.header, params[:header], commit) if params[:header]
|
||||
update_wiki_page(wiki, page.footer, params[:footer], commit) if params[:footer]
|
||||
update_wiki_page(wiki, page.sidebar, params[:sidebar], commit) if params[:sidebar]
|
||||
committer.commit
|
||||
committer = Gollum::Committer.new(wiki, commit_message)
|
||||
commit = { :committer => committer }
|
||||
|
||||
redirect to("/#{page.escaped_url_path}") unless page.nil?
|
||||
end
|
||||
update_wiki_page(wiki, page, params[:content], commit, page.name, params[:format])
|
||||
update_wiki_page(wiki, page.header, params[:header], commit) if params[:header]
|
||||
update_wiki_page(wiki, page.footer, params[:footer], commit) if params[:footer]
|
||||
update_wiki_page(wiki, page.sidebar, params[:sidebar], commit) if params[:sidebar]
|
||||
committer.commit
|
||||
|
||||
get '/delete/*' do
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
name = wikip.name
|
||||
wiki = wikip.wiki
|
||||
page = wikip.page
|
||||
wiki.delete_page(page, { :message => "Destroyed #{name} (#{page.format})" })
|
||||
|
||||
redirect to('/')
|
||||
end
|
||||
|
||||
get '/create/*' do
|
||||
wikip = wiki_page(params[:splat].first.gsub('+', '-'))
|
||||
@name = wikip.name.to_url
|
||||
@path = wikip.path
|
||||
|
||||
page_dir = settings.wiki_options[:page_file_dir].to_s
|
||||
unless page_dir.empty?
|
||||
# --page-file-dir docs
|
||||
# /docs/Home should be created in /Home
|
||||
# not /docs/Home because write_page will append /docs
|
||||
@path = @path.sub(page_dir, '/') if @path.start_with? page_dir
|
||||
end
|
||||
@path = clean_path(@path)
|
||||
|
||||
page = wikip.page
|
||||
if page
|
||||
page_dir = settings.wiki_options[:page_file_dir].to_s
|
||||
redirect to("/#{clean_url(::File.join(page_dir, page.escaped_url_path))}")
|
||||
else
|
||||
mustache :create
|
||||
post '/delete/*' do
|
||||
forbid unless @allow_editing
|
||||
wiki = wiki_new
|
||||
filepath = params[:splat].first
|
||||
unless filepath.nil?
|
||||
commit = commit_message
|
||||
commit[:message] = "Deleted #{filepath}"
|
||||
wiki.delete_file(filepath, commit)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
post '/create' do
|
||||
name = params[:page].to_url
|
||||
path = sanitize_empty_params(params[:path]) || ''
|
||||
format = params[:format].intern
|
||||
wiki = wiki_new
|
||||
get '/create/*' do
|
||||
forbid unless @allow_editing
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@name = wikip.name
|
||||
@ext = wikip.ext
|
||||
@path = wikip.path
|
||||
@template_page = load_template(@path) if settings.wiki_options[:template_page]
|
||||
@allow_uploads = wikip.wiki.allow_uploads
|
||||
@upload_dest = find_upload_dest(wikip.fullpath)
|
||||
|
||||
begin
|
||||
wiki.write_page(name, format, params[:content], commit_message, path)
|
||||
|
||||
page_dir = settings.wiki_options[:page_file_dir].to_s
|
||||
redirect to("/#{clean_url(::File.join(page_dir, path, name))}")
|
||||
rescue Gollum::DuplicatePageError => e
|
||||
@message = "Duplicate page: #{e.message}"
|
||||
mustache :error
|
||||
page = wikip.page
|
||||
if page
|
||||
redirect to("/#{clean_url(page.escaped_url_path)}")
|
||||
else
|
||||
unless Gollum::Page.format_for("#{@name}#{@ext}")
|
||||
@name = "#{@name}#{@ext}"
|
||||
@ext = nil
|
||||
end
|
||||
mustache :create
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
post '/revert/:page/*' do
|
||||
wikip = wiki_page(params[:page])
|
||||
@path = wikip.path
|
||||
@name = wikip.name
|
||||
wiki = wikip.wiki
|
||||
@page = wiki.paged(@name,@path)
|
||||
shas = params[:splat].first.split("/")
|
||||
sha1 = shas.shift
|
||||
sha2 = shas.shift
|
||||
post '/create' do
|
||||
name = params[:page]
|
||||
path = sanitize_empty_params(params[:path]) || ''
|
||||
format = params[:format].intern
|
||||
wiki = wiki_new
|
||||
|
||||
commit = commit_message
|
||||
commit[:message] = "Revert commit #{sha1.chars.take(7).join}"
|
||||
if wiki.revert_page(@page, sha1, sha2, commit)
|
||||
redirect to("/#{@page.escaped_url_path}")
|
||||
else
|
||||
sha2, sha1 = sha1, "#{sha1}^" if !sha2
|
||||
@versions = [sha1, sha2]
|
||||
diffs = wiki.repo.diff(@versions.first, @versions.last, @page.path)
|
||||
@diff = diffs.first
|
||||
@message = "The patch does not apply."
|
||||
mustache :compare
|
||||
path.gsub!(/^\//, '')
|
||||
|
||||
begin
|
||||
wiki.write_page(::File.join(path, name), format, params[:content], commit_message)
|
||||
|
||||
redirect to("/#{clean_url(::File.join(encodeURIComponent(path), encodeURIComponent(wiki.page_file_name(name, format))))}")
|
||||
rescue Gollum::DuplicatePageError, Gollum::IllegalDirectoryPath => e
|
||||
@message = e.message
|
||||
mustache :error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
post '/preview' do
|
||||
wiki = wiki_new
|
||||
@name = params[:page] || "Preview"
|
||||
@page = wiki.preview_page(@name, params[:content], params[:format])
|
||||
@content = @page.formatted_data
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
@mathjax = wiki.mathjax
|
||||
@h1_title = wiki.h1_title
|
||||
@editable = false
|
||||
mustache :page
|
||||
end
|
||||
post '/revert/*/:sha1/:sha2' do
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@path = wikip.path
|
||||
@name = wikip.fullname
|
||||
wiki = wikip.wiki
|
||||
@page = wikip.page
|
||||
sha1 = params[:sha1]
|
||||
sha2 = params[:sha2]
|
||||
|
||||
get '/history/*' do
|
||||
@page = wiki_page(params[:splat].first).page
|
||||
@page_num = [params[:page].to_i, 1].max
|
||||
@versions = @page.versions :page => @page_num
|
||||
mustache :history
|
||||
end
|
||||
|
||||
post '/compare/*' do
|
||||
@file = params[:splat].first
|
||||
@versions = params[:versions] || []
|
||||
if @versions.size < 2
|
||||
redirect to("/history/#{@file}")
|
||||
else
|
||||
redirect to("/compare/%s/%s...%s" % [
|
||||
@file,
|
||||
@versions.last,
|
||||
@versions.first]
|
||||
)
|
||||
commit = commit_message
|
||||
commit[:message] = "Revert commit #{sha2.chars.take(7).join}"
|
||||
if wiki.revert_page(@page, sha1, sha2, commit)
|
||||
redirect to("/#{@page.escaped_url_path}")
|
||||
else
|
||||
sha2, sha1 = sha1, "#{sha1}^" if !sha2
|
||||
@versions = [sha1, sha2]
|
||||
@diff = wiki.repo.diff(@versions.first, @versions.last, @page.path)
|
||||
@message = 'The patch does not apply.'
|
||||
mustache :compare
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
get %r{
|
||||
/compare/ # match any URL beginning with /compare/
|
||||
(.+) # extract the full path (including any directories)
|
||||
/ # match the final slash
|
||||
([^.]+) # match the first SHA1
|
||||
\.{2,3} # match .. or ...
|
||||
(.+) # match the second SHA1
|
||||
}x do |path, start_version, end_version|
|
||||
wikip = wiki_page(path)
|
||||
@path = wikip.path
|
||||
@name = wikip.name
|
||||
@versions = [start_version, end_version]
|
||||
wiki = wikip.wiki
|
||||
@page = wikip.page
|
||||
diffs = wiki.repo.diff(@versions.first, @versions.last, @page.path)
|
||||
@diff = diffs.first
|
||||
mustache :compare
|
||||
end
|
||||
post '/preview' do
|
||||
wiki = wiki_new
|
||||
@name = params[:page] ? strip_page_name(params[:page]) : 'Preview'
|
||||
@page = wiki.preview_page(@name, params[:content], params[:format])
|
||||
['sidebar', 'header', 'footer'].each do |subpage|
|
||||
@page.send("set_#{subpage}".to_sym, params[subpage]) if params[subpage]
|
||||
end
|
||||
@content = @page.formatted_data
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
@h1_title = wiki.h1_title
|
||||
@editable = false
|
||||
@bar_side = wiki.bar_side
|
||||
@allow_uploads = false
|
||||
@navbar = false
|
||||
@preview = true
|
||||
mustache :page
|
||||
end
|
||||
|
||||
get '/history/*' do
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@name = wikip.fullname
|
||||
@page = wikip.page
|
||||
@page_num = [params[:page_num].to_i, 1].max
|
||||
@max_count = settings.wiki_options.fetch(:pagination_count, 10)
|
||||
unless @page.nil?
|
||||
@wiki = @page.wiki
|
||||
@versions = @page.versions(
|
||||
per_page: @max_count,
|
||||
page_num: @page_num,
|
||||
follow: settings.wiki_options.fetch(:follow_renames, true)
|
||||
)
|
||||
mustache :history
|
||||
else
|
||||
redirect to("/")
|
||||
end
|
||||
end
|
||||
|
||||
get '/latest_changes' do
|
||||
@wiki = wiki_new
|
||||
@page_num = [params[:page_num].to_i, 1].max
|
||||
@max_count = settings.wiki_options.fetch(:pagination_count, 10)
|
||||
@versions = @wiki.latest_changes(::Gollum::Page.log_pagination_options(per_page: @max_count, page_num: @page_num))
|
||||
mustache :latest_changes
|
||||
end
|
||||
|
||||
get %r{
|
||||
/compare/ # match any URL beginning with /compare/
|
||||
(.+) # extract the full path (including any directories)
|
||||
/ # match the final slash
|
||||
([^.]+) # match the first SHA1
|
||||
\.{2,3} # match .. or ...
|
||||
(.+) # match the second SHA1
|
||||
}x do |path, start_version, end_version|
|
||||
wikip = wiki_page(path)
|
||||
@path = wikip.path
|
||||
@name = wikip.fullname
|
||||
@versions = [start_version, end_version]
|
||||
wiki = wikip.wiki
|
||||
@page = wikip.page
|
||||
@diff = wiki.repo.diff(@versions.first, @versions.last, @page.path)
|
||||
if @diff.empty?
|
||||
@message = 'Could not compare these two revisions, no differences were found.'
|
||||
mustache :error
|
||||
else
|
||||
mustache :compare
|
||||
end
|
||||
end
|
||||
|
||||
get '/compare/*' do
|
||||
@file = clean_url(encodeURIComponent(params[:splat].first))
|
||||
@versions = params[:versions] || []
|
||||
if @versions.size == 1
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
commit = wikip.wiki.repo.commit(@versions.first)
|
||||
parent = commit.parent
|
||||
if parent.nil?
|
||||
redirect to("#{@file}/#{@commit.id}")
|
||||
else
|
||||
@versions.push(parent.id)
|
||||
end
|
||||
end
|
||||
if @versions.empty?
|
||||
redirect to("gollum/history/#{@file}")
|
||||
else
|
||||
redirect to("gollum/compare/%s/%s...%s" % [
|
||||
@file,
|
||||
@versions.last,
|
||||
@versions.first]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
get %r{
|
||||
/commit/ # match any URL beginning with /show/
|
||||
(\w+) # match the SHA1
|
||||
}x do |version|
|
||||
@version = version
|
||||
wiki = wiki_new
|
||||
begin
|
||||
@commit = wiki.repo.commit(version)
|
||||
parent = @commit.parent
|
||||
parent_id = parent.nil? ? nil : parent.id
|
||||
@diff = wiki.repo.diff(parent_id, version)
|
||||
mustache :commit
|
||||
rescue Gollum::Git::NoSuchShaFound
|
||||
@message = "Invalid commit: #{@version}"
|
||||
mustache :error
|
||||
end
|
||||
end
|
||||
|
||||
get '/search' do
|
||||
@query = params[:q] || ''
|
||||
@name = @query
|
||||
if @query.empty?
|
||||
@results = []
|
||||
@search_terms = []
|
||||
else
|
||||
@page_num = [params[:page_num].to_i, 1].max
|
||||
@max_count = 10
|
||||
wiki = wiki_new
|
||||
@results, @search_terms = wiki.search(@query)
|
||||
end
|
||||
mustache :search
|
||||
end
|
||||
|
||||
get %r{
|
||||
/overview # match any URL beginning with /overview
|
||||
(?: # begin an optional non-capturing group
|
||||
/(.+) # capture any path after the "/overview" excluding the leading slash
|
||||
)? # end the optional non-capturing group
|
||||
}x do |path|
|
||||
wiki = wiki_new
|
||||
@results = wiki.tree_list
|
||||
|
||||
if path
|
||||
@path = Pathname.new(path).cleanpath.to_s
|
||||
check_path = wiki.page_file_dir ? ::File.join(wiki.page_file_dir, @path, '/') : "#{@path}/"
|
||||
@results.select! {|result| result.path.start_with?(check_path) }
|
||||
end
|
||||
|
||||
@results.sort_by! {|result| result.name.downcase}
|
||||
|
||||
@ref = wiki.ref
|
||||
@newable = true
|
||||
mustache :overview
|
||||
end
|
||||
end # gollum namespace
|
||||
|
||||
get %r{/(.+?)/([0-9a-f]{40})} do
|
||||
file_path = params[:captures][0]
|
||||
version = params[:captures][1]
|
||||
wikip = wiki_page(file_path, file_path, version)
|
||||
name = wikip.name
|
||||
wikip = wiki_page(file_path, version)
|
||||
name = wikip.fullname
|
||||
path = wikip.path
|
||||
if page = wikip.page
|
||||
@page = page
|
||||
@name = name
|
||||
@page = page
|
||||
@name = name
|
||||
@content = page.formatted_data
|
||||
@version = version
|
||||
@historical = true
|
||||
@bar_side = wikip.wiki.bar_side
|
||||
@navbar = true
|
||||
mustache :page
|
||||
elsif file = wikip.wiki.file(file_path, version, true)
|
||||
show_file(file)
|
||||
else
|
||||
halt 404
|
||||
end
|
||||
end
|
||||
|
||||
get '/search' do
|
||||
@query = params[:q]
|
||||
wiki = wiki_new
|
||||
# Sort wiki search results by count (desc) and then by name (asc)
|
||||
@results = wiki.search(@query).sort{ |a, b| (a[:count] <=> b[:count]).nonzero? || b[:name] <=> a[:name] }.reverse
|
||||
@name = @query
|
||||
mustache :search
|
||||
end
|
||||
|
||||
get %r{
|
||||
/pages # match any URL beginning with /pages
|
||||
(?: # begin an optional non-capturing group
|
||||
/(.+) # capture any path after the "/pages" excluding the leading slash
|
||||
)? # end the optional non-capturing group
|
||||
}x do |path|
|
||||
@path = extract_path(path) if path
|
||||
wiki_options = settings.wiki_options.merge({ :page_file_dir => @path })
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, wiki_options)
|
||||
@results = wiki.pages
|
||||
@results += wiki.files if settings.wiki_options[:show_all]
|
||||
@ref = wiki.ref
|
||||
mustache :pages
|
||||
end
|
||||
|
||||
get '/fileview' do
|
||||
wiki = wiki_new
|
||||
options = settings.wiki_options
|
||||
content = wiki.pages
|
||||
# if showing all files include wiki.files
|
||||
content += wiki.files if options[:show_all]
|
||||
|
||||
# must pass wiki_options to FileView
|
||||
# --show-all and --collapse-tree can be set.
|
||||
@results = Gollum::FileView.new(content, options).render_files
|
||||
@ref = wiki.ref
|
||||
mustache :file_view, { :layout => false }
|
||||
get '/\.redirects\.gollum' do
|
||||
forbid('Accessing this resource is not allowed.')
|
||||
end
|
||||
|
||||
get '/*' do
|
||||
show_page_or_file(params[:splat].first)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def show_page_or_file(fullpath)
|
||||
wiki = wiki_new
|
||||
|
||||
name = extract_name(fullpath) || wiki.index_page
|
||||
path = extract_path(fullpath) || '/'
|
||||
|
||||
if page = wiki.paged(name, path, exact = true)
|
||||
@page = page
|
||||
@name = name
|
||||
@content = page.formatted_data
|
||||
if page = wiki.page(fullpath)
|
||||
@page = page
|
||||
@name = page.filename_stripped
|
||||
@content = page.formatted_data
|
||||
@upload_dest = find_upload_dest(Pathname.new(fullpath).cleanpath.to_s)
|
||||
|
||||
# Extensions and layout data
|
||||
@editable = true
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
@mathjax = wiki.mathjax
|
||||
@h1_title = wiki.h1_title
|
||||
@bar_side = wiki.bar_side
|
||||
|
||||
@editable = true
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
@mathjax = wiki.mathjax
|
||||
@h1_title = wiki.h1_title
|
||||
@bar_side = wiki.bar_side
|
||||
@allow_uploads = wiki.allow_uploads
|
||||
@navbar = true
|
||||
mustache :page
|
||||
elsif file = wiki.file(fullpath, wiki.ref, true)
|
||||
if file.on_disk?
|
||||
send_file file.on_disk_path, :disposition => 'inline'
|
||||
else
|
||||
content_type file.mime_type
|
||||
file.raw_data
|
||||
end
|
||||
show_file(file)
|
||||
elsif @redirects_enabled && redirect_path = wiki.redirects[fullpath]
|
||||
redirect to("#{encodeURIComponent(redirect_path)}?redirected_from=#{encodeURIComponent(fullpath)}")
|
||||
else
|
||||
page_path = [path, name].compact.join('/')
|
||||
redirect to("/create/#{clean_url(encodeURIComponent(page_path))}")
|
||||
if @allow_editing
|
||||
path = fullpath[-1] == '/' ? "#{fullpath}#{wiki.index_page}" : fullpath # Append default index page if no page name is supplied
|
||||
redirect to("/gollum/create/#{clean_url(encodeURIComponent(path))}")
|
||||
else
|
||||
@message = "The requested page does not exist."
|
||||
status 404
|
||||
return mustache :error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def show_file(file)
|
||||
return unless file
|
||||
if file.on_disk?
|
||||
send_file file.on_disk_path, :disposition => 'inline'
|
||||
else
|
||||
content_type file.mime_type
|
||||
file.raw_data
|
||||
end
|
||||
end
|
||||
|
||||
def load_template(path)
|
||||
template_page = wiki_page(::File.join(path, '_Template')).page || wiki_page('/_Template').page
|
||||
template_page ? Gollum::TemplateFilter.apply_filters(template_page.text_data) : nil
|
||||
end
|
||||
|
||||
def update_wiki_page(wiki, page, content, commit, name = nil, format = nil)
|
||||
return if !page ||
|
||||
((!content || page.raw_data == content) && page.format == format)
|
||||
((!content || page.raw_data == content) && page.format == format)
|
||||
name ||= page.name
|
||||
format = (format || page.format).to_sym
|
||||
format = (format || page.format).to_sym
|
||||
content ||= page.raw_data
|
||||
wiki.update_page(page, name, format, content.to_s, commit)
|
||||
end
|
||||
|
||||
private
|
||||
def wiki_page(path, version = nil)
|
||||
pathname = (Pathname.new('/') + path).cleanpath
|
||||
wiki = wiki_new
|
||||
OpenStruct.new(:wiki => wiki, :page => wiki.page(pathname.to_s, version = version),
|
||||
:name => pathname.basename.sub_ext('').to_s, :path => pathname.dirname.to_s, :ext => pathname.extname, :fullname => pathname.basename.to_s, :fullpath => pathname.to_s)
|
||||
end
|
||||
|
||||
def wiki_new
|
||||
Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
end
|
||||
|
||||
# Options parameter to Gollum::Committer#initialize
|
||||
# :message - The String commit message.
|
||||
@@ -434,11 +677,19 @@ module Precious
|
||||
# message is sourced from the incoming request parameters
|
||||
# author details are sourced from the session, to be populated by rack middleware ahead of us
|
||||
def commit_message
|
||||
msg = (params[:message].nil? or params[:message].empty?) ? "[no message]" : params[:message]
|
||||
commit_message = { :message => msg }
|
||||
msg = (params[:message].nil? or params[:message].empty?) ? "[no message]" : params[:message]
|
||||
commit_message = { :message => msg }
|
||||
author_parameters = session['gollum.author']
|
||||
commit_message.merge! author_parameters unless author_parameters.nil?
|
||||
commit_message
|
||||
end
|
||||
|
||||
def find_upload_dest(path)
|
||||
settings.wiki_options[:allow_uploads] ?
|
||||
(settings.wiki_options[:per_page_uploads] ?
|
||||
path : 'uploads'
|
||||
) : ''
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
require 'octicons'
|
||||
|
||||
module Precious
|
||||
module Assets
|
||||
MANIFEST = %w(app.js editor.js app.css criticmarkup.css fileview.css ie7.css print.css *.png *.jpg *.svg *.eot *.ttf)
|
||||
ASSET_URL = 'gollum/assets'
|
||||
|
||||
def self.sprockets(dir = File.dirname(File.expand_path(__FILE__)))
|
||||
env = Sprockets::Environment.new
|
||||
env.append_path ::File.join(dir, 'public/gollum/stylesheets/')
|
||||
env.append_path ::File.join(dir, 'public/gollum/javascript')
|
||||
env.append_path ::File.join(dir, 'public/gollum/images')
|
||||
env.append_path ::File.join(dir, 'public/gollum/fonts')
|
||||
|
||||
env.js_compressor = :uglify unless Precious::App.development?
|
||||
env.css_compressor = :scss
|
||||
|
||||
env.context_class.class_eval do
|
||||
def base_url
|
||||
self.class.class_variable_get(:@@base_url)
|
||||
end
|
||||
include ::Octicons
|
||||
include ::Precious::Views::RouteHelpers
|
||||
include ::Precious::Views::OcticonHelpers
|
||||
end
|
||||
env
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,43 +1,50 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
require 'gemojione'
|
||||
|
||||
module Precious
|
||||
module Helpers
|
||||
# Extract the path string that Gollum::Wiki expects
|
||||
def extract_path(file_path)
|
||||
return nil if file_path.nil?
|
||||
last_slash = file_path.rindex("/")
|
||||
if last_slash
|
||||
file_path[0, last_slash]
|
||||
end
|
||||
end
|
||||
|
||||
# Extract the 'page' name from the file_path
|
||||
def extract_name(file_path)
|
||||
if file_path[-1, 1] == "/"
|
||||
return nil
|
||||
end
|
||||
|
||||
# File.basename is too eager to please and will return the last
|
||||
# component of the path even if it ends with a directory separator.
|
||||
::File.basename(file_path)
|
||||
end
|
||||
EMOJI_PATHNAME = Pathname.new(Gemojione.images_path).freeze
|
||||
|
||||
def sanitize_empty_params(param)
|
||||
[nil,''].include?(param) ? nil : CGI.unescape(param)
|
||||
[nil, ''].include?(param) ? nil : CGI.unescape(param)
|
||||
end
|
||||
|
||||
# Ensure path begins with a single leading slash
|
||||
def clean_path(path)
|
||||
if path
|
||||
(path[0] != '/' ? path.insert(0, '/') : path).gsub(/\/{2,}/,'/')
|
||||
end
|
||||
def strip_page_name(name)
|
||||
# Check if name already has a format extension, and if so, strip it.
|
||||
Gollum::Page.valid_extension?(name) ? Gollum::Page.strip_filename(name) : name
|
||||
end
|
||||
|
||||
# Remove all slashes from the start of string.
|
||||
# Remove all double slashes
|
||||
def clean_url url
|
||||
def clean_url(url)
|
||||
return url if url.nil?
|
||||
url.gsub('%2F','/').gsub(/^\/+/,'').gsub('//','/')
|
||||
url.gsub('%2F', '/').gsub(%r{/{2,}}, '/').gsub(%r{^/}, '')
|
||||
end
|
||||
|
||||
def forbid(msg = "Forbidden. This wiki is set to no-edit mode.")
|
||||
@message = msg
|
||||
status 403
|
||||
halt mustache :error
|
||||
end
|
||||
|
||||
def not_found(msg = nil)
|
||||
@message = msg || "The requested page does not exist."
|
||||
status 404
|
||||
return mustache :error
|
||||
end
|
||||
|
||||
def not_found_proc
|
||||
not_found_msg = 'Not found.'
|
||||
Proc.new {[404, {'Content-Type' => 'text/html', 'Content-Length' => not_found_msg.length.to_s}, [not_found_msg]]}
|
||||
end
|
||||
|
||||
def emoji(name)
|
||||
if emoji = Gemojione.index.find_by_name(name)
|
||||
IO.read(EMOJI_PATHNAME.join("#{emoji['unicode'].downcase}.png"))
|
||||
else
|
||||
fail ArgumentError, "emoji `#{name}' not found"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"files":{"app-f05401ee374f0c7f48fc2bc08e30b4f4db705861fd5895ed70998683b383bfb5.js":{"logical_path":"app.js","mtime":"2021-07-10T00:40:20+09:00","size":136040,"digest":"f05401ee374f0c7f48fc2bc08e30b4f4db705861fd5895ed70998683b383bfb5","integrity":"sha256-8FQB7jdPDH9I/CvAjjC09NtwWGH9WJXtcJmGg7ODv7U="},"editor-9881d0c7ae663293f0e3a7e72729eec7e940fa613185c076709b76d292f5703a.js":{"logical_path":"editor.js","mtime":"2021-07-10T00:42:29+09:00","size":744886,"digest":"9881d0c7ae663293f0e3a7e72729eec7e940fa613185c076709b76d292f5703a","integrity":"sha256-mIHQx65mMpPw46fnJynux+lA+mExhcB2cJt20pL1cDo="},"app-cb122b4c17500faa5e013cb43334fafcf2dd7d72f694b06d9616f8b33fefb694.css":{"logical_path":"app.css","mtime":"2021-07-10T00:39:36+09:00","size":396625,"digest":"cb122b4c17500faa5e013cb43334fafcf2dd7d72f694b06d9616f8b33fefb694","integrity":"sha256-yxIrTBdQD6peATy0MzT6/PLdfXL2lLBtlhb4sz/vtpQ="},"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css":{"logical_path":"criticmarkup.css","mtime":"2021-07-08T05:19:03+09:00","size":646,"digest":"31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4","integrity":"sha256-Ma5dMoK7uOe3w8mRfp+2jjMVprSnXabOxI0huIRpBcQ="},"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css":{"logical_path":"print.css","mtime":"2021-07-08T05:19:03+09:00","size":75,"digest":"512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb","integrity":"sha256-USSYw2i+DT+xuhBd+oQomuSDgOyfy++Ui9TiOwsJW/s="}},"assets":{"app.js":"app-f05401ee374f0c7f48fc2bc08e30b4f4db705861fd5895ed70998683b383bfb5.js","editor.js":"editor-9881d0c7ae663293f0e3a7e72729eec7e940fa613185c076709b76d292f5703a.js","app.css":"app-cb122b4c17500faa5e013cb43334fafcf2dd7d72f694b06d9616f8b33fefb694.css","criticmarkup.css":"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css","print.css":"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css"}}
|
||||
@@ -0,0 +1 @@
|
||||
.criticmarkup mark{background-color:#fffd38;text-decoration:none}.criticmarkup del{background-color:#f6a9a9;text-decoration:line-through}.criticmarkup ins{background-color:#a9f6a9;text-decoration:none}.criticmarkup ins.break{display:block;line-height:2px;padding:0 !important;margin:0 !important}.criticmarkup ins.break span{line-height:1.5em}.criticmarkup .popover{background-color:#fffd38;color:#000}.criticmarkup .critic.comment{display:none}.criticmarkup .popover:hover span.critic.comment{display:block;position:absolute;width:200px;left:30%;font-size:0.8em;color:#ccc;background-color:#333;z-index:10;padding:0.5em 1em;border-radius:0.5em}
|
||||
@@ -0,0 +1 @@
|
||||
div#footer{display:none}nav.actions{display:none}.breadcrumb{display:none}
|
||||
@@ -1,128 +0,0 @@
|
||||
*, html {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
#results a:hover {
|
||||
background-color: #4c4c4c;
|
||||
}
|
||||
|
||||
#home_button {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
#home_button .minibutton {
|
||||
font-size: 1em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#results {
|
||||
position: absolute;
|
||||
top: 60px;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
body, form, ul, li, p, h1, h2, h3, h4, h5 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #606061;
|
||||
color: #ffffff;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1em;
|
||||
margin: 0 0 1em 0;
|
||||
}
|
||||
|
||||
html { font-size: 100%; /* IE hack */ }
|
||||
body { font-size: 1em; /* Sets base font size to 16px */ }
|
||||
table { font-size: 100%; /* IE hack */ }
|
||||
input, select, textarea, th, td { font-size: 1em; }
|
||||
|
||||
/* Prevent wrapping on large file names. */
|
||||
li.file {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* CSS Tree menu styles */
|
||||
ol.tree
|
||||
{
|
||||
padding: 0 0 0 30px;
|
||||
width: 300px;
|
||||
}
|
||||
li
|
||||
{
|
||||
position: relative;
|
||||
margin-left: -15px;
|
||||
list-style: none;
|
||||
}
|
||||
li.file
|
||||
{
|
||||
margin-left: -1px !important;
|
||||
height: 1.5em;
|
||||
}
|
||||
li.file a
|
||||
{
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
}
|
||||
li.file a span.icon
|
||||
{
|
||||
width: 14px;
|
||||
height: 18px;
|
||||
background: url(../images/fileview/document.png) 0 0 no-repeat;
|
||||
display: inline-block;
|
||||
margin-right: 7px;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
li.file a[href *= '.pdf'] span.icon { background: url(../images/fileview/document.png) 0 0 no-repeat; }
|
||||
li.file a[href *= '.html'] span.icon { background: url(../images/fileview/document.png) 0 0 no-repeat; }
|
||||
li.file a[href $= '.css'] span.icon { background: url(../images/fileview/document.png) 0 0 no-repeat; }
|
||||
li.file a[href $= '.js'] span.icon { background: url(../images/fileview/document.png) 0 0 no-repeat; }
|
||||
li input
|
||||
{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
margin-left: 0;
|
||||
opacity: 0;
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
top: 0;
|
||||
}
|
||||
li input + ol
|
||||
{
|
||||
background: url(../images/fileview/toggle-small-expand.png) 40px 0 no-repeat;
|
||||
margin: -1.188em 0 0 -44px; /* 15px */
|
||||
height: 1.5em;
|
||||
}
|
||||
li input + ol > li { display: none; margin-left: -14px !important; padding-left: 1px; }
|
||||
li label
|
||||
{
|
||||
background: url(../images/fileview/folder-horizontal.png) 15px 1px no-repeat;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
padding-left: 37px;
|
||||
}
|
||||
|
||||
li input:checked + ol
|
||||
{
|
||||
background: url(../images/fileview/toggle-small.png) 40px 5px no-repeat;
|
||||
margin: -1.5em 0 0 -44px; /* 20px */
|
||||
padding: 1.563em 0 0 80px;
|
||||
height: auto;
|
||||
}
|
||||
li input:checked + ol > li { display: block; margin: 0 0 0.125em; /* 2px */}
|
||||
li input:checked + ol > li:last-child { margin: 0 0 0.063em; /* 1px */ }
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
/* @control dialog */
|
||||
|
||||
#gollum-dialog-dialog {
|
||||
display: block;
|
||||
overflow: visible;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-inner {
|
||||
margin: 0 0 0 -225px;
|
||||
position: relative;
|
||||
width: 450px;
|
||||
|
||||
border: 7px solid #999;
|
||||
border: 7px solid rgba(0, 0, 0, 0.3);
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-bg {
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
padding: 1em;
|
||||
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f7f7f7), to(#ffffff));
|
||||
background: -moz-linear-gradient(top, #f7f7f7, #ffffff);
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-inner h4 {
|
||||
border-bottom: 1px solid #ddd;
|
||||
color: #000;
|
||||
font-size: 1.8em;
|
||||
line-height: normal;
|
||||
font-weight: bold;
|
||||
margin: 0 0 0.75em 0;
|
||||
padding: 0 0 0.3em 0;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-body {
|
||||
font-size: 1.2em;
|
||||
line-height: 1.6em;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-body fieldset {
|
||||
display: block;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-body fieldset .field {
|
||||
margin: 0 0 1.5em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-body fieldset .field label {
|
||||
color: #000;
|
||||
display: block;
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
line-height: 1.6em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-body fieldset .field input[type="text"] {
|
||||
border: 1px solid #ddd;
|
||||
display: block;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-size: 1.2em;
|
||||
line-height: 1.6em;
|
||||
margin: 0.3em 0 0 0;
|
||||
padding: 0.3em 0.5em;
|
||||
width: 94%;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-body fieldset .field input.code {
|
||||
font-family: 'Monaco', 'Courier New', Courier, monospace;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-body fieldset .field span.context {
|
||||
font-size: .9em;
|
||||
color: #666;
|
||||
}
|
||||
#gollum-dialog-dialog-body fieldset .field span.context span.path {
|
||||
font-family: 'Monaco', 'Courier New', Courier, monospace;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
#gollum-dialog-dialog-body fieldset .field:last-child {
|
||||
margin: 0 0 1em 0;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-buttons {
|
||||
border-top: 1px solid #ddd;
|
||||
overflow: hidden;
|
||||
margin: 1.5em 0 0 0;
|
||||
padding: 1em 0 0 0;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog a.minibutton {
|
||||
float: right;
|
||||
margin-right: 0.5em;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog a.minibutton,
|
||||
#gollum-dialog-dialog a.minibutton:visited {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #d4d4d4;
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
font-size: 1.2em;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-weight: bold;
|
||||
margin: 0 0 0 0.8em;
|
||||
padding: 0.4em 1em;
|
||||
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f4f4f4', endColorstr='#ececec');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#ececec));
|
||||
background: -moz-linear-gradient(top, #f4f4f4, #ececec);
|
||||
|
||||
border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog a.minibutton:hover {
|
||||
background: #3072b3;
|
||||
border-color: #518cc6 #518cc6 #2a65a0;
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
|
||||
text-decoration: none;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3));
|
||||
background: -moz-linear-gradient(top, #599bdc, #3072b3);
|
||||
}
|
||||
@@ -1,539 +0,0 @@
|
||||
/*
|
||||
editor.css
|
||||
Wiki editor formatting
|
||||
*/
|
||||
|
||||
a {
|
||||
-moz-outline: none !important;
|
||||
}
|
||||
|
||||
.jaws {
|
||||
/* JAWS should see it, but you can't */
|
||||
display: block;
|
||||
height: 1px;
|
||||
left: -5000px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: -5000px;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
#gollum-editor {
|
||||
border: 1px solid #e4e4e4;
|
||||
background: #f9f9f9;
|
||||
margin: 1em 0 5em;
|
||||
overflow: hidden;
|
||||
padding: 1em 1em 0.4em;
|
||||
|
||||
border-radius: 1em;
|
||||
-moz-border-radius: 1em;
|
||||
-webkit-border-radius: 1em;
|
||||
}
|
||||
|
||||
.ff #gollum-editor,
|
||||
.ie #gollum-editor {
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
|
||||
#gollum-editor form fieldset {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#gollum-editor .singleline {
|
||||
display: block;
|
||||
margin: 0 0 0.7em 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#gollum-editor .singleline input {
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
color: #000;
|
||||
font-size: 1.1em;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5em;
|
||||
margin: 1em 0 0.4em;
|
||||
padding: 0.5em;
|
||||
width: 98%;
|
||||
}
|
||||
|
||||
#gollum-editor .singleline input.ph {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#gollum-editor .path_note {
|
||||
text-align: right;
|
||||
font-size: small;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#gollum-editor-title-field input#gollum-editor-page-title {
|
||||
font-weight: bold;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#gollum-editor-title-field.active {
|
||||
border-bottom: 1px solid #ddd;
|
||||
display: block;
|
||||
margin: 0 0 0.3em 0;
|
||||
padding: 0 0 0.5em 0;
|
||||
}
|
||||
|
||||
#gollum-editor-title-field input#gollum-editor-page-title.ph {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/* @control editor-view-tab */
|
||||
#gollum-editor #gollum-editor-type-switcher {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* @control function-bar */
|
||||
#gollum-editor #gollum-editor-function-bar {
|
||||
border-bottom: 1px solid #ddd;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
#gollum-editor-title-field + #gollum-editor-function-bar {
|
||||
margin-top: 0.6em;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-function-bar #gollum-editor-function-buttons {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-function-bar.active #gollum-editor-function-buttons {
|
||||
display: block;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
padding: 0 0 1.1em 0;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-function-bar a.function-button {
|
||||
background: #f7f7f7;
|
||||
border: 1px solid #ddd;
|
||||
color: #333;
|
||||
display: block;
|
||||
float: left;
|
||||
height: 25px;
|
||||
overflow: hidden;
|
||||
margin: 0.2em 0.5em 0 0;
|
||||
/* text-indent: -5000px; */
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
width: 25px;
|
||||
|
||||
border-radius: 0.3em;
|
||||
-moz-border-radius: 0.3em;
|
||||
-webkit-border-radius: 0.3em;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f4f4f4', endColorstr='#ececec');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#ececec));
|
||||
background: -moz-linear-gradient(top, #f4f4f4, #ececec);
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-function-bar a.function-button:hover {
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
|
||||
text-decoration: none;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3));
|
||||
background: -moz-linear-gradient(top, #599bdc, #3072b3);
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-function-bar a span {
|
||||
background-image: url(../images/icon-sprite.png);
|
||||
background-repeat: no-repeat;
|
||||
display: block;
|
||||
height: 25px;
|
||||
overflow: hidden;
|
||||
text-indent: -5000px;
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
a#function-bold span { background-position: 0 0; }
|
||||
a#function-italic span { background-position: -27px 0; }
|
||||
a#function-underline span { background-position: -54px 0; }
|
||||
a#function-code span { background-position: -82px 0; }
|
||||
a#function-ul span { background-position: -109px 0; }
|
||||
a#function-ol span { background-position: -136px 0; }
|
||||
a#function-blockquote span { background-position: -163px 0; }
|
||||
a#function-hr span { background-position: -190px 0; }
|
||||
a#function-h1 span { background-position: -217px 0; }
|
||||
a#function-h2 span { background-position: -244px 0; }
|
||||
a#function-h3 span { background-position: -271px 0; }
|
||||
a#function-link span { background-position: -298px 0; }
|
||||
a#function-image span { background-position: -324px 0; }
|
||||
a#function-help span { background-position: -405px 0; }
|
||||
|
||||
a#function-bold:hover span { background-position: 0 -28px; }
|
||||
a#function-italic:hover span { background-position: -27px -28px; }
|
||||
a#function-underline:hover span { background-position: -54px -28px; }
|
||||
a#function-code:hover span { background-position: -82px -28px; }
|
||||
a#function-ul:hover span { background-position: -109px -28px; }
|
||||
a#function-ol:hover span { background-position: -136px -28px; }
|
||||
a#function-blockquote:hover span { background-position: -163px -28px; }
|
||||
a#function-hr:hover span { background-position: -190px -28px; }
|
||||
a#function-h1:hover span { background-position: -217px -28px; }
|
||||
a#function-h2:hover span { background-position: -244px -28px; }
|
||||
a#function-h3:hover span { background-position: -271px -28px; }
|
||||
a#function-link:hover span { background-position: -298px -28px; }
|
||||
a#function-image:hover span { background-position: -324px -28px; }
|
||||
a#function-help:hover span { background-position: -405px -28px; }
|
||||
|
||||
|
||||
#gollum-editor #gollum-editor-function-bar a.disabled {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-function-bar span.function-divider {
|
||||
display: block;
|
||||
float: left;
|
||||
width: 0.5em;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-function-bar #gollum-editor-format-selector {
|
||||
overflow: hidden;
|
||||
padding: .2em 0 .5em 0;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-function-bar
|
||||
#gollum-editor-format-selector select {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #ddd;
|
||||
color: #333;
|
||||
|
||||
float: right;
|
||||
font-size: 1em;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-weight: bold;
|
||||
line-height: 1.6em;
|
||||
padding: 0.3em 0.4em;
|
||||
|
||||
|
||||
border-radius: 0.5em;
|
||||
-moz-border-radius: 0.5em;
|
||||
-webkit-border-radius: 0.5em;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-function-bar
|
||||
#gollum-editor-format-selector label {
|
||||
color: #999;
|
||||
float: right;
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
line-height: 1.6em;
|
||||
padding: .3em 0.5em 0 0;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-function-bar
|
||||
#gollum-editor-format-selector label:after {
|
||||
content: ':';
|
||||
}
|
||||
|
||||
|
||||
/* @section form-fields */
|
||||
|
||||
#gollum-editor textarea {
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
font-size: 1em;
|
||||
font-family: Consolas, "Liberation Mono", Courier, monospace;
|
||||
line-height: 1.4em;
|
||||
margin: 1em 0 0.4em;
|
||||
padding: 0.5em;
|
||||
width: 98%;
|
||||
height: 20em;
|
||||
}
|
||||
|
||||
#gollum-editor input#gollum-editor-submit {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #d4d4d4;
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
float: left;
|
||||
font-size: 1em;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
padding: 0.4em 1em;
|
||||
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f4f4f4', endColorstr='#ececec');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#ececec));
|
||||
background: -moz-linear-gradient(top, #f4f4f4, #ececec);
|
||||
|
||||
border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
.webkit #gollum-editor input#gollum-editor-submit {
|
||||
padding: 0.5em 1em 0.45em;
|
||||
}
|
||||
|
||||
.ie #gollum-editor input#gollum-editor-submit {
|
||||
padding: 0.4em 1em 0.5em;
|
||||
}
|
||||
|
||||
#gollum-editor input#gollum-editor-submit:hover {
|
||||
background: #3072b3;
|
||||
border-color: #518cc6 #518cc6 #2a65a0;
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
|
||||
text-decoration: none;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3));
|
||||
background: -moz-linear-gradient(top, #599bdc, #3072b3);
|
||||
}
|
||||
|
||||
#gollum-editor .collapsed,
|
||||
#gollum-editor .expanded {
|
||||
border-bottom: 1px solid #ddd;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
padding: 0.5em 0 0;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-body + .collapsed,
|
||||
#gollum-editor #gollum-editor-body + .expanded {
|
||||
border-top: 1px solid #ddd;
|
||||
margin-top: 0.7em;
|
||||
}
|
||||
|
||||
#gollum-editor .collapsed a.button,
|
||||
#gollum-editor .expanded a.button {
|
||||
background: #f7f7f7;
|
||||
border: 1px solid #ddd;
|
||||
color: #333;
|
||||
display: block;
|
||||
float: left;
|
||||
height: 25px;
|
||||
overflow: hidden;
|
||||
margin: 0.2em 0.5em 0.75em 0;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
width: 25px;
|
||||
|
||||
border-radius: 0.3em;
|
||||
-moz-border-radius: 0.3em;
|
||||
-webkit-border-radius: 0.3em;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f4f4f4', endColorstr='#ececec');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#ececec));
|
||||
background: -moz-linear-gradient(top, #f4f4f4, #ececec);
|
||||
}
|
||||
|
||||
#gollum-editor .collapsed h4,
|
||||
#gollum-editor .expanded h4 {
|
||||
font-size: 1.6em;
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0.15em 0 0 0.3em;
|
||||
text-shadow: 0 -1px 0 #fff;
|
||||
}
|
||||
#gollum-editor .collapsed h4 {
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
#gollum-editor .collapsed a.button:hover,
|
||||
#gollum-editor .expanded a.button:hover {
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
|
||||
text-decoration: none;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3));
|
||||
background: -moz-linear-gradient(top, #599bdc, #3072b3);
|
||||
}
|
||||
|
||||
#gollum-editor .collapsed a span,
|
||||
#gollum-editor .expanded a span {
|
||||
background-image: url(../images/icon-sprite.png);
|
||||
background-position: -351px -1px;
|
||||
background-repeat: no-repeat;
|
||||
display: block;
|
||||
height: 25px;
|
||||
overflow: hidden;
|
||||
text-indent: -5000px;
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
#gollum-editor .collapsed a:hover span {
|
||||
background-position: -351px -28px;
|
||||
}
|
||||
|
||||
#gollum-editor .expanded a span {
|
||||
background-position: -378px 0;
|
||||
}
|
||||
|
||||
#gollum-editor .expanded a:hover span {
|
||||
background-position: -378px -28px;
|
||||
}
|
||||
|
||||
#gollum-editor .collapsed textarea {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#gollum-editor .expanded textarea {
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
clear: both;
|
||||
display: block;
|
||||
font-size: 1em;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
height: 7em;
|
||||
line-height: 1.4em;
|
||||
margin: 0.7em 0;
|
||||
padding: 0.5em;
|
||||
width: 98%;
|
||||
}
|
||||
|
||||
/* @control minibutton */
|
||||
|
||||
#gollum-editor a.minibutton,
|
||||
#gollum-editor a.minibutton:visited {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #d4d4d4;
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
font-size: 1em;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-weight: bold;
|
||||
line-height: 1.2em;
|
||||
margin: 0 0 0 0.8em;
|
||||
padding: 0.5em 1em;
|
||||
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f4f4f4', endColorstr='#ececec');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#ececec));
|
||||
background: -moz-linear-gradient(top, #f4f4f4, #ececec);
|
||||
|
||||
border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
#gollum-editor a.minibutton:hover {
|
||||
background: #3072b3;
|
||||
border-color: #518cc6 #518cc6 #2a65a0;
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
|
||||
text-decoration: none;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3));
|
||||
background: -moz-linear-gradient(top, #599bdc, #3072b3);
|
||||
}
|
||||
|
||||
|
||||
#gollum-editor #gollum-editor-preview {
|
||||
float: left;
|
||||
font-weight: normal;
|
||||
padding: left;
|
||||
}
|
||||
|
||||
|
||||
/* @section help */
|
||||
#gollum-editor-help {
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
border: 1px solid #ddd;
|
||||
border-width: 0 1px 1px 1px;
|
||||
}
|
||||
|
||||
#gollum-editor-help-parent,
|
||||
#gollum-editor-help-list {
|
||||
display: block;
|
||||
float: left;
|
||||
height: 17em;
|
||||
list-style-type: none;
|
||||
overflow: auto;
|
||||
margin: 0;
|
||||
padding: 1em 0;
|
||||
width: 18%;
|
||||
}
|
||||
|
||||
#gollum-editor-help-parent {
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
|
||||
#gollum-editor-help-list {
|
||||
background: #fafafa;
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
|
||||
#gollum-editor-help-parent li,
|
||||
#gollum-editor-help-list li {
|
||||
font-size: 1.2em;
|
||||
line-height: 1.6em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#gollum-editor-help-parent li a,
|
||||
#gollum-editor-help-list li a {
|
||||
border: 1px solid transparent;
|
||||
border-width: 1px 0;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
height: 100%;
|
||||
width: auto;
|
||||
padding: 0.2em 1em;
|
||||
text-shadow: 0 -1px 0 #fff;
|
||||
}
|
||||
|
||||
#gollum-editor-help-parent li a:hover,
|
||||
#gollum-editor-help-list li a:hover {
|
||||
background: #fff;
|
||||
border-color: #f0f0f0;
|
||||
text-decoration: none;
|
||||
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#gollum-editor-help-parent li a.selected,
|
||||
#gollum-editor-help-list li a.selected {
|
||||
border: 1px solid #eee;
|
||||
border-bottom-color: #e7e7e7;
|
||||
border-width: 1px 0;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
|
||||
box-shadow: 0 1px 2px #f0f0f0;
|
||||
}
|
||||
|
||||
#gollum-editor-help-wrapper {
|
||||
background: #fff;
|
||||
overflow: auto;
|
||||
height: 17em;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
#gollum-editor-help-content {
|
||||
font-size: 1.2em;
|
||||
margin: 0 1em 0 0.5em;
|
||||
padding: 0;
|
||||
line-height: 1.8em;
|
||||
}
|
||||
|
||||
#gollum-editor-help-content p {
|
||||
margin: 0 0 1em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* IE */
|
||||
.ie #gollum-editor .singleline input {
|
||||
padding-top: 0.25em;
|
||||
padding-bottom: 0.75em;
|
||||
}
|
||||
@@ -1,734 +0,0 @@
|
||||
#wiki-wrapper #template blockquote {
|
||||
margin: 1em 0;
|
||||
border-left: 4px solid #ddd;
|
||||
padding-left: .8em;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
/*
|
||||
gollum.css
|
||||
A basic stylesheet for Gollum
|
||||
*/
|
||||
|
||||
/* @section core */
|
||||
body, html {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 10px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#wiki-wrapper {
|
||||
margin: 0 auto;
|
||||
overflow: visible;
|
||||
width: 920px;
|
||||
padding-left:20px;
|
||||
padding-right:20px;
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: #4183c4;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover, a:visited {
|
||||
color: #4183c4;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
/* @section head */
|
||||
#head {
|
||||
border-bottom: 1px solid #ddd;
|
||||
margin: 4em 0 1.5em;
|
||||
padding-bottom: 0.3em;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#head h1 {
|
||||
font-size: 33px;
|
||||
float: left;
|
||||
line-height: normal;
|
||||
margin: 0;
|
||||
padding: 2px 0 0 0;
|
||||
}
|
||||
|
||||
#head ul.actions {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* @section content */
|
||||
#wiki-content {
|
||||
height: 1%;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
#wiki-content .wrap {
|
||||
height: 1%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* @section comments */
|
||||
#wiki-body #inline-comment {
|
||||
display: none; /* todo */
|
||||
}
|
||||
|
||||
/* @section body */
|
||||
|
||||
.has-leftbar #wiki-body {
|
||||
float: right;
|
||||
clear: right;
|
||||
}
|
||||
|
||||
#wiki-body {
|
||||
display: block;
|
||||
float: left;
|
||||
clear: left;
|
||||
margin-right: 3%;
|
||||
margin-bottom: 40px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.has-sidebar #wiki-body {
|
||||
width: 68%;
|
||||
}
|
||||
|
||||
/* @section toc */
|
||||
#wiki-toc-main {
|
||||
background-color: #F7F7F7;
|
||||
border: 1px solid #DDD;
|
||||
font-size: 13px;
|
||||
padding: 0px 5px;
|
||||
float: left;
|
||||
margin-bottom: 20px;
|
||||
min-width: 33%;
|
||||
|
||||
border-radius: 0.5em;
|
||||
-moz-border-radius: 0.5em;
|
||||
-webkit-border-radius: 0.5em;
|
||||
}
|
||||
#wiki-toc-main > div {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* @section sidebar */
|
||||
.has-leftbar #wiki-sidebar {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.has-rightbar #wiki-sidebar {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#wiki-sidebar {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #ddd;
|
||||
font-size: 13px;
|
||||
padding: 7px;
|
||||
width: 25%;
|
||||
color: #555;
|
||||
|
||||
border-radius: 0.5em;
|
||||
-moz-border-radius: 0.5em;
|
||||
-webkit-border-radius: 0.5em;
|
||||
}
|
||||
|
||||
#wiki-sidebar p {
|
||||
margin: 13px 0 0;
|
||||
}
|
||||
|
||||
#wiki-sidebar > p:first-child {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#wiki-sidebar p.parent {
|
||||
border-bottom: 1px solid #bbb;
|
||||
font-weight: bold;
|
||||
margin: 0 0 0.5em 0;
|
||||
padding: 0 0 0.5em 0;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
/* Back arrow */
|
||||
#wiki-sidebar p.parent:before {
|
||||
color: #666;
|
||||
content: "← ";
|
||||
}
|
||||
|
||||
/* @section footer */
|
||||
|
||||
#wiki-footer {
|
||||
clear: both;
|
||||
margin: 2em 0 5em;
|
||||
}
|
||||
|
||||
.has-sidebar #wiki-footer {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
#wiki-header #header-content,
|
||||
#wiki-footer #footer-content {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #ddd;
|
||||
padding: 1em;
|
||||
|
||||
border-radius: 0.5em;
|
||||
-moz-border-radius: 0.5em;
|
||||
-webkit-border-radius: 0.5em;
|
||||
}
|
||||
#wiki-header #header-content {
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
||||
#wiki-footer #footer-content {
|
||||
margin-top: 1.5em;
|
||||
}
|
||||
|
||||
#wiki-footer #footer-content h3 {
|
||||
font-size: 1.2em;
|
||||
color: #333;
|
||||
margin: 0;
|
||||
padding: 0 0 0.2em;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
#wiki-footer #footer-content p {
|
||||
margin: 0.5em 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#wiki-footer #footer-content ul.links {
|
||||
margin: 0.5em 0 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#wiki-footer #footer-content ul.links li {
|
||||
color: #999;
|
||||
float: left;
|
||||
list-style-position: inside;
|
||||
list-style-type: square;
|
||||
padding: 0;
|
||||
margin-left: 0.75em;
|
||||
}
|
||||
|
||||
#wiki-footer #footer-content ul.links li a {
|
||||
font-weight: bold;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
#wiki-footer #footer-content ul.links li:first-child {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ff #wiki-footer #footer-content ul.links li:first-child {
|
||||
margin: 0 -0.75em 0 0;
|
||||
}
|
||||
|
||||
/* @section page-footer */
|
||||
.page #footer {
|
||||
clear: both;
|
||||
border-top: 1px solid #ddd;
|
||||
margin: 1em 0 7em;
|
||||
}
|
||||
|
||||
#footer p#last-edit {
|
||||
font-size: .9em;
|
||||
line-height: 1.6em;
|
||||
color: #999;
|
||||
margin: 0.9em 0;
|
||||
}
|
||||
|
||||
#footer p#last-edit span.username {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
/* @section history */
|
||||
.history h1 {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.history h1 strong {
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#wiki-history {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
#wiki-history fieldset {
|
||||
border: 0;
|
||||
margin: 1em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#wiki-history table, #wiki-history tbody {
|
||||
border-collapse: collapse;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#wiki-history table tr {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#wiki-history table tr {
|
||||
background-color: #ebf2f6;
|
||||
}
|
||||
|
||||
#wiki-history table tr td {
|
||||
border: 1px solid #c0dce9;
|
||||
font-size: 1em;
|
||||
line-height: 1.6em;
|
||||
margin: 0;
|
||||
padding: 0.3em 0.7em;
|
||||
}
|
||||
|
||||
#wiki-history table tr td.checkbox {
|
||||
width: 4em;
|
||||
padding: 0.3em;
|
||||
}
|
||||
|
||||
#wiki-history table tr td.checkbox input {
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
padding-right: 0;
|
||||
padding-top: 0.4em;
|
||||
margin: 0 auto;
|
||||
width: 1.2em;
|
||||
height: 1.2em;
|
||||
}
|
||||
|
||||
#wiki-history table tr:nth-child(2n),
|
||||
#wiki-history table tr.alt-row {
|
||||
background-color: #f3f7fa;
|
||||
}
|
||||
|
||||
#wiki-history table tr.selected {
|
||||
background-color: #ffffea !important;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#wiki-history table tr td.commit-name {
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
#wiki-history table tr td.commit-name span.time-elapsed {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#wiki-history table tr td.author {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
#wiki-history table tr td.author a {
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#wiki-history table tr td.author a span.username {
|
||||
display: block;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
#wiki-history table tr td img {
|
||||
background-color: #fff;
|
||||
border: 1px solid #999;
|
||||
display: block;
|
||||
float: left;
|
||||
height: 18px;
|
||||
overflow: hidden;
|
||||
margin: 0 0.5em 0 0;
|
||||
width: 18px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
#wiki-history table tr td.commit-name a {
|
||||
font-size: 0.9em;
|
||||
font-family: 'Monaco', 'Andale Mono', Consolas, 'Courier New', monospace;
|
||||
padding: 0 0.2em;
|
||||
}
|
||||
|
||||
.history #footer {
|
||||
margin-bottom: 7em;
|
||||
}
|
||||
|
||||
.history #wiki-history ul.actions li,
|
||||
.history #footer ul.actions li {
|
||||
margin: 0 0.6em 0 0;
|
||||
}
|
||||
|
||||
|
||||
/* @section edit */
|
||||
.edit h1 {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.edit h1 strong {
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
/* @section search */
|
||||
.results h1 {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.results h1 strong {
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.results #results {
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin-bottom: 2em;
|
||||
padding-bottom: 2em;
|
||||
}
|
||||
|
||||
.results #results ul {
|
||||
margin: 2em 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.results #results ul li {
|
||||
font-size: 1.2em;
|
||||
line-height: 1.6em;
|
||||
list-style-position: outside;
|
||||
padding: 0.2em 0;
|
||||
}
|
||||
|
||||
.results #results ul li span.count {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.results p#no-results {
|
||||
font-size: 1.2em;
|
||||
line-height: 1.6em;
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
.results #footer ul.actions li {
|
||||
margin: 0 1em 0 0;
|
||||
}
|
||||
|
||||
|
||||
/* @section compare */
|
||||
.compare h1 {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.compare h1 strong {
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.compare #compare-content {
|
||||
margin-top: 3em;
|
||||
}
|
||||
|
||||
.compare .data {
|
||||
border: 1px solid #ddd;
|
||||
margin: 1em 0 2em;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.compare .data table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.compare .data pre {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.compare .data pre div {
|
||||
padding: 0 0 0 1em;
|
||||
}
|
||||
|
||||
.compare .data tr td {
|
||||
font-family: "Consolas", "Monaco", "Andale Mono", "Courier New", monospace;
|
||||
font-size: 1.2em;
|
||||
line-height: 1.2em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.compare .data tr td + td + td {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.compare .data td.line_numbers {
|
||||
background: #f7f7f7;
|
||||
border-right: 1px solid #999;
|
||||
color: #999;
|
||||
padding: 0 0 0 0.5em;
|
||||
}
|
||||
|
||||
.compare #compare-content ul.actions li,
|
||||
.compare #footer ul.actions li {
|
||||
margin-left: 0;
|
||||
margin-right: 0.6em;
|
||||
}
|
||||
|
||||
.compare #footer {
|
||||
margin-bottom: 7em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* @control syntax */
|
||||
.highlight { background: #ffffff; }
|
||||
.highlight .c { color: #999988; font-style: italic }
|
||||
.highlight .err { color: #a61717; background-color: #e3d2d2 }
|
||||
.highlight .k { font-weight: bold }
|
||||
.highlight .o { font-weight: bold }
|
||||
.highlight .cm { color: #999988; font-style: italic }
|
||||
.highlight .cp { color: #999999; font-weight: bold }
|
||||
.highlight .c1 { color: #999988; font-style: italic }
|
||||
.highlight .cs { color: #999999; font-weight: bold; font-style: italic }
|
||||
.highlight .gd { color: #000000; background-color: #ffdddd }
|
||||
.highlight .gd .x { color: #000000; background-color: #ffaaaa }
|
||||
.highlight .ge { font-style: italic }
|
||||
.highlight .gr { color: #aa0000 }
|
||||
.highlight .gh { color: #999999 }
|
||||
.highlight .gi { color: #000000; background-color: #ddffdd }
|
||||
.highlight .gi .x { color: #000000; background-color: #aaffaa }
|
||||
.highlight .gc { color: #999; background-color: #EAF2F5 }
|
||||
.highlight .go { color: #888888 }
|
||||
.highlight .gp { color: #555555 }
|
||||
.highlight .gs { font-weight: bold }
|
||||
.highlight .gu { color: #aaaaaa }
|
||||
.highlight .gt { color: #aa0000 }
|
||||
|
||||
|
||||
/* @control minibutton */
|
||||
ul.actions {
|
||||
display: block;
|
||||
list-style-type: none;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul.actions li {
|
||||
float: left;
|
||||
font-size: 0.9em;
|
||||
margin-left: 0.6em;
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
|
||||
.minibutton a {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #d4d4d4;
|
||||
color: #333;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
padding: 0.4em 1em;
|
||||
height: 1.4em;
|
||||
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f4f4f4', endColorstr='#ececec');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#ececec));
|
||||
background: -moz-linear-gradient(top, #f4f4f4, #ececec);
|
||||
|
||||
border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
#search-submit {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #d4d4d4;
|
||||
color: #333;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
padding: 0.4em 1em;
|
||||
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f4f4f4', endColorstr='#ececec');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#ececec));
|
||||
background: -moz-linear-gradient(top, #f4f4f4, #ececec);
|
||||
|
||||
border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
.minibutton a:hover,
|
||||
#search-submit:hover {
|
||||
background: #3072b3;
|
||||
border-color: #518cc6 #518cc6 #2a65a0;
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
|
||||
text-decoration: none;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3));
|
||||
background: -moz-linear-gradient(top, #599bdc, #3072b3);
|
||||
}
|
||||
|
||||
.minibutton a:visited {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
/* @special error */
|
||||
#wiki-wrapper.error {
|
||||
height: 1px;
|
||||
position: absolute;
|
||||
overflow: visible;
|
||||
top: 50%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#error {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #e4e4e4;
|
||||
left: 50%;
|
||||
overflow: hidden;
|
||||
padding: 2%;
|
||||
margin: -10% 0 0 -35%;
|
||||
position: absolute;
|
||||
width: 70%;
|
||||
|
||||
border-radius: 0.5em;
|
||||
-moz-border-radius: 0.5em;
|
||||
-webkit-border-radius: 0.5em;
|
||||
}
|
||||
|
||||
#error h1 {
|
||||
font-size: 3em;
|
||||
line-height: normal;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#error p {
|
||||
font-size: 1.2em;
|
||||
line-height: 1.6em;
|
||||
margin: 1em 0 0.5em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
/* @control searchbar */
|
||||
#head #searchbar {
|
||||
float: right;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#head #searchbar #searchbar-fauxtext {
|
||||
background: #fff;
|
||||
border: 1px solid #d4d4d4;
|
||||
overflow: hidden;
|
||||
height: 2.2em;
|
||||
|
||||
border-radius: 0.3em;
|
||||
-moz-border-radius: 0.3em;
|
||||
-webkit-border-radius: 0.3em;
|
||||
}
|
||||
|
||||
#head #searchbar #searchbar-fauxtext input#search-query {
|
||||
border: none;
|
||||
color: #000;
|
||||
float: left;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-size: 1em;
|
||||
height: inherit;
|
||||
padding: 0 .5em;
|
||||
|
||||
-webkit-focus-ring: none;
|
||||
}
|
||||
|
||||
.ie8 #head #searchbar #searchbar-fauxtext input#search-query {
|
||||
padding: 0.5em 0 0 0.5em;
|
||||
}
|
||||
|
||||
#head #searchbar #searchbar-fauxtext input#search-query.ph {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#head #searchbar #searchbar-fauxtext #search-submit {
|
||||
border: 0;
|
||||
border-left: 1px solid #d4d4d4;
|
||||
cursor: pointer;
|
||||
margin: 0 !important;
|
||||
padding: 0;
|
||||
float: right;
|
||||
height: inherit;
|
||||
|
||||
border-radius: 0 3px 3px 0;
|
||||
-moz-border-radius: 0 3px 3px 0;
|
||||
-webkit-border-radius: 0 3px 3px 0;
|
||||
}
|
||||
|
||||
#head #searchbar #searchbar-fauxtext #search-submit span {
|
||||
background-image: url(../images/icon-sprite.png);
|
||||
background-position: -431px -1px;
|
||||
background-repeat: no-repeat;
|
||||
display: block;
|
||||
height: inherit;
|
||||
overflow: hidden;
|
||||
text-indent: -5000px;
|
||||
width: 28px;
|
||||
}
|
||||
|
||||
.ff #head #searchbar #searchbar-fauxtext #search-submit span,
|
||||
.ie #head #searchbar #searchbar-fauxtext #search-submit span {
|
||||
height: 2.2em;
|
||||
}
|
||||
|
||||
#head #searchbar #searchbar-fauxtext #search-submit:hover span {
|
||||
background-position: -431px -28px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* @section pages */
|
||||
|
||||
#pages {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#pages ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#pages li a.file,
|
||||
#pages li a.folder {
|
||||
background-image: url(../images/fileview/document.png);
|
||||
background-position: 0 1px;
|
||||
background-repeat: no-repeat;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
#pages li a.folder {
|
||||
background-image: url(../images/fileview/folder-horizontal.png);
|
||||
}
|
||||
|
||||
#pages .breadcrumb {
|
||||
border-top: 1px solid #ddd;
|
||||
border-bottom: 1px solid #ddd;
|
||||
margin: 1em 0;
|
||||
padding: 0.25em;
|
||||
}
|
||||
|
||||
.clearfloats {
|
||||
clear: both;
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
/* IE7-specific styles */
|
||||
|
||||
.ie #head #searchbar #searchbar-fauxtext input#search-query {
|
||||
border: 0;
|
||||
float: left;
|
||||
padding: 0.4em 0 0 0.5em;
|
||||
}
|
||||
|
||||
.ie #head #searchbar #searchbar-fauxtext #search-submit span {
|
||||
height: 2.25em;
|
||||
}
|
||||
|
||||
#head #searchbar,
|
||||
#head ul.actions {
|
||||
margin: 1em 0 0 0;
|
||||
}
|
||||
|
||||
ul.actions {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.compare #footer ul.actions {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.compare div.data {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.history #version-form {
|
||||
margin: -0.5em 0 -0.5em !important;
|
||||
}
|
||||
|
||||
#gollum-editor {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
#gollum-editor-help-parent li a,
|
||||
#gollum-editor-help-list li a {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-format-selector {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
#gollum-editor .singleline input {
|
||||
padding-top: 0.25em;
|
||||
}
|
||||
|
||||
#gollum-editor .collapsed {
|
||||
padding-bottom: 1.1em;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-submit {
|
||||
padding: 0.5em 1em 0.3em !important;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-preview {
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
#gollum-editor form {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#gollum-editor #gollum-editor-format-selector label {
|
||||
padding-top: 0.1em !important;
|
||||
}
|
||||
@@ -1,630 +0,0 @@
|
||||
/*
|
||||
Gollum v3 Template
|
||||
*/
|
||||
|
||||
/* margin & padding reset*/
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html, body {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
body {
|
||||
font: 13.34px helvetica,arial,freesans,clean,sans-serif;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #4183C4;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.absent {
|
||||
color: #c00;
|
||||
}
|
||||
|
||||
.markdown-body a[id].wiki-toc-anchor {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.markdown-body {
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.markdown-body>*:first-child {
|
||||
margin-top: 0!important;
|
||||
}
|
||||
.markdown-body>*:last-child {
|
||||
margin-bottom: 0!important;
|
||||
}
|
||||
.markdown-body a.absent {
|
||||
color: #c00;
|
||||
}
|
||||
.markdown-body a.anchor {
|
||||
display: block;
|
||||
padding-left: 30px;
|
||||
margin-left: -30px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.markdown-body h1,
|
||||
.markdown-body h2,
|
||||
.markdown-body h3,
|
||||
.markdown-body h4,
|
||||
.markdown-body h5,
|
||||
.markdown-body h6 {
|
||||
margin: 20px 0 10px;
|
||||
padding: 0;
|
||||
font-weight: bold;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
cursor: text;
|
||||
position: relative;
|
||||
}
|
||||
.markdown-body h1:hover a.anchor,
|
||||
.markdown-body h2:hover a.anchor,
|
||||
.markdown-body h3:hover a.anchor,
|
||||
.markdown-body h4:hover a.anchor,
|
||||
.markdown-body h5:hover a.anchor,
|
||||
.markdown-body h6:hover a.anchor {
|
||||
background: url(../images/pin-20.png) no-repeat left center;
|
||||
text-decoration: none;
|
||||
}
|
||||
.markdown-body h1 tt,
|
||||
.markdown-body h1 code,
|
||||
.markdown-body h2 tt,
|
||||
.markdown-body h2 code,
|
||||
.markdown-body h3 tt,
|
||||
.markdown-body h3 code,
|
||||
.markdown-body h4 tt,
|
||||
.markdown-body h4 code,
|
||||
.markdown-body h5 tt,
|
||||
.markdown-body h5 code,
|
||||
.markdown-body h6 tt,
|
||||
.markdown-body h6 code {
|
||||
font-size: inherit;
|
||||
}
|
||||
.markdown-body h1 {
|
||||
font-size: 28px;
|
||||
color: #000;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.markdown-body h2 {
|
||||
font-size: 24px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
color: #000;
|
||||
}
|
||||
.markdown-body h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
.markdown-body h4 {
|
||||
font-size: 16px;
|
||||
}
|
||||
.markdown-body h5 {
|
||||
font-size: 14px;
|
||||
}
|
||||
.markdown-body h6 {
|
||||
color: #777;
|
||||
font-size: 14px;
|
||||
}
|
||||
.markdown-body p,
|
||||
.markdown-body blockquote,
|
||||
.markdown-body ul,
|
||||
.markdown-body ol,
|
||||
.markdown-body dl,
|
||||
.markdown-body table,
|
||||
.markdown-body pre,
|
||||
.markdown-body hr {
|
||||
margin: 0px 0;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.markdown-body li {
|
||||
margin: 0px;
|
||||
}
|
||||
.markdown-body hr {
|
||||
background: transparent url(../images/dirty-shade.png) repeat-x 0 0;
|
||||
border: 0 none;
|
||||
color: #ccc;
|
||||
height: 4px;
|
||||
padding: 0;
|
||||
}
|
||||
.markdown-body>h1:first-child,
|
||||
.markdown-body>h2:first-child,
|
||||
.markdown-body>h3:first-child,
|
||||
.markdown-body>h4:first-child,
|
||||
.markdown-body>h5:first-child,
|
||||
.markdown-body>h6:first-child {
|
||||
}
|
||||
.markdown-body h1+h2+h3{
|
||||
margin-top: 30px;
|
||||
}
|
||||
.markdown-body a:first-child h1,
|
||||
.markdown-body a:first-child h2,
|
||||
.markdown-body a:first-child h3,
|
||||
.markdown-body a:first-child h4,
|
||||
.markdown-body a:first-child h5,
|
||||
.markdown-body a:first-child h6 {
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
.markdown-body h1+p,
|
||||
.markdown-body h2+p,
|
||||
.markdown-body h3+p,
|
||||
.markdown-body h4+p,
|
||||
.markdown-body h5+p,
|
||||
.markdown-body h6+p {
|
||||
margin-top: 0;
|
||||
}
|
||||
.markdown-body li p.first {
|
||||
display: inline-block;
|
||||
}
|
||||
.markdown-body ul,
|
||||
.markdown-body ol {
|
||||
padding-left: 30px;
|
||||
}
|
||||
.markdown-body ul li>:first-child,
|
||||
.markdown-body ol li>:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.markdown-body ul li>:last-child,
|
||||
.markdown-body ol li>:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.markdown-body dl {
|
||||
padding: 0;
|
||||
}
|
||||
.markdown-body dl dt {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
padding: 0;
|
||||
margin: 15px 0 5px;
|
||||
}
|
||||
.markdown-body dl dt:first-child {
|
||||
padding: 0;
|
||||
}
|
||||
.markdown-body dl dt>:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.markdown-body dl dt>:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.markdown-body dl dd {
|
||||
margin: 0 0 15px;
|
||||
padding: 0 15px;
|
||||
}
|
||||
.markdown-body dl dd>:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.markdown-body dl dd>:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.markdown-body blockquote {
|
||||
border-left: 4px solid #DDD;
|
||||
padding: 0 15px;
|
||||
color: #777;
|
||||
}
|
||||
.markdown-body blockquote>:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.markdown-body blockquote>:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.markdown-body table {
|
||||
padding: 0;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
.markdown-body table tr {
|
||||
border-top: 1px solid #ccc;
|
||||
background-color: #fff;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.markdown-body table tr:nth-child(2n) {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.markdown-body table tr th {
|
||||
font-weight: bold;
|
||||
}
|
||||
.markdown-body table tr th,
|
||||
.markdown-body table tr td {
|
||||
border: 1px solid #ccc;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
padding: 6px 13px;
|
||||
}
|
||||
.markdown-body table tr th>:first-child,
|
||||
.markdown-body table tr td>:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.markdown-body table tr th>:last-child,
|
||||
.markdown-body table tr td>:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.markdown-body img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.markdown-body span.frame {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
}
|
||||
.markdown-body span.frame>span {
|
||||
border: 1px solid #ddd;
|
||||
display: block;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
margin: 13px 0 0;
|
||||
padding: 7px;
|
||||
width: auto;
|
||||
}
|
||||
.markdown-body span.frame span img {
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
.markdown-body span.frame span span {
|
||||
clear: both;
|
||||
color: #333;
|
||||
display: block;
|
||||
padding: 5px 0 0;
|
||||
}
|
||||
.markdown-body span.align-center {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
clear: both;
|
||||
}
|
||||
.markdown-body span.align-center>span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px auto 0;
|
||||
text-align: center;
|
||||
}
|
||||
.markdown-body span.align-center span img {
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
.markdown-body span.align-right {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
clear: both;
|
||||
}
|
||||
.markdown-body span.align-right>span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px 0 0;
|
||||
text-align: right;
|
||||
}
|
||||
.markdown-body span.align-right span img {
|
||||
margin: 0;
|
||||
text-align: right;
|
||||
}
|
||||
.markdown-body span.float-left {
|
||||
display: block;
|
||||
margin-right: 13px;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
}
|
||||
.markdown-body span.float-left span {
|
||||
margin: 13px 0 0;
|
||||
}
|
||||
.markdown-body span.float-right {
|
||||
display: block;
|
||||
margin-left: 13px;
|
||||
overflow: hidden;
|
||||
float: right;
|
||||
}
|
||||
.markdown-body span.float-right>span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px auto 0;
|
||||
text-align: right;
|
||||
}
|
||||
.markdown-body code,
|
||||
.markdown-body tt {
|
||||
margin: 0 2px;
|
||||
padding: 0 5px;
|
||||
white-space: nowrap;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.markdown-body pre>tt,
|
||||
.markdown-body pre>code {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
white-space: pre;
|
||||
border: none;
|
||||
background: transparent;
|
||||
}
|
||||
.markdown-body pre {
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #ccc;
|
||||
font-size: 13px;
|
||||
line-height: 19px;
|
||||
overflow: auto;
|
||||
padding: 6px 10px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.markdown-body pre pre,
|
||||
.markdown-body pre code,
|
||||
.markdown-body pre tt {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
}
|
||||
.markdown-body pre pre {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.toc {
|
||||
background-color: #F7F7F7;
|
||||
border: 1px solid #ddd;
|
||||
padding: 5px 10px;
|
||||
margin: 0;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.toc-title {
|
||||
color: #888;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
padding: 2px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.toc ul {
|
||||
padding-left: 10px;
|
||||
margin: 0;
|
||||
}
|
||||
.toc>ul {
|
||||
margin-left: 10px;
|
||||
font-size: 17px;
|
||||
}
|
||||
.toc ul ul {
|
||||
font-size: 15px;
|
||||
}
|
||||
.toc ul ul ul {
|
||||
font-size: 14px;
|
||||
}
|
||||
.toc ul li{
|
||||
margin: 0;
|
||||
}
|
||||
#header-content .toc,
|
||||
#footer-content .toc,
|
||||
#sidebar-content .toc {
|
||||
border: none;
|
||||
}
|
||||
.highlight {
|
||||
background: #fff;
|
||||
}
|
||||
.highlight .c {
|
||||
color: #998;
|
||||
font-style: italic;
|
||||
}
|
||||
.highlight .err {
|
||||
color: #a61717;
|
||||
background-color: #e3d2d2;
|
||||
}
|
||||
.highlight .k {
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .o {
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .cm {
|
||||
color: #998;
|
||||
font-style: italic;
|
||||
}
|
||||
.highlight .cp {
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .c1 {
|
||||
color: #998;
|
||||
font-style: italic;
|
||||
}
|
||||
.highlight .cs {
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
.highlight .gd {
|
||||
color: #000;
|
||||
background-color: #fdd;
|
||||
}
|
||||
.highlight .gd .x {
|
||||
color: #000;
|
||||
background-color: #faa;
|
||||
}
|
||||
.highlight .ge {
|
||||
font-style: italic;
|
||||
}
|
||||
.highlight .gr {
|
||||
color: #a00;
|
||||
}
|
||||
.highlight .gh {
|
||||
color: #999;
|
||||
}
|
||||
.highlight .gi {
|
||||
color: #000;
|
||||
background-color: #dfd;
|
||||
}
|
||||
.highlight .gi .x {
|
||||
color: #000;
|
||||
background-color: #afa;
|
||||
}
|
||||
.highlight .go {
|
||||
color: #888;
|
||||
}
|
||||
.highlight .gp {
|
||||
color: #555;
|
||||
}
|
||||
.highlight .gs {
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .gu {
|
||||
color: #800080;
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .gt {
|
||||
color: #a00;
|
||||
}
|
||||
.highlight .kc {
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .kd {
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .kn {
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .kp {
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .kr {
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .kt {
|
||||
color: #458;
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .m {
|
||||
color: #099;
|
||||
}
|
||||
.highlight .s {
|
||||
color: #d14;
|
||||
}
|
||||
.highlight .na {
|
||||
color: #008080;
|
||||
}
|
||||
.highlight .nb {
|
||||
color: #0086B3;
|
||||
}
|
||||
.highlight .nc {
|
||||
color: #458;
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .no {
|
||||
color: #008080;
|
||||
}
|
||||
.highlight .ni {
|
||||
color: #800080;
|
||||
}
|
||||
.highlight .ne {
|
||||
color: #900;
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .nf {
|
||||
color: #900;
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .nn {
|
||||
color: #555;
|
||||
}
|
||||
.highlight .nt {
|
||||
color: #000080;
|
||||
}
|
||||
.highlight .nv {
|
||||
color: #008080;
|
||||
}
|
||||
.highlight .ow {
|
||||
font-weight: bold;
|
||||
}
|
||||
.highlight .w {
|
||||
color: #bbb;
|
||||
}
|
||||
.highlight .mf {
|
||||
color: #099;
|
||||
}
|
||||
.highlight .mh {
|
||||
color: #099;
|
||||
}
|
||||
.highlight .mi {
|
||||
color: #099;
|
||||
}
|
||||
.highlight .mo {
|
||||
color: #099;
|
||||
}
|
||||
.highlight .sb {
|
||||
color: #d14;
|
||||
}
|
||||
.highlight .sc {
|
||||
color: #d14;
|
||||
}
|
||||
.highlight .sd {
|
||||
color: #d14;
|
||||
}
|
||||
.highlight .s2 {
|
||||
color: #d14;
|
||||
}
|
||||
.highlight .se {
|
||||
color: #d14;
|
||||
}
|
||||
.highlight .sh {
|
||||
color: #d14;
|
||||
}
|
||||
.highlight .si {
|
||||
color: #d14;
|
||||
}
|
||||
.highlight .sx {
|
||||
color: #d14;
|
||||
}
|
||||
.highlight .sr {
|
||||
color: #009926;
|
||||
}
|
||||
.highlight .s1 {
|
||||
color: #d14;
|
||||
}
|
||||
.highlight .ss {
|
||||
color: #990073;
|
||||
}
|
||||
.highlight .bp {
|
||||
color: #999;
|
||||
}
|
||||
.highlight .vc {
|
||||
color: #008080;
|
||||
}
|
||||
.highlight .vg {
|
||||
color: #008080;
|
||||
}
|
||||
.highlight .vi {
|
||||
color: #008080;
|
||||
}
|
||||
.highlight .il {
|
||||
color: #099;
|
||||
}
|
||||
.highlight .gc {
|
||||
color: #999;
|
||||
background-color: #EAF2F5;
|
||||
}
|
||||
.type-csharp .highlight .k {
|
||||
color: #00F;
|
||||
}
|
||||
.type-csharp .highlight .kt {
|
||||
color: #00F;
|
||||
}
|
||||
.type-csharp .highlight .nf {
|
||||
color: #000;
|
||||
font-weight: normal;
|
||||
}
|
||||
.type-csharp .highlight .nc {
|
||||
color: #2B91AF;
|
||||
}
|
||||
.type-csharp .highlight .nn {
|
||||
color: #000;
|
||||
}
|
||||
.type-csharp .highlight .s {
|
||||
color: #A31515;
|
||||
}
|
||||
.type-csharp .highlight .sc {
|
||||
color: #A31515;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 939 B |
|
Before Width: | Height: | Size: 177 B |
|
Before Width: | Height: | Size: 271 B |
|
Before Width: | Height: | Size: 433 B |
|
Before Width: | Height: | Size: 462 B |
|
Before Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 376 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,11 @@
|
||||
Current ACE version: 1.4.6
|
||||
|
||||
# How to update the ACE editor component
|
||||
|
||||
1. Download a new ACE release from (ajax.org/ace-builds)[https://github.com/ajaxorg/ace-builds/releases].
|
||||
2. Extract the `src-min-noconflict` folder from the archive and rename it to `ace`
|
||||
3. Rename the current `ace` folder to `ace-old`
|
||||
3. Place the new version in the javascript directory
|
||||
4. Test if the editor works.
|
||||
6. Remove the old version
|
||||
7. Update the version info in this file
|
||||
@@ -0,0 +1,41 @@
|
||||
# How to update MathJax
|
||||
|
||||
Our intention is to bundle a SLIM MathJax in gollum, so that gollum can work
|
||||
offline with latex equations without bloating the gollum release tarball.
|
||||
|
||||
1. Clone the customized mathjax-cleaner from
|
||||
https://github.com/programfan/mathjax-cleaner
|
||||
|
||||
git clone https://github.com/programfan/MathJax-grunt-cleaner
|
||||
|
||||
2. Install node, npm and grunt. Most of the time the package manager is
|
||||
enough. In case the package manager does not yet provide these packages,
|
||||
follow the instructions on https://www.gruntjs.net.
|
||||
|
||||
3. Install mathjax-cleaner dependencies.
|
||||
|
||||
cd MathJax-grunt-cleaner && npm install
|
||||
|
||||
4. Download latest mathjax release from
|
||||
https://github.com/mathjax/mathjax/releases and unzip to the
|
||||
directory of MathJax-grunt-cleaner.
|
||||
|
||||
5. Prepare grunt environments
|
||||
|
||||
cp Gruntfile.js MathJax-x.y.z
|
||||
cp -r node_modules MathJax-x.y.z
|
||||
|
||||
6. Slimify mathjax
|
||||
|
||||
cd MathJax-x.y.z && grunt && cd ..
|
||||
|
||||
7. Remove old mathjax (careful!)
|
||||
|
||||
rm -rf ${GOLLUM_ROOT}/lib/gollum/public/gollum/javascript/MathJax
|
||||
|
||||
8. Replace bundled mathjax with newly generated one
|
||||
|
||||
cp MathJax-x.y.z ${GOLLUM_ROOT}/lib/gollum/public/gollum/javascript/MathJax
|
||||
|
||||
9. Update mathjax version in ${GOLLUM_ROOT}/lib/gollum/templates/layout.mustache
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/AssistiveMML.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
(function(a,e,b,f){var c=b.config.menuSettings;var d=MathJax.Extension.AssistiveMML={version:"2.7.5",config:b.CombineConfig("AssistiveMML",{disabled:false,styles:{".MJX_Assistive_MathML":{position:"absolute!important",top:0,left:0,clip:(b.Browser.isMSIE&&(document.documentMode||0)<8?"rect(1px 1px 1px 1px)":"rect(1px, 1px, 1px, 1px)"),padding:"1px 0 0 0!important",border:"0!important",height:"1px!important",width:"1px!important",overflow:"hidden!important",display:"block!important","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},".MJX_Assistive_MathML.MJX_Assistive_MathML_Block":{width:"100%!important"}}}),Config:function(){if(!this.config.disabled&&c.assistiveMML==null){b.Config({menuSettings:{assistiveMML:true}})}a.Styles(this.config.styles);b.Register.MessageHook("End Math",function(g){if(c.assistiveMML){return d.AddAssistiveMathML(g[1])}})},AddAssistiveMathML:function(g){var h={jax:b.getAllJax(g),i:0,callback:MathJax.Callback({})};this.HandleMML(h);return h.callback},RemoveAssistiveMathML:function(k){var h=b.getAllJax(k),l;for(var j=0,g=h.length;j<g;j++){l=document.getElementById(h[j].inputID+"-Frame");if(l&&l.getAttribute("data-mathml")){l.removeAttribute("data-mathml");if(l.lastChild&&l.lastChild.className.match(/MJX_Assistive_MathML/)){l.removeChild(l.lastChild)}}}},HandleMML:function(l){var g=l.jax.length,h,i,n,j;while(l.i<g){h=l.jax[l.i];n=document.getElementById(h.inputID+"-Frame");if(h.outputJax!=="NativeMML"&&h.outputJax!=="PlainSource"&&n&&!n.getAttribute("data-mathml")){try{i=h.root.toMathML("").replace(/\n */g,"").replace(/<!--.*?-->/g,"")}catch(k){if(!k.restart){throw k}return MathJax.Callback.After(["HandleMML",this,l],k.restart)}n.setAttribute("data-mathml",i);j=f.addElement(n,"span",{isMathJax:true,unselectable:"on",className:"MJX_Assistive_MathML"+(h.root.Get("display")==="block"?" MJX_Assistive_MathML_Block":"")});try{j.innerHTML=i}catch(k){}n.style.position="relative";n.setAttribute("role","presentation");n.firstChild.setAttribute("aria-hidden","true");j.setAttribute("role","presentation")}l.i++}l.callback()}};b.Startup.signal.Post("AssistiveMML Ready")})(MathJax.Ajax,MathJax.Callback,MathJax.Hub,MathJax.HTML);MathJax.Callback.Queue(["Require",MathJax.Ajax,"[MathJax]/extensions/toMathML.js"],["loadComplete",MathJax.Ajax,"[MathJax]/extensions/AssistiveMML.js"],function(){MathJax.Hub.Register.StartupHook("End Config",["Config",MathJax.Extension.AssistiveMML])});
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/CHTML-preview.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Callback.Queue(["Require",MathJax.Ajax,"[MathJax]/extensions/fast-preview.js"],["loadComplete",MathJax.Ajax,"[MathJax]/extensions/CHTML-preview.js"]);
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/FontWarnings.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
(function(b,d){var i="2.7.5";var a="http://www.stixfonts.org/";var f="https://github.com/mathjax/MathJax/tree/master/fonts/HTML-CSS/TeX/otf";var h=b.CombineConfig("FontWarnings",{messageStyle:{position:"fixed",bottom:"4em",left:"3em",width:"40em",border:"3px solid #880000","background-color":"#E0E0E0",color:"black",padding:"1em","font-size":"small","white-space":"normal","border-radius":".75em","-webkit-border-radius":".75em","-moz-border-radius":".75em","-khtml-border-radius":".75em","box-shadow":"4px 4px 10px #AAAAAA","-webkit-box-shadow":"4px 4px 10px #AAAAAA","-moz-box-shadow":"4px 4px 10px #AAAAAA","-khtml-box-shadow":"4px 4px 10px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=3, OffY=3, Color='gray', Positive='true')"},Message:{webFont:[["closeBox"],["webFont","MathJax is using web-based fonts to display the mathematics on this page. These take time to download, so the page would render faster if you installed math fonts directly in your system's font folder."],["fonts"]],imageFonts:[["closeBox"],["imageFonts","MathJax is using its image fonts rather than local or web-based fonts. This will render slower than usual, and the mathematics may not print at the full resolution of your printer."],["fonts"],["webFonts"]],noFonts:[["closeBox"],["noFonts","MathJax is unable to locate a font to use to display its mathematics, and image fonts are not available, so it is falling back on generic unicode characters in hopes that your browser will be able to display them. Some characters may not show up properly, or possibly not at all."],["fonts"],["webFonts"]]},HTML:{closeBox:[["div",{style:{position:"absolute",overflow:"hidden",top:".1em",right:".1em",border:"1px outset",width:"1em",height:"1em","text-align":"center",cursor:"pointer","background-color":"#EEEEEE",color:"#606060","border-radius":".5em","-webkit-border-radius":".5em","-moz-border-radius":".5em","-khtml-border-radius":".5em"},onclick:function(){if(c.div&&c.fade===0){if(c.timer){clearTimeout(c.timer)}c.div.style.display="none"}}},[["span",{style:{position:"relative",bottom:".2em"}},["x"]]]]],webFonts:[["p"],["webFonts","Most modern browsers allow for fonts to be downloaded over the web. Updating to a more recent version of your browser (or changing browsers) could improve the quality of the mathematics on this page."]],fonts:[["p"],["fonts","MathJax can use either the [STIX fonts](%1) or the [MathJax TeX fonts](%2). Download and install one of those fonts to improve your MathJax experience.",a,f]],STIXfonts:[["p"],["STIXPage","This page is designed to use the [STIX fonts](%1). Download and install those fonts to improve your MathJax experience.",a]],TeXfonts:[["p"],["TeXPage","This page is designed to use the [MathJax TeX fonts](%1). Download and install those fonts to improve your MathJax experience.",f]]},removeAfter:12*1000,fadeoutSteps:10,fadeoutTime:1.5*1000});if(MathJax.Hub.Browser.isIE9&&document.documentMode>=9){delete h.messageStyle.filter}var c={div:null,fade:0};var e=function(m){if(c.div){return}var j=MathJax.OutputJax["HTML-CSS"],n=document.body;if(b.Browser.isMSIE){if(h.messageStyle.position==="fixed"){MathJax.Message.Init();n=document.getElementById("MathJax_MSIE_Frame")||n;if(n!==document.body){h.messageStyle.position="absolute"}}}else{delete h.messageStyle.filter}h.messageStyle.maxWidth=(document.body.clientWidth-75)+"px";var k=0;while(k<m.length){if(MathJax.Object.isArray(m[k])){if(m[k].length===1&&h.HTML[m[k][0]]){m.splice.apply(m,[k,1].concat(h.HTML[m[k][0]]))}else{if(typeof m[k][1]==="string"){var l=MathJax.Localization.lookupPhrase(["FontWarnings",m[k][0]],m[k][1]);l=MathJax.Localization.processMarkdown(l,m[k].slice(2),"FontWarnings");m.splice.apply(m,[k,1].concat(l));k+=l.length}else{k++}}}else{k++}}c.div=j.addElement(n,"div",{id:"MathJax_FontWarning",style:h.messageStyle},m);MathJax.Localization.setCSS(c.div);if(h.removeAfter){b.Register.StartupHook("End",function(){c.timer=setTimeout(g,h.removeAfter)})}d.Cookie.Set("fontWarn",{warned:true})};var g=function(){c.fade++;if(c.timer){delete c.timer}if(c.fade<h.fadeoutSteps){var j=1-c.fade/h.fadeoutSteps;c.div.style.opacity=j;c.div.style.filter="alpha(opacity="+Math.floor(100*j)+")";setTimeout(g,h.fadeoutTime/h.fadeoutSteps)}else{c.div.style.display="none"}};if(!d.Cookie.Get("fontWarn").warned){b.Startup.signal.Interest(function(m){if(m.match(/HTML-CSS Jax - /)&&!c.div){var j=MathJax.OutputJax["HTML-CSS"],n=j.config.availableFonts,l;var k=(n&&n.length);if(!k){h.HTML.fonts=[""]}else{if(n.length===1){h.HTML.fonts=h.HTML[n[0]+"fonts"]}}if(j.allowWebFonts){h.HTML.webfonts=[""]}if(m.match(/- Web-Font/)){if(k){l="webFont"}}else{if(m.match(/- using image fonts/)){l="imageFonts"}else{if(m.match(/- no valid font/)){l="noFonts"}}}if(l&&h.Message[l]){MathJax.Localization.loadDomain("FontWarnings",[e,h.Message[l]])}}})}})(MathJax.Hub,MathJax.HTML);MathJax.Ajax.loadComplete("[MathJax]/extensions/FontWarnings.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/HTML-CSS/handle-floats.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["HTML-CSS/handle-floats"]={version:"2.7.5"};MathJax.Hub.Startup.signal.Post("HTML-CSS handle-floats Ready");MathJax.Ajax.loadComplete("[MathJax]/extensions/HTML-CSS/handle-floats.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/MatchWebFonts.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
(function(c,b){var d="2.7.5";var a=MathJax.Hub.CombineConfig("MatchWebFonts",{matchFor:{"HTML-CSS":true,NativeMML:true,SVG:true},fontCheckDelay:500,fontCheckTimeout:15*1000,});MathJax.Extension.MatchWebFonts={version:d,config:a};c.Register.StartupHook("HTML-CSS Jax Ready",function(){var e=MathJax.OutputJax["HTML-CSS"];var f=e.postTranslate;e.Augment({postTranslate:function(h,g){if(!g&&a.matchFor["HTML-CSS"]&&this.config.matchFontHeight){b.timer.start(b,["checkFonts",this,h.jax[this.id]],a.fontCheckDelay,a.fontCheckTimeout)}return f.apply(this,arguments)},checkFonts:function(k,o){if(k.time(function(){})){return}var s=[],p,l,g=false;for(p=0,l=o.length;p<l;p++){script=o[p];if(script.parentNode&&script.MathJax.elementJax){script.parentNode.insertBefore(this.EmExSpan.cloneNode(true),script)}}for(p=0,l=o.length;p<l;p++){script=o[p];if(!script.parentNode){continue}g=true;var h=script.MathJax.elementJax;if(!h){continue}var r=script.previousSibling;var q=r.firstChild.offsetHeight/60;var j=r.lastChild.lastChild.offsetHeight/60;if(q===0||q==="NaN"){q=this.defaultEx;j=this.defaultEm}if(q!==h.HTMLCSS.ex||j!==h.HTMLCSS.em){var n=q/this.TeX.x_height/j;n=Math.floor(Math.max(this.config.minScaleAdjust/100,n)*this.config.scale);if(n/100!==h.scale){s.push(script);o[p]={}}}}o=o.concat(s);for(p=0,l=o.length;p<l;p++){script=o[p];if(script&&script.parentNode&&script.MathJax.elementJax){script.parentNode.removeChild(script.previousSibling)}}if(s.length){c.Queue(["Rerender",c,[s],{}])}if(g){setTimeout(k,k.delay)}}})});c.Register.StartupHook("SVG Jax Ready",function(){var f=MathJax.OutputJax.SVG;var e=f.postTranslate;f.Augment({postTranslate:function(h,g){if(!g&&a.matchFor.SVG){b.timer.start(b,["checkFonts",this,h.jax[this.id]],a.fontCheckDelay,a.fontCheckTimeout)}return e.apply(this,arguments)},checkFonts:function(j,l){if(j.time(function(){})){return}var q=[],n,k,g=false;for(n=0,k=l.length;n<k;n++){script=l[n];if(script.parentNode&&script.MathJax.elementJax){script.parentNode.insertBefore(this.ExSpan.cloneNode(true),script)}}for(n=0,k=l.length;n<k;n++){script=l[n];if(!script.parentNode){continue}g=true;var h=script.MathJax.elementJax;if(!h){continue}var p=script.previousSibling;var o=p.firstChild.offsetHeight/60;if(o===0||o==="NaN"){o=this.defaultEx}if(o!==h.SVG.ex){q.push(script);l[n]={}}}l=l.concat(q);for(n=0,k=l.length;n<k;n++){script=l[n];if(script.parentNode&&script.MathJax.elementJax){script.parentNode.removeChild(script.previousSibling)}}if(q.length){c.Queue(["Rerender",c,[q],{}])}if(g){setTimeout(j,j.delay)}}})});c.Register.StartupHook("NativeMML Jax Ready",function(){var e=MathJax.OutputJax.NativeMML;var f=e.postTranslate;e.Augment({postTranslate:function(g){if(!c.Browser.isMSIE&&a.matchFor.NativeMML){b.timer.start(b,["checkFonts",this,g.jax[this.id]],a.fontCheckDelay,a.fontCheckTimeout)}f.apply(this,arguments)},checkFonts:function(A,l){if(A.time(function(){})){return}var t=[],q=[],o=[],w,s,B;for(w=0,s=l.length;w<s;w++){B=l[w];if(B.parentNode&&B.MathJax.elementJax){B.parentNode.insertBefore(this.EmExSpan.cloneNode(true),B)}}for(w=0,s=l.length;w<s;w++){B=l[w];if(!B.parentNode){continue}var g=B.MathJax.elementJax;if(!g){continue}var v=document.getElementById(g.inputID+"-Frame");var k=v.getElementsByTagName("math")[0];if(!k){continue}g=g.NativeMML;var y=B.previousSibling;var z=y.firstChild.offsetWidth/60;var h=y.lastChild.offsetWidth/60;if(z===0||z==="NaN"){z=this.defaultEx;h=this.defaultMEx}var r=(z!==g.ex);if(r||h!=g.mex){var C=(this.config.matchFontHeight&&h>1?z/h:1);C=Math.floor(Math.max(this.config.minScaleAdjust/100,C)*this.config.scale);if(C/100!==g.scale){o.push([v.style,C])}g.scale=C/100;g.fontScale=C+"%";g.ex=z;g.mex=h}if("scrollWidth" in g&&(r||g.scrollWidth!==k.firstChild.scrollWidth)){g.scrollWidth=k.firstChild.scrollWidth;t.push([k.parentNode.style,g.scrollWidth/g.ex/g.scale])}if(k.MathJaxMtds){for(var u=0,p=k.MathJaxMtds.length;u<p;u++){if(!k.MathJaxMtds[u].parentNode){continue}if(r||k.MathJaxMtds[u].firstChild.scrollWidth!==g.mtds[u]){g.mtds[u]=k.MathJaxMtds[u].firstChild.scrollWidth;q.push([k.MathJaxMtds[u],g.mtds[u]/g.ex])}}}}for(w=0,s=l.length;w<s;w++){B=l[w];if(B.parentNode&&B.MathJax.elementJax){B.parentNode.removeChild(B.previousSibling)}}for(w=0,s=o.length;w<s;w++){o[w][0].fontSize=o[w][1]+"%"}for(w=0,s=t.length;w<s;w++){t[w][0].width=t[w][1].toFixed(3)+"ex"}for(w=0,s=q.length;w<s;w++){var x=q[w][0].getAttribute("style");x=x.replace(/(($|;)\s*min-width:).*?ex/,"$1 "+q[w][1].toFixed(3)+"ex");q[w][0].setAttribute("style",x)}setTimeout(A,A.delay)}})});c.Startup.signal.Post("MatchWebFonts Extension Ready");b.loadComplete("[MathJax]/extensions/MatchWebFonts.js")})(MathJax.Hub,MathJax.Ajax);
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/AMScd.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/AMScd"]={version:"2.7.5",config:MathJax.Hub.CombineConfig("TeX.CD",{colspace:"5pt",rowspace:"5pt",harrowsize:"2.75em",varrowsize:"1.75em",hideHorizontalLabels:false})};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var b=MathJax.ElementJax.mml,e=MathJax.InputJax.TeX,d=e.Stack.Item,c=e.Definitions,a=MathJax.Extension["TeX/AMScd"].config;c.environment.CD="CD_env";c.special["@"]="CD_arrow";c.macros.minCDarrowwidth="CD_minwidth";c.macros.minCDarrowheight="CD_minheight";e.Parse.Augment({CD_env:function(f){this.Push(f);return d.array().With({arraydef:{columnalign:"center",columnspacing:a.colspace,rowspacing:a.rowspace,displaystyle:true},minw:this.stack.env.CD_minw||a.harrowsize,minh:this.stack.env.CD_minh||a.varrowsize})},CD_arrow:function(g){var l=this.string.charAt(this.i);if(!l.match(/[><VA.|=]/)){return this.Other(g)}else{this.i++}var o=this.stack.Top();if(!o.isa(d.array)||o.data.length){this.CD_cell(g);o=this.stack.Top()}var q=((o.table.length%2)===1);var i=(o.row.length+(q?0:1))%2;while(i){this.CD_cell(g);i--}var h;var f={minsize:o.minw,stretchy:true},k={minsize:o.minh,stretchy:true,symmetric:true,lspace:0,rspace:0};if(l==="."){}else{if(l==="|"){h=this.mmlToken(b.mo("\u2225").With(k))}else{if(l==="="){h=this.mmlToken(b.mo("=").With(f))}else{var r={">":"\u2192","<":"\u2190",V:"\u2193",A:"\u2191"}[l];var p=this.GetUpTo(g+l,l),m=this.GetUpTo(g+l,l);if(l===">"||l==="<"){h=b.mo(r).With(f);if(!p){p="\\kern "+o.minw}if(p||m){var j={width:"+11mu",lspace:"6mu"};h=b.munderover(this.mmlToken(h));if(p){p=e.Parse(p,this.stack.env).mml();h.SetData(h.over,b.mpadded(p).With(j).With({voffset:".1em"}))}if(m){m=e.Parse(m,this.stack.env).mml();h.SetData(h.under,b.mpadded(m).With(j))}if(a.hideHorizontalLabels){h=b.mpadded(h).With({depth:0,height:".67em"})}}}else{h=r=this.mmlToken(b.mo(r).With(k));if(p||m){h=b.mrow();if(p){h.Append(e.Parse("\\scriptstyle\\llap{"+p+"}",this.stack.env).mml())}h.Append(r.With({texClass:b.TEXCLASS.ORD}));if(m){h.Append(e.Parse("\\scriptstyle\\rlap{"+m+"}",this.stack.env).mml())}}}}}}if(h){this.Push(h)}this.CD_cell(g)},CD_cell:function(f){var g=this.stack.Top();if((g.table||[]).length%2===0&&(g.row||[]).length===0){this.Push(b.mpadded().With({height:"8.5pt",depth:"2pt"}))}this.Push(d.cell().With({isEntry:true,name:f}))},CD_minwidth:function(f){this.stack.env.CD_minw=this.GetDimen(f)},CD_minheight:function(f){this.stack.env.CD_minh=this.GetDimen(f)}})});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/AMScd.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/HTML.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/HTML"]={version:"2.7.5"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var b=MathJax.InputJax.TeX;var a=b.Definitions;a.Add({macros:{href:"HREF_attribute","class":"CLASS_attribute",style:"STYLE_attribute",cssId:"ID_attribute"}},null,true);b.Parse.Augment({HREF_attribute:function(e){var d=this.GetArgument(e),c=this.GetArgumentMML(e);this.Push(c.With({href:d}))},CLASS_attribute:function(d){var e=this.GetArgument(d),c=this.GetArgumentMML(d);if(c["class"]!=null){e=c["class"]+" "+e}this.Push(c.With({"class":e}))},STYLE_attribute:function(d){var e=this.GetArgument(d),c=this.GetArgumentMML(d);if(c.style!=null){if(e.charAt(e.length-1)!==";"){e+=";"}e=c.style+" "+e}this.Push(c.With({style:e}))},ID_attribute:function(e){var d=this.GetArgument(e),c=this.GetArgumentMML(e);this.Push(c.With({id:d}))},GetArgumentMML:function(d){var c=this.ParseArg(d);if(c.inferred&&c.data.length==1){c=c.data[0]}else{delete c.inferred}return c}});MathJax.Hub.Startup.signal.Post("TeX HTML Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/HTML.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/action.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/action"]={version:"2.7.5"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var b=MathJax.InputJax.TeX,a=MathJax.ElementJax.mml;b.Definitions.Add({macros:{toggle:"Toggle",mathtip:"Mathtip",texttip:["Macro","\\mathtip{#1}{\\text{#2}}",2]}},null,true);b.Parse.Augment({Toggle:function(d){var e=[],c;while((c=this.GetArgument(d))!=="\\endtoggle"){e.push(b.Parse(c,this.stack.env).mml())}this.Push(a.maction.apply(a,e).With({actiontype:a.ACTIONTYPE.TOGGLE}))},Mathtip:function(d){var c=this.ParseArg(d),e=this.ParseArg(d);this.Push(a.maction(c,e).With({actiontype:a.ACTIONTYPE.TOOLTIP}))}});MathJax.Hub.Startup.signal.Post("TeX action Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/action.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/autobold.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/autobold"]={version:"2.7.5"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var a=MathJax.InputJax.TeX;a.prefilterHooks.Add(function(d){var c=d.script.parentNode.insertBefore(document.createElement("span"),d.script);c.visibility="hidden";c.style.fontFamily="Times, serif";c.appendChild(document.createTextNode("ABCXYZabcxyz"));var b=c.offsetWidth;c.style.fontWeight="bold";if(b&&c.offsetWidth===b){d.math="\\boldsymbol{"+d.math+"}"}c.parentNode.removeChild(c)});MathJax.Hub.Startup.signal.Post("TeX autobold Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/autobold.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/autoload-all.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/autoload-all"]={version:"2.7.5"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var h={action:["mathtip","texttip","toggle"],AMSmath:["mathring","nobreakspace","negmedspace","negthickspace","intI","iiiint","idotsint","dddot","ddddot","sideset","boxed","substack","injlim","projlim","varliminf","varlimsup","varinjlim","varprojlim","DeclareMathOperator","operatorname","genfrac","tfrac","dfrac","binom","tbinom","dbinom","cfrac","shoveleft","shoveright","xrightarrow","xleftarrow"],begingroup:["begingroup","endgroup","gdef","global"],cancel:["cancel","bcancel","xcancel","cancelto"],color:["color","textcolor","colorbox","fcolorbox","definecolor"],enclose:["enclose"],extpfeil:["Newextarrow","xlongequal","xmapsto","xtofrom","xtwoheadleftarrow","xtwoheadrightarrow"],mhchem:["ce","cee","cf"]};var c={AMSmath:["subarray","smallmatrix","equation","equation*"],AMScd:["CD"]};var d,g,b,a={macros:{},environment:{}};for(d in h){if(h.hasOwnProperty(d)){if(!MathJax.Extension["TeX/"+d]){var f=h[d];for(g=0,b=f.length;g<b;g++){a.macros[f[g]]=["Extension",d]}}}}for(d in c){if(c.hasOwnProperty(d)){if(!MathJax.Extension["TeX/"+d]){var e=c[d];for(g=0,b=e.length;g<b;g++){a.environment[e[g]]=["ExtensionEnv",null,d]}}}}MathJax.InputJax.TeX.Definitions.Add(a);MathJax.Hub.Startup.signal.Post("TeX autoload-all Ready")});MathJax.Callback.Queue(["Require",MathJax.Ajax,"[MathJax]/extensions/TeX/AMSsymbols.js"],["loadComplete",MathJax.Ajax,"[MathJax]/extensions/TeX/autoload-all.js"]);
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/bbox.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/bbox"]={version:"2.7.5"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var b=MathJax.InputJax.TeX,a=MathJax.ElementJax.mml;b.Definitions.Add({macros:{bbox:"BBox"}},null,true);b.Parse.Augment({BBox:function(e){var p=this.GetBrackets(e,""),o=this.ParseArg(e);var k=p.split(/,/),g,d,c;for(var l=0,j=k.length;l<j;l++){var f=k[l].replace(/^\s+/,"").replace(/\s+$/,"");var n=f.match(/^(\.\d+|\d+(\.\d*)?)(pt|em|ex|mu|px|in|cm|mm)$/);if(n){if(g){b.Error(["MultipleBBoxProperty","%1 specified twice in %2","Padding",e])}var h=this.BBoxPadding(n[1]+n[3]);if(h){g={height:"+"+h,depth:"+"+h,lspace:h,width:"+"+(2*n[1])+n[3]}}}else{if(f.match(/^([a-z0-9]+|\#[0-9a-f]{6}|\#[0-9a-f]{3})$/i)){if(d){b.Error(["MultipleBBoxProperty","%1 specified twice in %2","Background",e])}d=f}else{if(f.match(/^[-a-z]+:/i)){if(c){b.Error(["MultipleBBoxProperty","%1 specified twice in %2","Style",e])}c=this.BBoxStyle(f)}else{if(f!==""){b.Error(["InvalidBBoxProperty","'%1' doesn't look like a color, a padding dimension, or a style",f])}}}}}if(g){o=a.mpadded(o).With(g)}if(d||c){o=a.mstyle(o).With({mathbackground:d,style:c})}this.Push(o)},BBoxStyle:function(c){return c},BBoxPadding:function(c){return c}});MathJax.Hub.Startup.signal.Post("TeX bbox Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/bbox.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/begingroup.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/begingroup"]={version:"2.7.5"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var d=MathJax.InputJax.TeX,b=d.Definitions;var a=MathJax.Object.Subclass({macros:null,environments:null,Init:function(e,f){this.macros=(e||{});this.environments=(f||{})},Find:function(e,f){if(this[f].hasOwnProperty(e)){return this[f][e]}},Def:function(e,g,f){this[f][e]=g},Undef:function(e,f){delete this[f][e]},Merge:function(e){MathJax.Hub.Insert(this.macros,e.macros);MathJax.Hub.Insert(this.environments,e.environments)},MergeGlobals:function(e){var f=this.macros;for(var g in f){if(f.hasOwnProperty(g)&&f[g].global){e.Def(g,f[g],"macros",true);delete f[g].global;delete f[g]}}},Clear:function(g){this.environments={};if(g){this.macros={}}else{var e=this.macros;for(var f in e){if(e.hasOwnProperty(f)&&!e[f].global){delete e[f]}}}return this}});var c=d.nsStack=MathJax.Object.Subclass({stack:null,top:0,isEqn:false,Init:function(e){this.isEqn=e;this.stack=[];if(!e){this.Push(a(b.macros,b.environment))}else{this.Push(a())}},Def:function(e,h,f,g){var i=this.top-1;if(g){while(i>0){this.stack[i].Undef(e,f);i--}if(!MathJax.Object.isArray(h)){h=[h]}if(this.isEqn){h.global=true}}this.stack[i].Def(e,h,f)},Push:function(e){this.stack.push(e);this.top=this.stack.length},Pop:function(){var e;if(this.top>1){e=this.stack[--this.top];if(this.isEqn){this.stack.pop()}}else{if(this.isEqn){this.Clear()}}return e},Find:function(e,g){for(var f=this.top-1;f>=0;f--){var h=this.stack[f].Find(e,g);if(h){return h}}return null},Merge:function(e){e.stack[0].MergeGlobals(this);this.stack[this.top-1].Merge(e.stack[0]);var f=[this.top,this.stack.length-this.top].concat(e.stack.slice(1));this.stack.splice.apply(this.stack,f);this.top=this.stack.length},Reset:function(){this.top=this.stack.length},Clear:function(e){this.stack=[this.stack[0].Clear()];this.top=this.stack.length}},{nsFrame:a});b.Add({macros:{begingroup:"BeginGroup",endgroup:"EndGroup",global:"Global",gdef:["Macro","\\global\\def"]}},null,true);d.Parse.Augment({BeginGroup:function(e){d.eqnStack.Push(a())},EndGroup:function(e){if(d.eqnStack.top>1){d.eqnStack.Pop()}else{if(d.rootStack.top===1){d.Error(["ExtraEndMissingBegin","Extra %1 or missing \\begingroup",e])}else{d.eqnStack.Clear();d.rootStack.Pop()}}},csFindMacro:function(e){return(d.eqnStack.Find(e,"macros")||d.rootStack.Find(e,"macros"))},envFindName:function(e){return(d.eqnStack.Find(e,"environments")||d.rootStack.Find(e,"environments"))},setDef:function(e,f){f.isUser=true;d.eqnStack.Def(e,f,"macros",this.stack.env.isGlobal);delete this.stack.env.isGlobal},setEnv:function(e,f){f.isUser=true;d.eqnStack.Def(e,f,"environments")},Global:function(e){var f=this.i;var g=this.GetCSname(e);this.i=f;if(g!=="let"&&g!=="def"&&g!=="newcommand"&&g!=="DeclareMathOperator"&&g!=="Newextarrow"){d.Error(["GlobalNotFollowedBy","%1 not followed by \\let, \\def, or \\newcommand",e])}this.stack.env.isGlobal=true}});d.rootStack=c();d.eqnStack=c(true);d.prefilterHooks.Add(function(){d.rootStack.Reset();d.eqnStack.Clear(true)});d.postfilterHooks.Add(function(){d.rootStack.Merge(d.eqnStack)});MathJax.Hub.Startup.signal.Post("TeX begingroup Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/begingroup.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/boldsymbol.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/boldsymbol"]={version:"2.7.5"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var a=MathJax.ElementJax.mml;var d=MathJax.InputJax.TeX;var b=d.Definitions;var c={};c[a.VARIANT.NORMAL]=a.VARIANT.BOLD;c[a.VARIANT.ITALIC]=a.VARIANT.BOLDITALIC;c[a.VARIANT.FRAKTUR]=a.VARIANT.BOLDFRAKTUR;c[a.VARIANT.SCRIPT]=a.VARIANT.BOLDSCRIPT;c[a.VARIANT.SANSSERIF]=a.VARIANT.BOLDSANSSERIF;c["-tex-caligraphic"]="-tex-caligraphic-bold";c["-tex-oldstyle"]="-tex-oldstyle-bold";b.Add({macros:{boldsymbol:"Boldsymbol"}},null,true);d.Parse.Augment({mmlToken:function(f){if(this.stack.env.boldsymbol){var e=f.Get("mathvariant");if(e==null){f.mathvariant=a.VARIANT.BOLD}else{f.mathvariant=(c[e]||e)}}return f},Boldsymbol:function(h){var e=this.stack.env.boldsymbol,f=this.stack.env.font;this.stack.env.boldsymbol=true;this.stack.env.font=null;var g=this.ParseArg(h);this.stack.env.font=f;this.stack.env.boldsymbol=e;this.Push(g)}});MathJax.Hub.Startup.signal.Post("TeX boldsymbol Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/boldsymbol.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/cancel.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/cancel"]={version:"2.7.5",ALLOWED:{color:1,mathcolor:1,background:1,mathbackground:1,padding:1,thickness:1}};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var c=MathJax.InputJax.TeX,a=MathJax.ElementJax.mml,b=MathJax.Extension["TeX/cancel"];b.setAttributes=function(h,e){if(e!==""){e=e.replace(/ /g,"").split(/,/);for(var g=0,d=e.length;g<d;g++){var f=e[g].split(/[:=]/);if(b.ALLOWED[f[0]]){if(f[1]==="true"){f[1]=true}if(f[1]==="false"){f[1]=false}h[f[0]]=f[1]}}}return h};c.Definitions.Add({macros:{cancel:["Cancel",a.NOTATION.UPDIAGONALSTRIKE],bcancel:["Cancel",a.NOTATION.DOWNDIAGONALSTRIKE],xcancel:["Cancel",a.NOTATION.UPDIAGONALSTRIKE+" "+a.NOTATION.DOWNDIAGONALSTRIKE],cancelto:"CancelTo"}},null,true);c.Parse.Augment({Cancel:function(e,g){var d=this.GetBrackets(e,""),f=this.ParseArg(e);var h=b.setAttributes({notation:g},d);this.Push(a.menclose(f).With(h))},CancelTo:function(e,g){var i=this.ParseArg(e),d=this.GetBrackets(e,""),f=this.ParseArg(e);var h=b.setAttributes({notation:a.NOTATION.UPDIAGONALSTRIKE+" "+a.NOTATION.UPDIAGONALARROW},d);i=a.mpadded(i).With({depth:"-.1em",height:"+.1em",voffset:".1em"});this.Push(a.msup(a.menclose(f).With(h),i))}});MathJax.Hub.Startup.signal.Post("TeX cancel Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/cancel.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/color.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/color"]={version:"2.7.5",config:MathJax.Hub.CombineConfig("TeX.color",{padding:"5px",border:"2px"}),colors:{Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",LimeGreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"},getColor:function(a,c){if(!a){a="named"}var b=this["get_"+a];if(!b){this.TEX.Error(["UndefinedColorModel","Color model '%1' not defined",a])}return b.call(this,c)},get_rgb:function(b){b=b.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s*,\s*/);var a="#";if(b.length!==3){this.TEX.Error(["ModelArg1","Color values for the %1 model require 3 numbers","rgb"])}for(var c=0;c<3;c++){if(!b[c].match(/^(\d+(\.\d*)?|\.\d+)$/)){this.TEX.Error(["InvalidDecimalNumber","Invalid decimal number"])}var d=parseFloat(b[c]);if(d<0||d>1){this.TEX.Error(["ModelArg2","Color values for the %1 model must be between %2 and %3","rgb",0,1])}d=Math.floor(d*255).toString(16);if(d.length<2){d="0"+d}a+=d}return a},get_RGB:function(b){b=b.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s*,\s*/);var a="#";if(b.length!==3){this.TEX.Error(["ModelArg1","Color values for the %1 model require 3 numbers","RGB"])}for(var c=0;c<3;c++){if(!b[c].match(/^\d+$/)){this.TEX.Error(["InvalidNumber","Invalid number"])}var d=parseInt(b[c]);if(d>255){this.TEX.Error(["ModelArg2","Color values for the %1 model must be between %2 and %3","RGB",0,255])}d=d.toString(16);if(d.length<2){d="0"+d}a+=d}return a},get_gray:function(a){if(!a.match(/^\s*(\d+(\.\d*)?|\.\d+)\s*$/)){this.TEX.Error(["InvalidDecimalNumber","Invalid decimal number"])}var b=parseFloat(a);if(b<0||b>1){this.TEX.Error(["ModelArg2","Color values for the %1 model must be between %2 and %3","gray",0,1])}b=Math.floor(b*255).toString(16);if(b.length<2){b="0"+b}return"#"+b+b+b},get_named:function(a){if(this.colors.hasOwnProperty(a)){return this.colors[a]}return a},padding:function(){var c="+"+this.config.padding;var a=this.config.padding.replace(/^.*?([a-z]*)$/,"$1");var b="+"+(2*parseFloat(c))+a;return{width:b,height:c,depth:c,lspace:this.config.padding}}};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var d=MathJax.InputJax.TeX,a=MathJax.ElementJax.mml;var c=d.Stack.Item;var b=MathJax.Extension["TeX/color"];b.TEX=d;d.Definitions.Add({macros:{color:"Color",textcolor:"TextColor",definecolor:"DefineColor",colorbox:"ColorBox",fcolorbox:"fColorBox"}},null,true);d.Parse.Augment({Color:function(h){var g=this.GetBrackets(h),e=this.GetArgument(h);e=b.getColor(g,e);var f=c.style().With({styles:{mathcolor:e}});this.stack.env.color=e;this.Push(f)},TextColor:function(h){var g=this.GetBrackets(h),f=this.GetArgument(h);f=b.getColor(g,f);var e=this.stack.env.color;this.stack.env.color=f;var i=this.ParseArg(h);if(e){this.stack.env.color}else{delete this.stack.env.color}this.Push(a.mstyle(i).With({mathcolor:f}))},DefineColor:function(g){var f=this.GetArgument(g),e=this.GetArgument(g),h=this.GetArgument(g);b.colors[f]=b.getColor(e,h)},ColorBox:function(g){var f=this.GetArgument(g),e=this.InternalMath(this.GetArgument(g));this.Push(a.mpadded.apply(a,e).With({mathbackground:b.getColor("named",f)}).With(b.padding()))},fColorBox:function(g){var h=this.GetArgument(g),f=this.GetArgument(g),e=this.InternalMath(this.GetArgument(g));this.Push(a.mpadded.apply(a,e).With({mathbackground:b.getColor("named",f),style:"border: "+b.config.border+" solid "+b.getColor("named",h)}).With(b.padding()))}});MathJax.Hub.Startup.signal.Post("TeX color Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/color.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/enclose.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/enclose"]={version:"2.7.5",ALLOWED:{arrow:1,color:1,mathcolor:1,background:1,mathbackground:1,padding:1,thickness:1}};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var c=MathJax.InputJax.TeX,a=MathJax.ElementJax.mml,b=MathJax.Extension["TeX/enclose"].ALLOWED;c.Definitions.Add({macros:{enclose:"Enclose"}},null,true);c.Parse.Augment({Enclose:function(g){var k=this.GetArgument(g),e=this.GetBrackets(g),j=this.ParseArg(g);var l={notation:k.replace(/,/g," ")};if(e){e=e.replace(/ /g,"").split(/,/);for(var h=0,d=e.length;h<d;h++){var f=e[h].split(/[:=]/);if(b[f[0]]){f[1]=f[1].replace(/^"(.*)"$/,"$1");if(f[1]==="true"){f[1]=true}if(f[1]==="false"){f[1]=false}if(f[0]==="arrow"&&f[1]){l.notation=l.notation+" updiagonalarrow"}else{l[f[0]]=f[1]}}}}this.Push(a.menclose(j).With(l))}});MathJax.Hub.Startup.signal.Post("TeX enclose Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/enclose.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/extpfeil.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/extpfeil"]={version:"2.7.5"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var b=MathJax.InputJax.TeX,a=b.Definitions;a.Add({macros:{xtwoheadrightarrow:["Extension","AMSmath"],xtwoheadleftarrow:["Extension","AMSmath"],xmapsto:["Extension","AMSmath"],xlongequal:["Extension","AMSmath"],xtofrom:["Extension","AMSmath"],Newextarrow:["Extension","AMSmath"]}},null,true);MathJax.Hub.Register.StartupHook("TeX AMSmath Ready",function(){MathJax.Hub.Insert(a,{macros:{xtwoheadrightarrow:["xArrow",8608,12,16],xtwoheadleftarrow:["xArrow",8606,17,13],xmapsto:["xArrow",8614,6,7],xlongequal:["xArrow",61,7,7],xtofrom:["xArrow",8644,12,12],Newextarrow:"NewExtArrow"}})});b.Parse.Augment({NewExtArrow:function(c){var e=this.GetArgument(c),f=this.GetArgument(c),d=this.GetArgument(c);if(!e.match(/^\\([a-z]+|.)$/i)){b.Error(["NewextarrowArg1","First argument to %1 must be a control sequence name",c])}if(!f.match(/^(\d+),(\d+)$/)){b.Error(["NewextarrowArg2","Second argument to %1 must be two integers separated by a comma",c])}if(!d.match(/^(\d+|0x[0-9A-F]+)$/i)){b.Error(["NewextarrowArg3","Third argument to %1 must be a unicode character number",c])}e=e.substr(1);f=f.split(",");d=parseInt(d);this.setDef(e,["xArrow",d,parseInt(f[0]),parseInt(f[1])])}});MathJax.Hub.Startup.signal.Post("TeX extpfeil Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/extpfeil.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/mathchoice.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var c="2.7.5";var a=MathJax.ElementJax.mml;var d=MathJax.InputJax.TeX;var b=d.Definitions;b.Add({macros:{mathchoice:"MathChoice"}},null,true);d.Parse.Augment({MathChoice:function(f){var i=this.ParseArg(f),e=this.ParseArg(f),g=this.ParseArg(f),h=this.ParseArg(f);this.Push(a.TeXmathchoice(i,e,g,h))}});a.TeXmathchoice=a.mbase.Subclass({type:"TeXmathchoice",notParent:true,choice:function(){if(this.selection!=null){return this.selection}if(this.choosing){return 2}this.choosing=true;var f=0,e=this.getValues("displaystyle","scriptlevel");if(e.scriptlevel>0){f=Math.min(3,e.scriptlevel+1)}else{f=(e.displaystyle?0:1)}var g=this.inherit;while(g&&g.type!=="math"){g=g.inherit}if(g){this.selection=f}this.choosing=false;return f},selected:function(){return this.data[this.choice()]},setTeXclass:function(e){return this.selected().setTeXclass(e)},isSpacelike:function(){return this.selected().isSpacelike()},isEmbellished:function(){return this.selected().isEmbellished()},Core:function(){return this.selected()},CoreMO:function(){return this.selected().CoreMO()},toHTML:function(e){e=this.HTMLcreateSpan(e);e.bbox=this.Core().toHTML(e).bbox;if(e.firstChild&&e.firstChild.style.marginLeft){e.style.marginLeft=e.firstChild.style.marginLeft;e.firstChild.style.marginLeft=""}return e},toSVG:function(){var e=this.Core().toSVG();this.SVGsaveData(e);return e},toCommonHTML:function(e){e=this.CHTMLcreateNode(e);this.CHTMLhandleStyle(e);this.CHTMLhandleColor(e);this.CHTMLaddChild(e,this.choice(),{});return e},toPreviewHTML:function(e){e=this.PHTMLcreateSpan(e);this.PHTMLhandleStyle(e);this.PHTMLhandleColor(e);this.PHTMLaddChild(e,this.choice(),{});return e}});MathJax.Hub.Startup.signal.Post("TeX mathchoice Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/mathchoice.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/mediawiki-texvc.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/mediawiki-texvc"]={version:"2.7.5"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){MathJax.InputJax.TeX.Definitions.Add({macros:{AA:["Macro","\u00c5"],alef:["Macro","\\aleph"],alefsym:["Macro","\\aleph"],Alpha:["Macro","\\mathrm{A}"],and:["Macro","\\land"],ang:["Macro","\\angle"],Bbb:["Macro","\\mathbb"],Beta:["Macro","\\mathrm{B}"],bold:["Macro","\\mathbf"],bull:["Macro","\\bullet"],C:["Macro","\\mathbb{C}"],Chi:["Macro","\\mathrm{X}"],clubs:["Macro","\\clubsuit"],cnums:["Macro","\\mathbb{C}"],Complex:["Macro","\\mathbb{C}"],coppa:["Macro","\u03D9"],Coppa:["Macro","\u03D8"],Dagger:["Macro","\\ddagger"],Digamma:["Macro","\u03DC"],darr:["Macro","\\downarrow"],dArr:["Macro","\\Downarrow"],Darr:["Macro","\\Downarrow"],dashint:["Macro","\\unicodeInt{x2A0D}"],ddashint:["Macro","\\unicodeInt{x2A0E}"],diamonds:["Macro","\\diamondsuit"],empty:["Macro","\\emptyset"],Epsilon:["Macro","\\mathrm{E}"],Eta:["Macro","\\mathrm{H}"],euro:["Macro","\u20AC"],exist:["Macro","\\exists"],geneuro:["Macro","\u20AC"],geneuronarrow:["Macro","\u20AC"],geneurowide:["Macro","\u20AC"],H:["Macro","\\mathbb{H}"],hAar:["Macro","\\Leftrightarrow"],harr:["Macro","\\leftrightarrow"],Harr:["Macro","\\Leftrightarrow"],hearts:["Macro","\\heartsuit"],image:["Macro","\\Im"],infin:["Macro","\\infty"],Iota:["Macro","\\mathrm{I}"],isin:["Macro","\\in"],Kappa:["Macro","\\mathrm{K}"],koppa:["Macro","\u03DF"],Koppa:["Macro","\u03DE"],lang:["Macro","\\langle"],larr:["Macro","\\leftarrow"],Larr:["Macro","\\Leftarrow"],lArr:["Macro","\\Leftarrow"],lrarr:["Macro","\\leftrightarrow"],Lrarr:["Macro","\\Leftrightarrow"],lrArr:["Macro","\\Leftrightarrow"],Mu:["Macro","\\mathrm{M}"],N:["Macro","\\mathbb{N}"],natnums:["Macro","\\mathbb{N}"],Nu:["Macro","\\mathrm{N}"],O:["Macro","\\emptyset"],oint:["Macro","\\unicodeInt{x222E}"],oiint:["Macro","\\unicodeInt{x222F}"],oiiint:["Macro","\\unicodeInt{x2230}"],ointctrclockwise:["Macro","\\unicodeInt{x2233}"],officialeuro:["Macro","\u20AC"],Omicron:["Macro","\\mathrm{O}"],or:["Macro","\\lor"],P:["Macro","\u00B6"],pagecolor:["Macro","",1],part:["Macro","\\partial"],plusmn:["Macro","\\pm"],Q:["Macro","\\mathbb{Q}"],R:["Macro","\\mathbb{R}"],rang:["Macro","\\rangle"],rarr:["Macro","\\rightarrow"],Rarr:["Macro","\\Rightarrow"],rArr:["Macro","\\Rightarrow"],real:["Macro","\\Re"],reals:["Macro","\\mathbb{R}"],Reals:["Macro","\\mathbb{R}"],Rho:["Macro","\\mathrm{P}"],sdot:["Macro","\\cdot"],sampi:["Macro","\u03E1"],Sampi:["Macro","\u03E0"],sect:["Macro","\\S"],spades:["Macro","\\spadesuit"],stigma:["Macro","\u03DB"],Stigma:["Macro","\u03DA"],sub:["Macro","\\subset"],sube:["Macro","\\subseteq"],supe:["Macro","\\supseteq"],Tau:["Macro","\\mathrm{T}"],textvisiblespace:["Macro","\u2423"],thetasym:["Macro","\\vartheta"],uarr:["Macro","\\uparrow"],uArr:["Macro","\\Uparrow"],Uarr:["Macro","\\Uparrow"],unicodeInt:["Macro","\\mathop{\\vcenter{\\mathchoice{\\huge\\unicode{#1}\\,}{\\unicode{#1}}{\\unicode{#1}}{\\unicode{#1}}}\\,}\\nolimits",1],varcoppa:["Macro","\u03D9"],varstigma:["Macro","\u03DB"],varointclockwise:["Macro","\\unicodeInt{x2232}"],vline:["Macro","\\smash{\\large\\lvert}",0],weierp:["Macro","\\wp"],Z:["Macro","\\mathbb{Z}"],Zeta:["Macro","\\mathrm{Z}"]}})});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/mediawiki-texvc.js");
|
||||
@@ -0,0 +1,332 @@
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/TeX/mhchem.js
|
||||
*
|
||||
* Implements the \ce command for handling chemical formulas
|
||||
* from the mhchem LaTeX package.
|
||||
*
|
||||
* ---------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2011-2015 The MathJax Consortium
|
||||
* Copyright (c) 2015-2017 Martin Hensel
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
MathJax.Extension["TeX/mhchem"]={version:"3.2.0"},MathJax.Hub.Register.StartupHook("TeX Jax Ready",
|
||||
function(){var n=MathJax.InputJax.TeX,r=MathJax.Object.Subclass({string:"",Init:
|
||||
function(n){this.string=n},Parse:
|
||||
function(r){try{return o.go(t.go(this.string,r))}catch(r){n.Error(r)}}}),t={};t.go=
|
||||
function(n,r){if(!n)return n;void 0===r&&(r="ce");var o="0",e={};e.pL=0,n=n.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),n=n.replace(/[\u2026]/g,"...");for(var a,u,i=[];;){a!==n?(u=10,a=n):u--;var s=t.c[r],l=s.e.length;n:for(var h=0;h<l;h++){var p=s.e[h],c=p.g[o]||p.g["*"]||null;if(c){var f=t.h(p.h,n);if(f){for(var m=t.j([],c.k),k=m.length,d=0;d<k;d++){var g,q=m[d],v=void 0;if(q.l&&(v=q.m,q=q.l),"string"==typeof q)if(s.g[q])g=s.g[q](e,f.h,v);else{if(!t.g[q])throw["MhchemBugA","mhchem bug A. Please report. ("+q+")"];g=t.g[q](e,f.h,v)}else"function"==typeof q&&(g=q(e,f.h));i=t.j(i,g)}if(o=c.n||o,!(n.length>0))return i;if(c.s||(n=f.t),!c.u)break n}}}if(u<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},
|
||||
t.j=
|
||||
function(n,r){return r?n?n.concat(r):[].concat(r):n},t.w={"~C":/^$/,"~A":/^./,"~B":/^./,"%m":/^\s/,"%l":/^\s(?=[A-Z\\$])/,"~@":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,"~M":/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"@z":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"~P":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"@%":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"~O":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,"~u":/^[0-9]+/,"@h":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"@g":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"%T":
|
||||
function(n){var r=n.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return r&&r[0]?{h:r.splice(1),t:n.substr(r[0].length)}:null},aj:
|
||||
function(n){var r=n.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return r&&r[0]?{h:r.splice(1),t:n.substr(r[0].length)}:null},"%n":
|
||||
function(n){var r=this["@W"](n,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(r&&r.t.match(/^($|[\s,;\)\]\}])/))return r;var t=n.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return t?{h:t[0],t:n.substr(t[0].length)}:null},ae:/^_\{(\([a-z]{1,3}\))\}/,"@K":/^(?:\\\{|\[|\()/,"@c":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"@i":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"@P":
|
||||
function(n){return this["@W"](n,"^{","","","}")},"@L":
|
||||
function(n){return this["@W"](n,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"@O":
|
||||
function(n){return this["@W"](n,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"@N":
|
||||
function(n){return this["@W"](n,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"%U":/^\^(-?\d+)/,"'":/^'/,"@Y":
|
||||
function(n){return this["@W"](n,"_{","","","}")},"@Q":
|
||||
function(n){return this["@W"](n,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"@T":
|
||||
function(n){return this["@W"](n,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"@S":
|
||||
function(n){return this["@W"](n,"_",/^\\[a-zA-Z]+\{/,"}","")},"@R":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"%B":
|
||||
function(n){return this["@W"](n,"","{","}","")},"%A":
|
||||
function(n){return this["@W"](n,"{","","","}")},"@~":
|
||||
function(n){return this["@W"](n,"","$","$","")},"@a":
|
||||
function(n){return this["@W"](n,"${","","","}$")},"@@":
|
||||
function(n){return this["@W"](n,"$","","","$")},"%D":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]\/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"@f":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,ai:/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,"~Q":/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,"~c":/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"@r":
|
||||
function(n){return this["@W"](n,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,"@m":/^[CMT](?=\[)/,"@o":
|
||||
function(n){return this["@W"](n,"[","","","]")},al:/^(&|@q|\\hline)\s*/,"@p":/^(?:\\[,\ ;:])/,"@G":
|
||||
function(n){return this["@W"](n,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"@F":
|
||||
function(n){return this["@W"](n,"",/^\\[a-zA-Z]+\{/,"}","")},"@t":/^\\ca(?:\s+|(?![a-zA-Z]))/,"@E":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,"~R":/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,"~S":/^[\/~|]/,"@y":
|
||||
function(n){return this["@W"](n,"\\frac{","","","}","{","","","}")},"@A":
|
||||
function(n){return this["@W"](n,"\\overset{","","","}","{","","","}")},"@C":
|
||||
function(n){return this["@W"](n,"\\underset{","","","}","{","","","}")},"@B":
|
||||
function(n){return this["@W"](n,"\\underbrace{","","","}_","{","","","}")},"@w":
|
||||
function(n){return this["@W"](n,"\\color{","","","}")},"@x":
|
||||
function(n){return this["@W"](n,"\\color{","","","}","{","","","}")},"@v":
|
||||
function(n){return this["@W"](n,"\\color","\\","",/^(?=\{)/,"{","","","}")},"@u":
|
||||
function(n){return this["@W"](n,"\\ce{","","","}")},"~Z":/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"a~":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"%d":/^[IVX]+/,"@j":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,"~%":
|
||||
function(n){var r;if(r=n.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/))return{h:r[0],t:n.substr(r[0].length)};var t=this["@W"](n,"","$","$","");return t&&(r=t.h.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/))?{h:r[0],t:n.substr(r[0].length)}:null},"~a":
|
||||
function(n){return this["~%"](n)},"@b":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,"~E":
|
||||
function(n){if(n.match(/^\([a-z]+\)$/))return null;var r=n.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return r?{h:r[0],t:n.substr(r[0].length)}:null},"%z":/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*\*\s*/,"@W":
|
||||
function(n,r,t,o,e,a,u,i,s,l){var h=this["@V"](n,r);if(null===h)return null;if(n=n.substr(h.length),h=this["@V"](n,t),null===h)return null;var p=this["@U"](n,h.length,o||e);if(null===p)return null;var c=n.substring(0,o?p.y:p.z);if(a||u){var f=this["@W"](n.substr(p.y),a,u,i,s);if(null===f)return null;var m=[c,f.h];return l&&(m=m.join("")),{h:m,t:f.t}}return{h:c,t:n.substr(p.y)}},
|
||||
"@V":
|
||||
function(n,r){if("string"==typeof r)return 0!==n.indexOf(r)?null:r;var t=n.match(r);return t?t[0]:null},"@U":
|
||||
function(n,r,t){for(var o=0;r<n.length;){var e=n.charAt(r),a=this["@V"](n.substr(r),t);if(null!==a&&0===o)return{z:r,y:r+a.length};if("{"===e)o++;else if("}"===e){if(0===o)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];o--}r++}return null}},
|
||||
t.h=
|
||||
function(n,r){var o=t.w[n];if(void 0===o)throw["MhchemBugP","mhchem bug P. Please report. ("+n+")"];if("function"==typeof o)return t.w[n](r);var e=r.match(o);if(e){var a;return a=e[2]?[e[1],e[2]]:e[1]?e[1]:e[0],{h:a,t:r.substr(e[0].length)}}return null},t.g={"a=":
|
||||
function(n,r){n.a=(n.a||"")+r},"b=":
|
||||
function(n,r){n.b=(n.b||"")+r},"p=":
|
||||
function(n,r){n.p=(n.p||"")+r},"o=":
|
||||
function(n,r){n.o=(n.o||"")+r},"q=":
|
||||
function(n,r){n.q=(n.q||"")+r},"d=":
|
||||
function(n,r){n.d=(n.d||"")+r},"%c":
|
||||
function(n,r){n.rm=(n.rm||"")+r},"%t":
|
||||
function(n,r){n.text=(n.text||"")+r},"~J":
|
||||
function(n,r,t){return{l:t}},
|
||||
"~K":
|
||||
function(n,r,t){return{l:t,p1:r}},
|
||||
"~L":
|
||||
function(n,r,t){return{l:t,p1:r[0],p2:r[1]}},
|
||||
"~s":
|
||||
function(n,r){return r},rm:
|
||||
function(n,r){return{l:"rm",p1:r}},
|
||||
"%s":
|
||||
function(n,r){return t.go(r,"%s")},"%C":
|
||||
function(n,r){var o=["{"];return o=t.j(o,t.go(r,"%s")),o=t.j(o,"}")},"%r":
|
||||
function(n,r){return t.go(r,"%r")},"%q":
|
||||
function(n,r){return t.go(r,"%q")},"~f":
|
||||
function(n,r,t){return{l:"~f",A:t||r}},
|
||||
"~m":
|
||||
function(n,r){return{l:"~l",B:r[0]}},
|
||||
ce:
|
||||
function(n,r){return t.go(r)},"@k":
|
||||
function(n,r){var o;r.match(/^[+\-]/)&&(o=[r.substr(0,1)],r=r.substr(1));var e=r.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return e[1]=e[1].replace(/\$/g,""),o=t.j(o,{l:"~F",p1:e[1],p2:e[2]}),e[3]&&(e[3]=e[3].replace(/\$/g,""),o=t.j(o,{l:"%r",p1:e[3]})),o},"@l":
|
||||
function(n,r){return t.go(r,"@l")}},
|
||||
t.c={},t.C=
|
||||
function(n){var r,t,o,e,a={};for(r in n)if(r.indexOf("|")!==-1)for(o=r.split("|"),e=0;e<o.length;e++)a[o[e]]=n[r];else a[r]=n[r];var u=[];for(r in a){var i={},s=a[r];for(t in s)if(t.indexOf("|")!==-1)for(o=t.split("|"),e=0;e<o.length;e++)i[o[e]]=s[t];else i[t]=s[t];u.push({h:r,g:i})}return u},t.c.ce={e:t.C({"~C":{"*":{k:"~T"}},
|
||||
"~A":{"0|1|2":{k:"%F",s:!0,u:!0}},
|
||||
"~Z":{0:{k:"a%"}},
|
||||
"@m":{r:{k:"%b",n:"rt"},rd:{k:"%g",n:"%i"}},
|
||||
"~c":{"0|1|2|as":{k:["%j","~T","~Q"],n:"1"}},
|
||||
"%z":{"0|1|2":{k:["o=","~T"],n:"1"}},
|
||||
"~R":{"0|1|2|3":{k:"o=",n:"o"}},
|
||||
"->":{"0|1|2|3":{k:"r=",n:"r"},"a|as":{k:["~T","r="],n:"r"},"*":{k:["~T","r="],n:"r"}},
|
||||
"+":{o:{k:"~t",n:"d"},"d|D":{k:"d=",n:"d"},q:{k:"d=",n:"qd"},"qd|qD":{k:"d=",n:"qd"},dq:{k:["~T","d="],n:"d"},3:{k:["%j","~T","~Q"],n:"0"}},
|
||||
"~%":{"0|2":{k:"a=",n:"a"}},
|
||||
ai:{"0|1|2|a|as":{k:["%j","~T",{l:"~Q",m:"\\pm"}],n:"0"}},
|
||||
"~Q":{"0|1|2|a|as":{k:["%j","~T","~Q"],n:"0"}},
|
||||
"-$":{"o|q":{k:["~g","~T"],n:"qd"},d:{k:"d=",n:"d"},D:{k:["~T",{l:"~f",m:"-"}],n:"3"},q:{k:"d=",n:"qd"},qd:{k:"d=",n:"qd"},"qD|dq":{k:["~T",{l:"~f",m:"-"}],n:"3"}},
|
||||
"-9":{"3|o":{k:["~T",{l:"~J",m:"~I"}],n:"3"}},
|
||||
"@f":{o:{k:{l:"@e",m:!0},n:"2"},d:{k:{l:"@d",m:!0},n:"2"}},
|
||||
"-":{"0|1|2":{k:[{l:"~T",m:1},"%E",{l:"~f",m:"-"}],n:"3"},3:{k:{l:"~f",m:"-"}},
|
||||
a:{k:["~T",{l:"~J",m:"~I"}],n:"2"},as:{k:[{l:"~T",m:2},{l:"~f",m:"-"}],n:"3"},b:{k:"b="},o:{k:"@e",n:"2"},q:{k:"@e",n:"2"},"d|qd|dq":{k:"@d",n:"2"},"D|qD|p":{k:["~T",{l:"~f",m:"-"}],n:"3"}},
|
||||
"~a":{"1|3":{k:"a=",n:"a"}},
|
||||
"~M":{"0|1|2|3|a|as|b|p|bp|o":{k:"o=",n:"o"},"q|dq":{k:["~T","o="],n:"o"},"d|D|qd|qD":{k:"~N",n:"o"}},
|
||||
"~u":{o:{k:"q=",n:"q"},"d|D":{k:"q=",n:"dq"},q:{k:["~T","o="],n:"o"},a:{k:"o=",n:"o"}},
|
||||
"%l":{"b|p|bp":{}},
|
||||
"%m":{a:{n:"as"},0:{k:"%j"},"1|2":{k:"%k"},"r|rt|rd|%i|%h":{k:"~T",n:"0"},"*":{k:["~T","%k"],n:"1"}},
|
||||
al:{"1|2":{k:["~T",{l:"~K",m:"al"}]},
|
||||
"*":{k:["~T",{l:"~K",m:"al"}],n:"0"}},
|
||||
"@o":{"r|rt":{k:"%a",n:"rd"},"rd|%i":{k:"%f",n:"%h"}},
|
||||
"@i":{"o|d|D|dq|qd|qD":{k:["~T",{l:"~f",m:"..."}],n:"3"},"*":{k:[{l:"~T",m:1},{l:"~J",m:"~z"}],n:"1"}},
|
||||
". |* ":{"*":{k:["~T",{l:"~J",m:"~~"}],n:"1"}},
|
||||
"%n":{"*":{k:["~T","%p"],n:"1"}},
|
||||
"@K":{"a|as|o":{k:["o=","~T","%G"],n:"2"},"0|1|2|3":{k:["o=","~T","%G"],n:"2"},"*":{k:["~T","o=","~T","%G"],n:"2"}},
|
||||
"@c":{"0|1|2|3|b|p|bp|o":{k:["o=","%H"],n:"o"},"a|as|d|D|q|qd|qD|dq":{k:["~T","o=","%H"],n:"o"}},
|
||||
", ":{"*":{k:["~T","~q"],n:"0"}},
|
||||
"^_":{"*":{}},
|
||||
"@P|@L":{"0|1|2|as":{k:"b=",n:"b"},p:{k:"b=",n:"bp"},"3|o":{k:"~t",n:"D"},q:{k:"d=",n:"qD"},"d|D|qd|qD|dq":{k:["~T","d="],n:"D"}},
|
||||
"^a|@O|@N|^\\x|'":{"0|1|2|as":{k:"b=",n:"b"},p:{k:"b=",n:"bp"},"3|o":{k:"~t",n:"d"},q:{k:"d=",n:"qd"},"d|qd|D|qD":{k:"d="},dq:{k:["~T","d="],n:"d"}},
|
||||
ae:{"d|D|q|qd|qD|dq":{k:["~T","q="],n:"q"}},
|
||||
"@Y|@Q|_9|@T|@S|@R":{"0|1|2|as":{k:"p=",n:"p"},b:{k:"p=",n:"bp"},"3|o":{k:"q=",n:"q"},"d|D":{k:"q=",n:"dq"},"q|qd|qD|dq":{k:["~T","q="],n:"q"}},
|
||||
"%D":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{k:[{l:"~T",m:2},"~f"],n:"3"}},
|
||||
"#":{"0|1|2|3|a|as|o":{k:[{l:"~T",m:2},{l:"~f",m:"#"}],n:"3"}},
|
||||
"{}":{"*":{k:{l:"~T",m:1},n:"1"}},
|
||||
"%B":{"0|1|2|3|a|as|b|p|bp":{k:"o=",n:"o"},"o|d|D|q|qd|qD|dq":{k:["~T","o="],n:"o"}},
|
||||
"@~":{a:{k:"a="},"0|1|2|3|as|b|p|bp|o":{k:"o=",n:"o"},"as|o":{k:"o="},"q|d|D|qd|qD|dq":{k:["~T","o="],n:"o"}},
|
||||
"@r":{"*":{k:[{l:"~T",m:2},"~f"],n:"3"}},
|
||||
"@y":{"*":{k:[{l:"~T",m:1},"~H"],n:"3"}},
|
||||
"@A":{"*":{k:[{l:"~T",m:2},"~X"],n:"3"}},
|
||||
"@C":{"*":{k:[{l:"~T",m:2},"%y"],n:"3"}},
|
||||
"@B":{"*":{k:[{l:"~T",m:2},"%w"],n:"3"}},
|
||||
"@x|@v":{"*":{k:[{l:"~T",m:2},"~k"],n:"3"}},
|
||||
"@w":{"*":{k:[{l:"~T",m:2},"~m"]}},
|
||||
"@u":{"*":{k:[{l:"~T",m:2},"ce"],n:"3"}},
|
||||
"@p":{"*":{k:[{l:"~T",m:1},"~s"],n:"1"}},
|
||||
"@G|@F|@E":{"0|1|2|3|a|as|b|p|bp|o|c0":{k:["o=","~T"],n:"3"},"*":{k:["~T","o=","~T"],n:"3"}},
|
||||
"~S":{"*":{k:[{l:"~T",m:1},"~s"],n:"3"}},
|
||||
"~B":{a:{k:"@Z",n:"o",s:!0},as:{k:[{l:"~T"},"%k"],n:"1",s:!0},"r|rt|rd|%i|%h":{k:["~T"],n:"0",s:!0},"*":{k:["~T","~s"],n:"3"}}}),g:{"~N":
|
||||
function(n,r){var o;if(n.d.match(/^[0-9]+$/)){var e=n.d;n.d=void 0,o=this["~T"](n),n.b=e}else o=this["~T"](n);return t.g["o="](n,r),o},"~t":
|
||||
function(n,r){n.d=r,n["%I"]="kv"},"~g":
|
||||
function(n,r){if(n.yB){var o=t.j(o,this["~T"](n));return o=t.j(o,t.g["~f"](n,r,"-"))}n.d=r},"@e":
|
||||
function(n,r,o){var e=o||this["@X"](n,r),a=t.j(null,this["~T"](n,r));return a=e?t.j(a,{l:"~I"}):t.j(a,t.g["~f"](n,r,"-"))},"@d":
|
||||
function(n,r,o){var e,a=o||this["@X"](n,r);if(a)e=t.j(e,this["~T"](n,r)),e=t.j(e,{l:"~I"});else{var u=t.h("~u",n.d||"");u&&""===u.t?(e=t.j(null,t.g["d="](n,r)),e=t.j(e,this["~T"](n))):(e=t.j(e,this["~T"](n,r)),e=t.j(e,t.g["~f"](n,r,"-")))}return e},"@X":
|
||||
function(n,r){var o=t.h("~R",n.o||""),e=t.h("~O",n.o||""),a=t.h("~P",n.o||""),u=t.h("@%",n.o||""),i="-"===r&&(o&&""===o.t||e||a||u);return!i||n.a||n.b||n.p||n.d||n.q||o||!a||(n.o="$"+n.o+"$"),i},"@Z":
|
||||
function(n,r){n.o=n.a,n.a=void 0},"%k":
|
||||
function(n,r){n.sb=!0},"%j":
|
||||
function(n,r){n.sb=!1},"%E":
|
||||
function(n,r){n.yB=!0},"%F":
|
||||
function(n,r){n.yB=!1},"%G":
|
||||
function(n,r){n.pL++},"%H":
|
||||
function(n,r){n.pL--},"%p":
|
||||
function(n,r){return r=t.go(r,"o"),{l:"%p",p1:r}},
|
||||
"~q":
|
||||
function(n,r){var t=r.replace(/\s*$/,""),o=t!==r;return o&&0===n.pL?{l:"~n",p1:t}:{l:"~o",p1:t}},
|
||||
"~T":
|
||||
function(n,r,o){var e;n.r?("M"===n.rdt?n.rd=t.go(n.rd,"%r"):"T"===n.rdt?n.rd=[{l:"%s",p1:n.rd}]:n.rd=t.go(n.rd),"M"===n.rqt?n.rq=t.go(n.rq,"%r"):"T"===n.rqt?n.rq=[{l:"%s",p1:n.rq}]:n.rq=t.go(n.rq),e={l:"~b",r:n.r,rd:n.rd,rq:n.rq}):(e=[],n.a||n.b||n.p||n.o||n.q||n.d||o?(n.sb&&e.push({l:"~D"}),n.o||n.q||n.d||n.b||n.p||2===o?n.o||n.q||n.d||!n.b&&!n.p?n.o&&"kv"===n["%I"]&&t.h("a~",n.d||"")?n["%I"]="~Y":n.o&&"kv"===n["%I"]&&!n.q&&(n["%I"]=void 0):(n.o=n.a,n.d=n.b,n.q=n.p,n.a=n.b=n.p=void 0):(n.o=n.a,n.a=void 0),n.a=t.go(n.a,"a"),n.b=t.go(n.b,"bd"),n.p=t.go(n.p,"pq"),n.o=t.go(n.o,"o"),"~Y"===n["%I"]?n.d=t.go(n.d,"~Y"):n.d=t.go(n.d,"bd"),n.q=t.go(n.q,"pq"),e.push({l:"~h",a:n.a,b:n.b,p:n.p,o:n.o,q:n.q,d:n.d,"%I":n["%I"]})):e=null);for(var a in n)"pL"!==a&&"yB"!==a&&delete n[a];return e},"a%":
|
||||
function(n,r){var o=["{"];return o=t.j(o,t.go(r,"~Y")),o=o.concat(["}"])},"~H":
|
||||
function(n,r){return{l:"~G",p1:t.go(r[0]),p2:t.go(r[1])}},
|
||||
"~X":
|
||||
function(n,r){return{l:"~W",p1:t.go(r[0]),p2:t.go(r[1])}},
|
||||
"%y":
|
||||
function(n,r){return{l:"%x",p1:t.go(r[0]),p2:t.go(r[1])}},
|
||||
"%w":
|
||||
function(n,r){return{l:"%v",p1:t.go(r[0]),p2:t.go(r[1])}},
|
||||
"~k":
|
||||
function(n,r){return{l:"~j",F:r[0],G:t.go(r[1])}},
|
||||
"r=":
|
||||
function(n,r){n.r=(n.r||"")+r},"%b":
|
||||
function(n,r){n.rdt=(n.rdt||"")+r},"%a":
|
||||
function(n,r){n.rd=(n.rd||"")+r},"%g":
|
||||
function(n,r){n.rqt=(n.rqt||"")+r},"%f":
|
||||
function(n,r){n.rq=(n.rq||"")+r},"~Q":
|
||||
function(n,r,t){return{l:"~Q",A:t||r}}}},
|
||||
t.c.a={e:t.C({"~C":{"*":{}},
|
||||
"@j":{0:{k:"@k"}},
|
||||
"~A":{0:{n:"1",s:!0}},
|
||||
"@@":{"*":{k:"%q",n:"1"}},
|
||||
",":{"*":{k:{l:"~J",m:"~r"}}},
|
||||
"~B":{"*":{k:"~s"}}}),g:{}},
|
||||
t.c.o={e:t.C({"~C":{"*":{}},
|
||||
"@j":{0:{k:"@k"}},
|
||||
"~A":{0:{n:"1",s:!0}},
|
||||
"~M":{"*":{k:"rm"}},
|
||||
"@t":{"*":{k:{l:"~J",m:"~i"}}},
|
||||
"@G|@F|@E":{"*":{k:"~s"}},
|
||||
"@a|@@":{"*":{k:"%r"}},
|
||||
"%A":{"*":{k:"%C"}},
|
||||
"~B":{"*":{k:"~s"}}}),g:{}},
|
||||
t.c["%s"]={e:t.C({"~C":{"*":{k:"~T"}},
|
||||
"%B":{"*":{k:"%t"}},
|
||||
"@a|@@":{"*":{k:"%r"}},
|
||||
"@z":{"*":{k:["~T","rm"]}},
|
||||
"@p|@G|@F|@E":{"*":{k:["~T","~s"]}},
|
||||
"~A":{"*":{k:"%t"}}}),g:{"~T":
|
||||
function(n,r){if(n.text){var t={l:"%s",p1:n.text};for(var o in n)delete n[o];return t}return null}}},
|
||||
t.c.pq={e:t.C({"~C":{"*":{}},
|
||||
"%n":{"*":{k:"%p"}},
|
||||
i$:{0:{n:"!f",s:!0}},
|
||||
"@b":{0:{k:"rm",n:"0"}},
|
||||
"~E":{0:{n:"f",s:!0}},
|
||||
"@j":{0:{k:"@k"}},
|
||||
"~A":{0:{n:"!f",s:!0}},
|
||||
"@a|@@":{"*":{k:"%r"}},
|
||||
"%A":{"*":{k:"%s"}},
|
||||
"~@":{f:{k:"%r"}},
|
||||
"~M":{"*":{k:"rm"}},
|
||||
"@h":{"*":{k:"@l"}},
|
||||
",":{"*":{k:{l:"~K",m:"~p"}}},
|
||||
"@x|@v":{"*":{k:"~k"}},
|
||||
"@w":{"*":{k:"~m"}},
|
||||
"@u":{"*":{k:"ce"}},
|
||||
"@p|@G|@F|@E":{"*":{k:"~s"}},
|
||||
"~B":{"*":{k:"~s"}}}),g:{"%p":
|
||||
function(n,r){return r=t.go(r,"o"),{l:"%K",p1:r}},
|
||||
"~k":
|
||||
function(n,r){return{l:"~j",F:r[0],G:t.go(r[1],"pq")}}}},
|
||||
t.c.bd={e:t.C({"~C":{"*":{}},
|
||||
x$:{0:{n:"!f",s:!0}},
|
||||
"~E":{0:{n:"f",s:!0}},
|
||||
"~A":{0:{n:"!f",s:!0}},
|
||||
"@g":{"*":{k:"@l"}},
|
||||
".":{"*":{k:{l:"~J",m:"~y"}}},
|
||||
"~@":{f:{k:"%r"}},
|
||||
x:{"*":{k:{l:"~J",m:"@n"}}},
|
||||
"~M":{"*":{k:"rm"}},
|
||||
"'":{"*":{k:{l:"~J",m:"%%"}}},
|
||||
"@a|@@":{"*":{k:"%r"}},
|
||||
"%A":{"*":{k:"%s"}},
|
||||
"@x|@v":{"*":{k:"~k"}},
|
||||
"@w":{"*":{k:"~m"}},
|
||||
"@u":{"*":{k:"ce"}},
|
||||
"@p|@G|@F|@E":{"*":{k:"~s"}},
|
||||
"~B":{"*":{k:"~s"}}}),g:{"~k":
|
||||
function(n,r){return{l:"~j",F:r[0],G:t.go(r[1],"bd")}}}},
|
||||
t.c["~Y"]={e:t.C({"~C":{"*":{}},
|
||||
"%d":{"*":{k:"%e"}},
|
||||
"@a|@@":{"*":{k:"%r"}},
|
||||
"~A":{"*":{k:"~s"}}}),g:{"%e":
|
||||
function(n,r){return{l:"%d",p1:r}}}},
|
||||
t.c["%r"]={e:t.C({"~C":{"*":{k:"~T"}},
|
||||
"@u":{"*":{k:["~T","ce"]}},
|
||||
"%B|@p|@G|@F|@E":{"*":{k:"o="}},
|
||||
"~A":{"*":{k:"o="}}}),g:{"~T":
|
||||
function(n,r){if(n.o){var t={l:"%r",p1:n.o};for(var o in n)delete n[o];return t}return null}}},
|
||||
t.c["%q"]={e:t.C({"~C":{"*":{k:"~T"}},
|
||||
"@u":{"*":{k:["~T","ce"]}},
|
||||
"%B|@p|@G|@F|@E":{"*":{k:"o="}},
|
||||
"-|+":{"*":{k:"%u"}},
|
||||
"~A":{"*":{k:"o="}}}),g:{"%u":
|
||||
function(n,r){n.o=(n.o||"")+"{"+r+"}"},"~T":
|
||||
function(n,r){if(n.o){var t={l:"%r",p1:n.o};for(var o in n)delete n[o];return t}return null}}},
|
||||
t.c["@l"]={e:t.C({"~C":{"*":{}},
|
||||
",":{"*":{k:"~q"}},
|
||||
"~A":{"*":{k:"~s"}}}),g:{"~q":
|
||||
function(n,r){return{l:"~r"}}}},
|
||||
t.c.pu={e:t.C({"~C":{"*":{k:"~T"}},
|
||||
"@K|@c":{"0|a":{k:"~s"}},
|
||||
aj:{0:{k:"ak",n:"a"}},
|
||||
"%T":{0:{k:"%Z",n:"a"}},
|
||||
"%m":{"0|a":{}},
|
||||
ai:{"0|a":{k:{l:"~Q",m:"\\pm"},n:"0"}},
|
||||
"~Q":{"0|a":{k:"~s",n:"0"}},
|
||||
"//":{d:{k:"o=",n:"/"}},
|
||||
"/":{d:{k:"o=",n:"/"}},
|
||||
"%B|~A":{"0|d":{k:"d=",n:"d"},a:{k:["%m","d="],n:"d"},"/|q":{k:"q=",n:"q"}}}),g:{"%Z":
|
||||
function(n,r){var o=[];return"+-"===r[0]||"+/-"===r[0]?o.push("\\pm "):r[0]&&o.push(r[0]),r[1]&&(o=t.j(o,t.go(r[1],"%X")),r[2]&&(r[2].match(/[,.]/)?o=t.j(o,t.go(r[2],"%X")):o.push(r[2])),r[3]=r[4]||r[3],r[3]&&(r[3]=r[3].trim(),"e"===r[3]||"*"===r[3].substr(0,1)?o.push({l:"%N"}):o.push({l:"%P"}))),r[3]&&o.push("10^{"+r[5]+"}"),o},ak:
|
||||
function(n,r){var o=[];return"+-"===r[0]||"+/-"===r[0]?o.push("\\pm "):r[0]&&o.push(r[0]),o=t.j(o,t.go(r[1],"%X")),o.push("^{"+r[2]+"}"),o},"~Q":
|
||||
function(n,r,t){return{l:"~Q",A:t||r}},
|
||||
"%m":
|
||||
function(n,r){return{l:"%Q"}},
|
||||
"~T":
|
||||
function(n,r){var o,e=t.h("%A",n.d||"");e&&""===e.t&&(n.d=e.h);var a=t.h("%A",n.q||"");a&&""===a.t&&(n.q=a.h),n.d&&(n.d=n.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),n.d=n.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),n.q?(n.d=t.go(n.d,"pu"),n.q=n.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),n.q=n.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F"),n.q=t.go(n.q,"pu"),"//"===n.o?o={l:"%S",p1:n.d,p2:n.q}:(o=n.d,o=n.d.length>1||n.q.length>1?t.j(o,{l:"%V"}):t.j(o,{l:"/"}),o=t.j(o,n.q))):o=t.go(n.d,"%R");for(var u in n)delete n[u];return o}}},
|
||||
t.c["%R"]={e:t.C({"~C":{"*":{k:"~T"}},
|
||||
"*":{"*":{k:["~T","%N"],n:"0"}},
|
||||
"@E":{"*":{k:"%c"},n:"1"},"%m":{"*":{k:["~T","%m"],n:"0"}},
|
||||
"@P|%U":{1:{k:"%U"}},
|
||||
"@h":{0:{k:"%c",n:"0"},1:{k:"%U",n:"0"}},
|
||||
"%B|~A":{"*":{k:"%c",n:"1"}}}),g:{"%N":
|
||||
function(n,r){return{l:"%O"}},
|
||||
"%U":
|
||||
function(n,r){n.rm+="^{"+r+"}"},"%m":
|
||||
function(n,r){return{l:"ah"}},
|
||||
"~T":
|
||||
function(n,r){var o;if(n.rm){var e=t.h("%A",n.rm||"");o=e&&""===e.t?t.go(e.h,"pu"):{l:"rm",p1:n.rm}}for(var a in n)delete n[a];return o}}},
|
||||
t.c["%X"]={e:t.C({"~C":{0:{k:"~U"},o:{k:"~V"}},
|
||||
",":{0:{k:["~U","~q"],n:"o"}},
|
||||
".":{0:{k:["~U","~s"],n:"o"}},
|
||||
"~A":{"*":{k:"%t"}}}),g:{"~q":
|
||||
function(n,r){return{l:"~r"}},
|
||||
"~U":
|
||||
function(n,r){var t=[];if(n.text.length>4){var o=n.text.length%3;0===o&&(o=3);for(var e=n.text.length-3;e>0;e-=3)t.push(n.text.substr(e,3)),t.push({l:"%W"});t.push(n.text.substr(0,o)),t.reverse()}else t.push(n.text);for(var a in n)delete n[a];return t},"~V":
|
||||
function(n,r){var t=[];if(n.text.length>4){for(var o=n.text.length-3,e=0;e<o;e+=3)t.push(n.text.substr(e,3)),t.push({l:"%W"});t.push(n.text.substr(e))}else t.push(n.text);for(var a in n)delete n[a];return t}}};var o={H:{"~h":
|
||||
function(n){var r="";return n.a=o.go2(n.a),n.b=o.go2(n.b),n.p=o.go2(n.p),n.o=o.go2(n.o),n.q=o.go2(n.q),n.d=o.go2(n.d),n.a&&(n.a.match(/^[+\-]/)&&(n.a="{"+n.a+"}"),r+=n.a+"\\,"),(n.b||n.p)&&(r+="{\\vphantom{X}}",r+="^{\\hphantom{"+(n.b||"")+"}}_{\\hphantom{"+(n.p||"")+"}}",r+="{\\vphantom{X}}",r+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(n.b||"")+"}}",r+="_{\\vphantom{2}\\llap{\\smash[t]{"+(n.p||"")+"}}}"),n.o&&(n.o.match(/^[+\-]/)&&(n.o="{"+n.o+"}"),r+=n.o),"kv"===n["%I"]?((n.d||n.q)&&(r+="{\\vphantom{X}}"),n.d&&(r+="^{"+n.d+"}"),n.q&&(r+="_{\\smash[t]{"+n.q+"}}")):"~Y"===n["%I"]?(n.d&&(r+="{\\vphantom{X}}",r+="^{"+n.d+"}"),n.q&&(r+="{\\vphantom{X}}",r+="_{\\smash[t]{"+n.q+"}}")):(n.q&&(r+="{\\vphantom{X}}",r+="_{\\smash[t]{"+n.q+"}}"),n.d&&(r+="{\\vphantom{X}}",r+="^{"+n.d+"}")),r},rm:
|
||||
function(n){return"\\mathrm{"+n.p1+"}"},"%s":
|
||||
function(n){return n.p1.match(/[\^_]/)?(n.p1=n.p1.replace(" ","~").replace("-","\\text{-}"),"\\mathrm{"+n.p1+"}"):"\\text{"+n.p1+"}"},"%d":
|
||||
function(n){return"\\mathrm{"+n.p1+"}"},"%p":
|
||||
function(n){return"\\mskip2mu "+o.go2(n.p1)},"%K":
|
||||
function(n){return"\\mskip1mu "+o.go2(n.p1)},"~f":
|
||||
function(n){var r=o.I[n.A];if(!r)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+n.A+")"];return r},"~F":
|
||||
function(n){var r="\\frac{"+n.p1+"}{"+n.p2+"}";return"\\mathchoice{\\textstyle"+r+"}{"+r+"}{"+r+"}{"+r+"}"},"%S":
|
||||
function(n){var r="\\frac{"+o.go2(n.p1)+"}{"+o.go2(n.p2)+"}";return"\\mathchoice{\\textstyle"+r+"}{"+r+"}{"+r+"}{"+r+"}"},"%r":
|
||||
function(n){return n.p1+" "},"~G":
|
||||
function(n){return"\\frac{"+o.go2(n.p1)+"}{"+o.go2(n.p2)+"}"},"~W":
|
||||
function(n){return"\\overset{"+o.go2(n.p1)+"}{"+o.go2(n.p2)+"}"},"%x":
|
||||
function(n){return"\\underset{"+o.go2(n.p1)+"}{"+o.go2(n.p2)+"}"},"%v":
|
||||
function(n){return"\\underbrace{"+o.go2(n.p1)+"}_{"+o.go2(n.p2)+"}"},"~j":
|
||||
function(n){return"{\\color{"+n.F+"}{"+o.go2(n.G)+"}}"},"~l":
|
||||
function(n){return"\\color{"+n.B+"}"},"~b":
|
||||
function(n){n.rd=o.go2(n.rd),n.rq=o.go2(n.rq);var r=o.J[n.r];return n.rd||n.rq?"<=>"===n.r||"<=>>"===n.r||"<<=>"===n.r||"<-->"===n.r?(r="\\long"+r,n.rd&&(r="\\overset{"+n.rd+"}{"+r+"}"),n.rq&&(r="\\underset{\\lower7mu{"+n.rq+"}}{"+r+"}"),r=" {}\\mathrel{"+r+"}{} "):(n.rq&&(r+="[{"+n.rq+"}]"),r+="{"+n.rd+"}",r=" {}\\mathrel{\\x"+r+"}{} "):r=" {}\\mathrel{\\long"+r+"}{} ",r},"~Q":
|
||||
function(n){return o.K[n.A]}},
|
||||
J:{"->":"rightarrow","\u2192":"rightarrow","\u27f6":"rightarrow","<-":"leftarrow","<->":"leftrightarrow","<-->":"leftrightarrows","<=>":"rightleftharpoons","\u21cc":"rightleftharpoons","<=>>":"Rightleftharpoons","<<=>":"Leftrightharpoons"},I:{"-":"{-}",1:"{-}","=":"{=}",2:"{=}","#":"{\\equiv}",3:"{\\equiv}","~":"{\\tripledash}","~-":"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}","~=":"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}","~--":"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}","-~-":"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}","...":"{{\\cdot}{\\cdot}{\\cdot}}","....":"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}","->":"{\\rightarrow}","<-":"{\\leftarrow}","<":"{<}",">":"{>}"},L:{"%m":" ","~D":"~","%Q":"~",ah:"\\mkern3mu ","%W":"\\mkern2mu ","~r":"{,}","~n":"{{0}}\\mkern6mu ","~o":"{{0}}\\mkern3mu ","~p":"{{0}}\\mkern1mu ","~I":"\\text{-}","~~":"\\,{\\cdot}\\,","~y":"\\mkern1mu \\bullet\\mkern1mu ","@n":"{\\times}","%%":"\\prime ","%N":"\\cdot ","%O":"\\mkern1mu{\\cdot}\\mkern1mu ","%P":"\\times ","~i":"{\\sim}","^":"uparrow",v:"downarrow","~z":"\\ldots ","/":"/","%V":"\\,/\\,",al:"{0} "},K:{"+":" {}+{} ","-":" {}-{} ","=":" {}={} ","<":" {}<{} ",">":" {}>{} ","<<":" {}\\ll{} ",">>":" {}\\gg{} ","\\pm":" {}\\pm{} ","\\approx":" {}\\approx{} ","$\\approx$":" {}\\approx{} ",v:" \\downarrow{} ","(v)":" \\downarrow{} ","^":" \\uparrow{} ","(^)":" \\uparrow{} "},go:
|
||||
function(n,r){if(!n)return n;for(var t="",o=!1,e=0;e<n.length;e++){var a=n[e];if("string"==typeof a)t+=a;else if(this.H[a.l])t+=this.H[a.l](a);else{if(!this.L[a.l])throw["MhchemBugT","mhchem bug T. Please report."];var u=this.L[a.l];u=u.replace("{0}",a.p1||""),u=u.replace("{1}",a.p2||""),t+=u,"al"===a.l&&(o=!0)}}return r||o||(t="{"+t+"}"),t},go2:
|
||||
function(n){return this.go(n,!0)}};MathJax.Extension["TeX/mhchem"].CE=r,n.Definitions.Add({macros:{ce:"CE",pu:"PU",xleftrightarrow:["Extension","AMSmath"],xrightleftharpoons:["Extension","AMSmath"],xRightleftharpoons:["Extension","AMSmath"],xLeftrightharpoons:["Extension","AMSmath"],longrightleftharpoons:["Macro","\\stackrel{\\textstyle{-}\\!\\!{\\rightharpoonup}}{\\smash{{\\leftharpoondown}\\!\\!{-}}}"],longRightleftharpoons:["Macro","\\stackrel{\\textstyle{-}\\!\\!{\\rightharpoonup}}{\\smash{\\leftharpoondown}}"],longLeftrightharpoons:["Macro","\\stackrel{\\textstyle\\vphantom{{-}}{\\rightharpoonup}}{\\smash{{\\leftharpoondown}\\!\\!{-}}}"],longleftrightarrows:["Macro","\\stackrel{\\longrightarrow}{\\smash{\\longleftarrow}\\Rule{0px}{.25em}{0px}}"],tripledash:["Macro","\\vphantom{-}\\raise2mu{\\kern2mu\\tiny\\text{-}\\kern1mu\\text{-}\\kern1mu\\text{-}\\kern2mu}"]}},
|
||||
null,!0),MathJax.Extension["TeX/AMSmath"]||n.Definitions.Add({macros:{xrightarrow:["Extension","AMSmath"],xleftarrow:["Extension","AMSmath"]}},
|
||||
null,!0),MathJax.Hub.Register.StartupHook("TeX AMSmath Ready",
|
||||
function(){n.Definitions.Add({macros:{xleftrightarrow:["xArrow",8596,6,6],xrightleftharpoons:["xArrow",8652,5,7],xRightleftharpoons:["xArrow",8652,5,7],xLeftrightharpoons:["xArrow",8652,5,7]}},
|
||||
null,!0)}),n.Parse.Augment({CE:
|
||||
function(n){var t=this.GetArgument(n),o=r(t).Parse();this.string=o+this.string.substr(this.i),this.i=0},PU:
|
||||
function(n){var t=this.GetArgument(n),o=r(t).Parse("pu");this.string=o+this.string.substr(this.i),this.i=0}}),MathJax.Hub.Startup.signal.Post("TeX mhchem Ready")}),MathJax.Ajax.loadComplete("[mhchem]/mhchem.js");
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/newcommand.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/newcommand"]={version:"2.7.5"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var b=MathJax.InputJax.TeX;var a=b.Definitions;a.Add({macros:{newcommand:"NewCommand",renewcommand:"NewCommand",newenvironment:"NewEnvironment",renewenvironment:"NewEnvironment",def:"MacroDef",let:"Let"}},null,true);b.Parse.Augment({NewCommand:function(c){var e=this.trimSpaces(this.GetArgument(c)),g=this.GetBrackets(c),d=this.GetBrackets(c),f=this.GetArgument(c);if(e.charAt(0)==="\\"){e=e.substr(1)}if(!e.match(/^(.|[a-z]+)$/i)){b.Error(["IllegalControlSequenceName","Illegal control sequence name for %1",c])}if(g){g=this.trimSpaces(g);if(!g.match(/^[0-9]+$/)){b.Error(["IllegalParamNumber","Illegal number of parameters specified in %1",c])}}this.setDef(e,["Macro",f,g,d])},NewEnvironment:function(d){var f=this.trimSpaces(this.GetArgument(d)),h=this.GetBrackets(d),e=this.GetBrackets(d),g=this.GetArgument(d),c=this.GetArgument(d);if(h){h=this.trimSpaces(h);if(!h.match(/^[0-9]+$/)){b.Error(["IllegalParamNumber","Illegal number of parameters specified in %1",d])}}this.setEnv(f,["BeginEnv",[null,"EndEnv"],g,c,h,e])},MacroDef:function(c){var d=this.GetCSname(c),f=this.GetTemplate(c,"\\"+d),e=this.GetArgument(c);if(!(f instanceof Array)){this.setDef(d,["Macro",e,f])}else{this.setDef(d,["MacroWithTemplate",e].concat(f))}},Let:function(d){var e=this.GetCSname(d),f;var g=this.GetNext();if(g==="="){this.i++;g=this.GetNext()}if(g==="\\"){d=this.GetCSname(d);f=this.csFindMacro(d);if(!f){if(a.mathchar0mi.hasOwnProperty(d)){f=["csMathchar0mi",a.mathchar0mi[d]]}else{if(a.mathchar0mo.hasOwnProperty(d)){f=["csMathchar0mo",a.mathchar0mo[d]]}else{if(a.mathchar7.hasOwnProperty(d)){f=["csMathchar7",a.mathchar7[d]]}else{if(a.delimiter.hasOwnProperty("\\"+d)){f=["csDelimiter",a.delimiter["\\"+d]]}else{return}}}}}}else{f=["Macro",g];this.i++}this.setDef(e,f)},GetCSname:function(e){var f=this.GetNext();if(f!=="\\"){b.Error(["MissingCS","%1 must be followed by a control sequence",e])}var d=this.trimSpaces(this.GetArgument(e));return d.substr(1)},GetTemplate:function(f,e){var j,g=[],h=0;j=this.GetNext();var d=this.i;while(this.i<this.string.length){j=this.GetNext();if(j==="#"){if(d!==this.i){g[h]=this.string.substr(d,this.i-d)}j=this.string.charAt(++this.i);if(!j.match(/^[1-9]$/)){b.Error(["CantUseHash2","Illegal use of # in template for %1",e])}if(parseInt(j)!=++h){b.Error(["SequentialParam","Parameters for %1 must be numbered sequentially",e])}d=this.i+1}else{if(j==="{"){if(d!==this.i){g[h]=this.string.substr(d,this.i-d)}if(g.length>0){return[h,g]}else{return h}}}this.i++}b.Error(["MissingReplacementString","Missing replacement string for definition of %1",f])},MacroWithTemplate:function(d,g,h,f){if(h){var c=[];this.GetNext();if(f[0]&&!this.MatchParam(f[0])){b.Error(["MismatchUseDef","Use of %1 doesn't match its definition",d])}for(var e=0;e<h;e++){c.push(this.GetParameter(d,f[e+1]))}g=this.SubstituteArgs(c,g)}this.string=this.AddArgs(g,this.string.slice(this.i));this.i=0;if(++this.macroCount>b.config.MAXMACROS){b.Error(["MaxMacroSub1","MathJax maximum macro substitution count exceeded; is there a recursive macro call?"])}},BeginEnv:function(g,k,c,j,h){if(j){var e=[];if(h!=null){var d=this.GetBrackets("\\begin{"+name+"}");e.push(d==null?h:d)}for(var f=e.length;f<j;f++){e.push(this.GetArgument("\\begin{"+name+"}"))}k=this.SubstituteArgs(e,k);c=this.SubstituteArgs([],c)}this.string=this.AddArgs(k,this.string.slice(this.i));this.i=0;return g},EndEnv:function(e,g,d,f){var c="\\end{\\end\\"+e.name+"}";this.string=this.AddArgs(d,c+this.string.slice(this.i));this.i=0;return null},GetParameter:function(f,k){if(k==null){return this.GetArgument(f)}var h=this.i,e=0,g=0;while(this.i<this.string.length){var l=this.string.charAt(this.i);if(l==="{"){if(this.i===h){g=1}this.GetArgument(f);e=this.i-h}else{if(this.MatchParam(k)){if(g){h++;e-=2}return this.string.substr(h,e)}else{if(l==="\\"){this.i++;e++;g=0;var d=this.string.substr(this.i).match(/[a-z]+|./i);if(d){this.i+=d[0].length;e=this.i-h}}else{this.i++;e++;g=0}}}}b.Error(["RunawayArgument","Runaway argument for %1?",f])},MatchParam:function(c){if(this.string.substr(this.i,c.length)!==c){return 0}if(c.match(/\\[a-z]+$/i)&&this.string.charAt(this.i+c.length).match(/[a-z]/i)){return 0}this.i+=c.length;return 1}});b.Environment=function(c){a.environment[c]=["BeginEnv",[null,"EndEnv"]].concat([].slice.call(arguments,1));a.environment[c].isUser=true};MathJax.Hub.Startup.signal.Post("TeX newcommand Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/newcommand.js");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* /MathJax/extensions/TeX/noUndefined.js
|
||||
*
|
||||
* Copyright (c) 2009-2018 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Extension["TeX/noUndefined"]={version:"2.7.5",config:MathJax.Hub.CombineConfig("TeX.noUndefined",{disabled:false,attributes:{mathcolor:"red"}})};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var b=MathJax.Extension["TeX/noUndefined"].config;var a=MathJax.ElementJax.mml;var c=MathJax.InputJax.TeX.Parse.prototype.csUndefined;MathJax.InputJax.TeX.Parse.Augment({csUndefined:function(d){if(b.disabled){return c.apply(this,arguments)}MathJax.Hub.signal.Post(["TeX Jax - undefined control sequence",d]);this.Push(a.mtext(d).With(b.attributes))}});MathJax.Hub.Startup.signal.Post("TeX noUndefined Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/noUndefined.js");
|
||||