Compare commits
1479 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 906dab700f | |||
| c5894dd4df | |||
| 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 | |||
| 4aeb9af8a7 | |||
| b37acb8bc6 | |||
| 433865e927 | |||
| 5428161e0f | |||
| db0b536b5b | |||
| a4e50908fb | |||
| 96b89fe83d | |||
| adb131f131 | |||
| 757ab87e8a | |||
| f1d1db1159 | |||
| 3942bf60a6 | |||
| e2c0dcc0da | |||
| f63180d8d8 | |||
| 999bbf3d50 | |||
| eab612bdd0 | |||
| 1147186b4c | |||
| a88314e061 | |||
| 9221f5528d | |||
| 520f60cd65 | |||
| 84c85774e8 | |||
| 1f118deed9 | |||
| 55ce07ae73 | |||
| 85677d5e91 | |||
| 04f9be15b8 | |||
| 09cd72a829 | |||
| f5f5ad70e3 | |||
| a0774b320a | |||
| 4feea6051a | |||
| f548ea757b | |||
| abc8ea5280 | |||
| bacd2313fb | |||
| 63295d3f9b | |||
| 9c25eb20cf | |||
| 7f533f33ae | |||
| 352b4e1ed8 | |||
| 9a4252b579 | |||
| ed7011c229 | |||
| 4ddd6a5207 | |||
| 0a74c7cfd2 | |||
| d84fdc7599 | |||
| dac1268266 | |||
| b42db1c7c1 | |||
| 7a7a27c5c7 | |||
| af83186b10 | |||
| a8646f8fe7 | |||
| 01c1e30284 | |||
| b3980f9e39 | |||
| c9fd50d23e | |||
| ea3544f46d | |||
| 4e04f5f540 | |||
| b1021cf233 | |||
| 8fa3529123 | |||
| 3b494c235a | |||
| 1641c3e3e8 | |||
| ccd5d850ac | |||
| b989f160cf | |||
| 54e144564c | |||
| ab8599da6d | |||
| 0885702873 | |||
| 0083bc9302 | |||
| cbc0821928 | |||
| 7a70169d06 | |||
| bf2377ac11 | |||
| 1f79126b27 | |||
| 624e324383 | |||
| 846ebb285e | |||
| e567759935 | |||
| fe706c184e | |||
| 90bbb8e348 | |||
| e21ec540c2 | |||
| 2a4517ced4 | |||
| 8c8d151b3e | |||
| 44a3cf1934 | |||
| 5dcd3c8c8f | |||
| 251bd7cd3d | |||
| 02dfb0a8c1 | |||
| 544d499ab1 | |||
| 8ebc2f7079 | |||
| a31ba16070 | |||
| 60e3baad8a | |||
| f720a84831 | |||
| b74b2c4399 | |||
| 252aa10d75 | |||
| 6f3d362920 | |||
| 9b54e4c79f | |||
| f908d0d170 | |||
| 852ecdd1a9 | |||
| 78f5df5e56 | |||
| 580a61a515 | |||
| 4faf5a0150 | |||
| 1201d2434a | |||
| e1ca392da6 | |||
| 3ee6d22727 | |||
| 28a0329f65 | |||
| 2dc696c940 | |||
| e3acef0e91 | |||
| 62601f1adc | |||
| 982915a22f | |||
| 9f1bbd097f | |||
| 694bd6e74a | |||
| 394cf0bc8e | |||
| 09257deaae | |||
| 21c4b0dd95 | |||
| 3b4662b583 | |||
| 2e2e6457c7 | |||
| 631a7cccd6 | |||
| 2a3d51c7dc | |||
| e7e8a17b61 | |||
| 8fd8a56893 | |||
| 443c453507 | |||
| 0495c89ba1 | |||
| 78e4dfbece | |||
| 1c7a481ed9 | |||
| c3dedcbba5 | |||
| 1c767a0e9f | |||
| f3b0ba49e0 | |||
| 31dfcbaa9e | |||
| 8e11c5f46d | |||
| 70793ff559 | |||
| 6621e71e6c | |||
| 2af164ee9e | |||
| 9227f0a195 | |||
| f18330b494 | |||
| bb32339ab4 | |||
| ddf4378dfe | |||
| 2a607e209b | |||
| a3d85ae8c3 | |||
| fef62b63cb | |||
| 93ec80f773 | |||
| 8e3795c317 | |||
| cb1a633dc5 | |||
| ace4db6938 | |||
| b770062788 | |||
| 4c4dc5398a | |||
| 091945152f | |||
| 4838611273 | |||
| 144f9959c9 | |||
| 291c6a8fa0 | |||
| d5d3581b78 | |||
| 64d90b027c | |||
| a0e9989734 | |||
| b81aa923d6 | |||
| 610925bc5a | |||
| 86eda9bb10 | |||
| ca06aa9a6f | |||
| ca57d9e83d | |||
| 904f975f0c | |||
| 9b9212cf4c | |||
| 404419d1c3 | |||
| 4ee94a6574 | |||
| f929df0419 | |||
| 57587dafbe | |||
| 31a95e81b3 | |||
| 70a4e9551b | |||
| e1a705f975 | |||
| 9057ec82d8 | |||
| 1b53e36666 | |||
| 10fa5c7bd2 | |||
| 06e72a5a60 | |||
| 8fa62fc300 | |||
| 6c345fc508 | |||
| a34eac4ecb | |||
| 10c121e603 | |||
| 2b910167f4 | |||
| 7d5311a075 | |||
| f5581c4b49 | |||
| e09f7cd49c | |||
| 4dab03b61b | |||
| 2b5e017aa1 | |||
| 8b3d944fd2 | |||
| 2d886fd38a | |||
| 80088832b9 | |||
| be1883f317 | |||
| 30119e0c77 | |||
| c90c3b1544 | |||
| 578386f083 | |||
| 3d21ed362e | |||
| 9cf469b035 | |||
| 462c93ae43 | |||
| bda3b7b24d | |||
| d861a22cdd | |||
| 0de1a182da | |||
| b030554348 | |||
| 858bfa9ccd | |||
| ee8ec78da7 | |||
| c8f684895c | |||
| 138a155ba4 | |||
| ad749bf345 | |||
| ff0d59c16b | |||
| df75d2d60c | |||
| 2713aabeaf | |||
| 796d1b44c2 | |||
| 470a7b8f52 | |||
| f699b82a9f | |||
| 44edb8c7da | |||
| bc4fc0edd9 | |||
| 6545fa691b | |||
| 4954553927 | |||
| 9c50ba9eeb | |||
| 9a67da145a | |||
| ca7d82278c | |||
| f6245c53dd | |||
| 6888420cc6 | |||
| c5631f5b7d | |||
| 34e0b49d72 | |||
| bd072264ef | |||
| cfb2d24c71 | |||
| fe0eb72fa3 | |||
| 2783257f06 | |||
| cc11cb866c | |||
| 6a02643bda | |||
| 7f269c8da3 | |||
| ef7f7cebd1 | |||
| 05c24fd5e3 | |||
| b08b97bd28 | |||
| dbb6ce2f71 | |||
| f66f14b593 | |||
| 8a52315dee | |||
| 7c4052906c | |||
| 3a56f39f6a | |||
| 6585ca5dd0 | |||
| 792abae07e | |||
| 74ce648c59 | |||
| 2686e96046 | |||
| 213e2bb432 | |||
| 79bb5c10ab | |||
| 7ea012d786 | |||
| 43591f75de | |||
| 05d82c0569 | |||
| 76c8d3206c | |||
| 00751d05b4 | |||
| b5be5df11a | |||
| 7d159273fc | |||
| 70127922ab | |||
| b95df93775 | |||
| dc06edcf5b | |||
| fdc437dcd5 | |||
| f6873c9612 | |||
| 93754ab32d | |||
| 5759334635 | |||
| f2f543b72d | |||
| 598b052be3 | |||
| a746062422 | |||
| c8868d369f | |||
| 52c6e7474c | |||
| be81f09b0e | |||
| 6fa4504e31 | |||
| 992ba01a12 | |||
| 72c5a74cf1 | |||
| 919f41a0f1 | |||
| 785921cb0f | |||
| 8c8cda5e7d | |||
| 64ef74e7e9 | |||
| 776df4e6ee | |||
| 68465a8651 | |||
| fa16c8960c | |||
| 2c57915781 | |||
| d0527f1aeb | |||
| 75083c5b56 | |||
| 82526594db | |||
| 941d39800c | |||
| a1ae2e8bc0 | |||
| 4af6f366ca | |||
| c7a9534ed9 | |||
| 00bcbbf72b | |||
| ed2254ff9f | |||
| b6633f0ecb | |||
| e08d2d3052 | |||
| fbc0548b43 | |||
| a9807bd1e1 | |||
| 554b80b39d | |||
| 99e74bf00b | |||
| f48e923f28 | |||
| 5400b4bfdd | |||
| f68bebe0f6 | |||
| 4c6019b439 | |||
| 66e08a6b17 | |||
| 7898db70ed | |||
| 7c357116ff | |||
| 69ce0eb0d0 | |||
| 4db31a297b | |||
| e1fca457e4 | |||
| 7f8485ce80 | |||
| 290061fd11 | |||
| a507836936 | |||
| 6524d20a96 | |||
| f1c523aa30 | |||
| 87c08f5613 | |||
| 82913cea20 | |||
| 2ad743e4bd | |||
| fa97b57a96 | |||
| 1b952b6d56 | |||
| 90cc512bd1 | |||
| b82556c9c0 | |||
| fbe3b4bb3b | |||
| 5ffd98ad31 | |||
| cb9dd4d228 | |||
| cd823bf10c | |||
| 5560ec52c2 | |||
| 065151a77f | |||
| 23454f556c | |||
| a2b3ddf931 | |||
| 44b0d2fcfc | |||
| aed4cc590a | |||
| 72ee08b5ab | |||
| 45547624e4 | |||
| f928cfa8be | |||
| 988984846a | |||
| 1149618653 | |||
| 168a033903 | |||
| 6a765c9791 | |||
| e16ae7b511 | |||
| 174334ea44 | |||
| dbdf06930d | |||
| c93e65ddc3 | |||
| 56101ed264 | |||
| 8269c8e574 | |||
| 2246419d1e | |||
| 118a0c318b | |||
| 5401cf2910 | |||
| 432f9b8d2f | |||
| 66fc8a2d31 | |||
| 2f3dd3d227 | |||
| c43fd9fa6c | |||
| 868518e0f5 | |||
| 039b5cce98 | |||
| 4a421842d5 | |||
| cfbb124f81 | |||
| dcb147cde2 | |||
| 8d06b5e67e | |||
| 4776d0b422 | |||
| 58bb340c33 | |||
| ee790a9b7c | |||
| ac432aad78 | |||
| 30207e0a39 | |||
| d98547a33c | |||
| b7cdeabbf6 | |||
| be9907a0cc | |||
| 30f42c50a9 | |||
| 7cba65b138 | |||
| f34a78b336 | |||
| e1942dda03 | |||
| 7142e284fa | |||
| 3c1c588953 | |||
| 52cc6bae34 | |||
| 955c608115 | |||
| 2e00cf312c | |||
| 09bbc144d1 | |||
| d02b63a434 | |||
| 9b63c67d8c | |||
| 05c4bf3374 | |||
| 424b4d3f4e | |||
| f9a6187fab | |||
| d406472882 | |||
| 749b5a5ff8 | |||
| 091d5fe750 | |||
| c8894fb465 | |||
| 2dd41cbfac | |||
| 1f2165e68b | |||
| e9b6bdbdd7 | |||
| c0c77c5ba7 | |||
| 12403172ac | |||
| 3b41ab8d75 | |||
| 7bcf35f5b1 | |||
| 9a7e1c94c7 | |||
| 30c2e675da | |||
| ac405803e8 | |||
| 7dee787a92 | |||
| ae4b1cdeca | |||
| 572982cbf9 | |||
| 74290874f9 | |||
| 847f08d952 | |||
| 0bcd616668 | |||
| 9dd701ccc4 | |||
| 56a5a7d92b | |||
| 0cf0fad50e | |||
| 5f9e91656e | |||
| a7a2479f85 | |||
| a8b230a490 | |||
| 041b01f171 | |||
| 1c475f3215 | |||
| ab699d94b0 | |||
| 942d32c9b6 | |||
| 97f15f0b18 | |||
| ed49358c50 | |||
| 85eeecd140 | |||
| 30fd40fbe5 | |||
| 2ed262cacd | |||
| 29a1ef8f8a | |||
| 772d18ee62 | |||
| dd604d9942 | |||
| 85abc83427 | |||
| 6d8220629c | |||
| 6ff7ada096 | |||
| 8575049de5 | |||
| bb6fb0c253 | |||
| eb2ad9f840 | |||
| d0dd23fc11 | |||
| 7ae4acbdb0 | |||
| 881590ab37 | |||
| 5e479dc5d9 | |||
| 7db9c2e762 | |||
| ce6b0ac095 | |||
| 420bb06988 | |||
| 20566f8acf | |||
| 1d5f69704a | |||
| 0da664299e | |||
| 6e8fb2b457 | |||
| d1c72a4ff3 | |||
| 0bf05392e4 | |||
| 7ecef0c045 | |||
| 33ca329253 | |||
| 01fa4770cb | |||
| b76257c49c | |||
| e2fbf22f38 | |||
| 134432d029 | |||
| 8d4d6e80b8 | |||
| 85e6ef3dca | |||
| 60f1467229 | |||
| 1757242382 | |||
| 55df7bb9c4 | |||
| 686b8acd38 | |||
| a5f9df6170 | |||
| 27f61a870a | |||
| a48e8d1c5c | |||
| b80f74bccd | |||
| 1e768734ef | |||
| 11c9cabeb3 | |||
| 3a14ab92f0 | |||
| 62d5f52398 | |||
| 2b4848566c | |||
| 7c825e877c | |||
| 8417c277e6 | |||
| 9cef423908 | |||
| e73c84490e | |||
| 6cfc807db0 | |||
| be366f8103 | |||
| 2d13bd796f | |||
| 523f8f80ca | |||
| b76fef9143 | |||
| e935af83d5 | |||
| d4e019ef42 | |||
| 2e738828c6 | |||
| fd7dc93778 | |||
| 3df407d9ee | |||
| 6fbba84725 | |||
| 37d20fa9cc | |||
| 410cd912ac | |||
| d234bbd861 | |||
| 3f68d96815 | |||
| 015cd895d2 | |||
| 5fa4b48d85 | |||
| 88a3783bbc | |||
| ea2254b9bd | |||
| 9a0c1f2605 | |||
| 008f26bb7d | |||
| 69e453ea0b | |||
| 88b0b608f4 | |||
| 19e3987ae3 | |||
| c72e91ddaf | |||
| c789dd5067 | |||
| 551949de29 | |||
| 80730ee87a | |||
| 71028adc9e | |||
| a2efebc06c | |||
| a4e277a86b | |||
| 494c80d8b1 | |||
| 02539bfdd3 | |||
| a0f05eaf67 | |||
| 72e26fc90b | |||
| 2261cfabf3 | |||
| c1afa2a0e3 | |||
| d28f454c6e | |||
| f471c80ac0 | |||
| be086d94b5 | |||
| ff719510b6 | |||
| 7b16116b67 | |||
| 8422b71204 | |||
| c9bc2a89f6 | |||
| 387a52a7ba | |||
| 96842d9742 | |||
| 8fcef5401b | |||
| 804c4c678d | |||
| 8558777ece | |||
| 77bb608878 | |||
| 2f574261a7 | |||
| 28c4a2c39e | |||
| bd36cb59b1 | |||
| 998358ada8 | |||
| 75a00e8821 | |||
| b5653464d2 | |||
| 0269cd0b3b | |||
| 88ed662fd4 | |||
| 7c180c86a4 | |||
| f811ac510e | |||
| 3e5054f357 | |||
| 3424a424a7 | |||
| 8eb8af8ef8 | |||
| 8eaf7fc497 | |||
| 3255709399 | |||
| 2dbea36b81 | |||
| e0b7009bff | |||
| 77fb5ec3cb | |||
| 7392bce5dc | |||
| 8188bbd35d | |||
| 80fdea7bfb | |||
| dc9f6ac709 | |||
| ba796bc23d | |||
| e0ecb4c44f | |||
| d4c05304e9 | |||
| ccdbd71517 | |||
| 454fce09c6 | |||
| be4b12b4c8 | |||
| 9fa629de31 | |||
| 78dd5774b3 | |||
| bb9a9cd0db | |||
| ab9d8fb3db | |||
| 6ce76af2be | |||
| 3199a4b2cb | |||
| 6a2d153c3d | |||
| bfd4ad9255 | |||
| 30224515fd | |||
| d7f3acfd05 | |||
| a9e9eeeb54 | |||
| 76fa52b313 | |||
| 67de8e6a3a | |||
| ff78998829 | |||
| 55786e2d29 | |||
| 20534a71b9 | |||
| 316b6feccb | |||
| 6c7417e0a2 | |||
| af89dc881e | |||
| 5714cef3de | |||
| 3d2c8e7cc5 | |||
| 772ffcc5e8 | |||
| 8c30bb3a9f | |||
| 89bc121d3f | |||
| 1cc9d7b647 | |||
| 50e494e8e9 | |||
| 19325930a2 | |||
| ac97f7e9a2 | |||
| 33f133b8b2 | |||
| 2e9995e80a | |||
| 53f676bf2e | |||
| 874d658d2a | |||
| d27c455ab7 | |||
| 9291431c61 | |||
| 2e5f51e9ae | |||
| 2aa7e466ed | |||
| 3767a11d21 | |||
| 8c8b72d482 | |||
| bb9effa282 | |||
| 52e96bfa0f | |||
| 00ded65b7f | |||
| f738aa4234 | |||
| 6ff939451c | |||
| 32930cee01 | |||
| 3f45c76f48 | |||
| 1511baf12d | |||
| 20dd0816a6 | |||
| 41cd43ebc6 | |||
| 4a63899722 | |||
| c31ead493a | |||
| 7485733fba | |||
| e930b5d07b | |||
| 4543781153 | |||
| 1d5bfbb162 | |||
| 7045f7f92d | |||
| 5e7974f30b | |||
| 1079a888d3 | |||
| b1837abbc2 | |||
| 611e1a536c | |||
| c152ae1557 | |||
| de3020c1aa | |||
| f12c3fe06f | |||
| 754485c306 | |||
| 088448a8a1 | |||
| 6e35a09abd | |||
| 8fd11e8fdb | |||
| 40855103ad | |||
| 02041dbdb7 | |||
| 18ccc01501 | |||
| 1ff3f9c0da | |||
| 7a251248f1 | |||
| 971cbb94f6 | |||
| b53c961db2 | |||
| 9c40cbea76 | |||
| a8ce7e93cd | |||
| 4b02b74d6f | |||
| 67dd3afd92 | |||
| 7aca7fa0ec | |||
| c0564a1467 | |||
| b0a8984d3b | |||
| 0f451d6833 | |||
| c704d1f3b3 | |||
| e6d568fd49 | |||
| ee56509302 | |||
| bc5896b51f | |||
| 3224f5f422 | |||
| f9cd97edaa | |||
| e1ce3d46de | |||
| 294a8e9642 | |||
| 44fb6d9648 | |||
| 74c1ba1653 | |||
| 0cb39f049f | |||
| f7a3a8aa55 | |||
| cbc37eb006 | |||
| 097f45eeb3 | |||
| 4c5b3dd76f | |||
| ccf70590a4 | |||
| 3c709a27ac | |||
| 8554654ee9 | |||
| 59ac86cf6e | |||
| a4ecc9a187 | |||
| cc67c8b68e | |||
| b41f660fec | |||
| 00edcbbf64 | |||
| c530c70575 | |||
| 21840bb344 | |||
| 57bc23779d | |||
| 78e649f30a | |||
| eaa7a61f71 | |||
| 150a019b8d | |||
| 5dd1158025 | |||
| c60ca4a8d2 | |||
| e1b28f0805 | |||
| aeeaeb1eae | |||
| 76f87f9094 | |||
| 01e1c92813 | |||
| 22c0206451 | |||
| 5173c258b7 | |||
| ff8b892ebe | |||
| 7b0988cc19 | |||
| a4c79f09f8 | |||
| 7ec3d92215 | |||
| ac9fef784a | |||
| 4822bad4fb | |||
| d7dd90f073 | |||
| bbc19d1800 | |||
| 9ee9e61312 | |||
| f765137f3f | |||
| e160822b0f | |||
| c0e35b0126 | |||
| ac41ed629e | |||
| 8b5dfff2a1 | |||
| e77154bf7a | |||
| 5f5187e05c | |||
| 5db1728a3f | |||
| c7984ceed1 | |||
| 5d3571b7a3 | |||
| c1082b4474 | |||
| 14f16349c0 | |||
| aa7e01a085 | |||
| 484629734e | |||
| 444fca2250 | |||
| 7f17102c86 | |||
| e480998a4c | |||
| 5c642997fe | |||
| 5be5cd5ba5 | |||
| 1d55ed0599 | |||
| 4380aa9803 | |||
| 66e7f240da | |||
| f3e5816547 | |||
| 3d5931c259 | |||
| d510c74456 | |||
| 7154220d0b | |||
| d5155273df | |||
| 60dbe9d0a7 | |||
| f7d3f6b3f0 | |||
| 40fdd2aa74 | |||
| f39ed93ca0 | |||
| 541b2fabb4 | |||
| 067ad72f34 | |||
| 6c137e39c9 | |||
| f8c6cdb207 | |||
| f5de6a809d | |||
| e36b96fca6 | |||
| cd1738bdf6 | |||
| ebcd30fadc | |||
| 3c10a6bf94 | |||
| dc80fd9b15 | |||
| 5d21df9ac7 | |||
| 019e912d7f | |||
| 3479dca0d0 | |||
| 32e5cc4a5a | |||
| 268a9f18fa | |||
| 16a6186570 | |||
| 4b2fb6dd11 | |||
| 67d21bcd64 | |||
| 9b87126f0f | |||
| 1043b4de70 | |||
| 4bc5e7b8ff | |||
| 423b5205bf | |||
| fde288d9e8 | |||
| f2a2d85008 | |||
| 3a91b076e1 | |||
| 27bd608b53 | |||
| 966ba29084 | |||
| 3ea5b0193c | |||
| 97dd1b3b00 | |||
| fe0088d1ae | |||
| 342e1e22f8 | |||
| c9203047fc | |||
| a3a946ccd6 | |||
| 22564f34a9 | |||
| f939c24aa4 | |||
| be93fa747b | |||
| d7f4eeea2c | |||
| 6191f60025 | |||
| 82ccb0cedb | |||
| eb92e4413a | |||
| b0ba205532 | |||
| 4fa2cdf8d9 | |||
| ae30b23d34 | |||
| 1d3905bb71 | |||
| aa1e845f9a | |||
| fbcc69ec67 | |||
| 68b2de6dd7 | |||
| 20389babbc | |||
| f9899033aa | |||
| eb37b17486 | |||
| c428cad286 | |||
| 26486da27b | |||
| cabd0ed85e | |||
| f53e1a60d5 | |||
| ec694e4a99 | |||
| 81e076c924 | |||
| 04070ffc23 | |||
| 6941d6b863 | |||
| 3c88f68f16 | |||
| 82461da704 | |||
| 8e5d17c907 | |||
| 43d2143506 | |||
| 28b729acda | |||
| 584641236b | |||
| ca74897569 | |||
| 61987c85d2 | |||
| cfb75abeed | |||
| fd32706f0b | |||
| d1f90b7d44 | |||
| f09bc4a81a | |||
| 31b3aea282 | |||
| 2e1d236e8e | |||
| 065d06a98f | |||
| 63107566ec | |||
| 4f1dcea806 | |||
| 5da1a2c611 | |||
| 180a214e1f | |||
| bb417c6975 | |||
| 75c02475be | |||
| 2fd07211d9 | |||
| 128f3be596 | |||
| 810333dbb7 | |||
| e465358ec0 | |||
| 2954ed84a0 | |||
| b36cd8a68e | |||
| 8435daa598 | |||
| 38c943d564 | |||
| 8e89ec504f | |||
| a692ec1124 | |||
| 4e5f2c9587 | |||
| 1cc263acfb | |||
| 49c6534da6 | |||
| 02d3a3d7ec | |||
| 1dbe49243c | |||
| 2c12fb7ae8 | |||
| 829c6debbd | |||
| f2d3ed322e | |||
| d90e7db497 | |||
| 26f372a36a | |||
| b037777f83 | |||
| 35ce35b1e0 | |||
| e1517c2907 | |||
| ed5f88daa0 | |||
| 4afda646f0 | |||
| e782538777 | |||
| 4e86be86d9 | |||
| 6c8cfcd7c2 | |||
| 9fc7929665 | |||
| d590bf7d64 | |||
| c0f653340e | |||
| ac2bef083b | |||
| 42c7d0ca44 | |||
| 8a8afcfb24 | |||
| 5d259bb5aa | |||
| d2a24ed4bc | |||
| efd2f49484 | |||
| 9d4d6ccca5 | |||
| 218c894b5a | |||
| 0dec522542 | |||
| 7fa6708483 | |||
| 33af47c282 | |||
| 6b971e9e1b | |||
| 50107504a6 | |||
| 2cb0c9fea6 | |||
| dd7c2cc7f6 | |||
| 857ca14499 | |||
| f022b3fcde | |||
| 9470ff2dcc | |||
| 04579d7ae6 | |||
| e9a9eb1779 | |||
| 9a89a16388 | |||
| 7649abf86a | |||
| b6ad97745d | |||
| 92028e191d | |||
| 7d4427a5d3 | |||
| 347260f17b | |||
| 1086fba7da |
@@ -0,0 +1,40 @@
|
||||
# https://help.github.com/articles/dealing-with-line-endings
|
||||
#
|
||||
# For Mac & Linux
|
||||
# git config --global core.autocrlf input
|
||||
#
|
||||
# For windows
|
||||
# git config --global core.autocrlf true
|
||||
#
|
||||
# Set default behaviour, in case users don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
# Explicitly declare text files we want to always be normalized and converted
|
||||
# to native line endings on checkout.
|
||||
*.txt text
|
||||
*.md text
|
||||
*.rb text
|
||||
*.js text
|
||||
*.html text
|
||||
*.yml text
|
||||
*.mustache text
|
||||
*.css text
|
||||
Rakefile text
|
||||
Gemfile text
|
||||
LICENSE text
|
||||
COPYRIGHT text
|
||||
gollum text
|
||||
.gitattributes text
|
||||
.gitignore 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).
|
||||
@@ -4,3 +4,7 @@ pkg
|
||||
.bundle
|
||||
Gemfile.lock
|
||||
*.gem
|
||||
*.swp
|
||||
.*
|
||||
!.sprockets*
|
||||
!lib/gollum/public/gollum/stylesheets/_styles.css
|
||||
|
||||
+7
-4
@@ -1,6 +1,9 @@
|
||||
rvm:
|
||||
- 1.8.7
|
||||
notifications:
|
||||
disabled: true
|
||||
- 2.4.0
|
||||
- 2.6.0
|
||||
- jruby-9.2.9.0
|
||||
jdk:
|
||||
- oraclejdk9
|
||||
before_install:
|
||||
- sudo apt-get install -y asciidoc
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install libicu-dev
|
||||
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
# 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://pgp.mit.edu/pks/lookup?op=vindex&search=0xD637E455CD3E27BF)
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
### 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 ../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
|
||||
```
|
||||
@@ -1,4 +1,10 @@
|
||||
source "http://rubygems.org"
|
||||
source 'https://rubygems.org'
|
||||
|
||||
if RUBY_PLATFORM == 'java'
|
||||
gem 'warbler'
|
||||
end
|
||||
|
||||
gemspec
|
||||
gem "rake", "~> 0.9.2"
|
||||
|
||||
gem "rake", '~> 12.3', '>= 12.3.3'
|
||||
|
||||
|
||||
+60
@@ -1,3 +1,63 @@
|
||||
# 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.4.0 / 2012-04-10
|
||||
|
||||
* Minor
|
||||
|
||||
@@ -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,496 +1,152 @@
|
||||
gollum -- A wiki built on top of Git
|
||||
gollum -- A git-based Wiki
|
||||
====================================
|
||||
|
||||
[](http://badge.fury.io/rb/gollum)
|
||||
[](https://travis-ci.org/gollum/gollum)
|
||||
[](https://www.codetriage.com/gollum/gollum)
|
||||
|
||||
**Please update to gollum 5.1.1 to counter a recent exploit in the kramdown rendering gem, [CVE-2020-14001](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14001)**
|
||||
|
||||
**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:
|
||||
|
||||
* 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
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
Installation examples for individual systems can be seen [here](https://github.com/gollum/gollum/wiki/Installation).
|
||||
|
||||
$ [sudo] gem install gollum
|
||||
To run, simply:
|
||||
|
||||
If you're installing from source, you can use [Bundler][bundler] to pick up all the
|
||||
gems:
|
||||
1. Run: `gollum /path/to/wiki`.
|
||||
2. Open `http://localhost:4567` in your browser.
|
||||
|
||||
$ bundle install
|
||||
See [below](#running-from-source) for information on running Gollum from source, as a Rack app, and more.
|
||||
|
||||
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.
|
||||
### Markups
|
||||
|
||||
* [ASCIIDoc](http://www.methods.co.nz/asciidoc/) -- `brew install asciidoc`
|
||||
* [Creole](http://wikicreole.org/) -- `gem install creole`
|
||||
* [Markdown](http://daringfireball.net/projects/markdown/) -- `gem install redcarpet`
|
||||
* [GitHub Flavored Markdown](http://github.github.com/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.
|
||||
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`
|
||||
|
||||
## RUNNING
|
||||
### Markdown flavors
|
||||
|
||||
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:
|
||||
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
|
||||
See [here](https://github.com/gollum/gollum/wiki/Custom-rendering-gems) for instructions on how to use custom rendering gems and set custom options.
|
||||
|
||||
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:
|
||||
## RUNNING FROM SOURCE
|
||||
|
||||
$ gollum --help
|
||||
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.
|
||||
|
||||
### Rack
|
||||
|
||||
## REPO STRUCTURE
|
||||
Gollum can also be ran 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).
|
||||
|
||||
A Gollum repository's contents are designed to be human editable. Page content
|
||||
is written in `page files` and may be organized into directories any way you
|
||||
choose. Special footers can be created in `footer files`. Other content
|
||||
(images, PDFs, etc) may also be present and organized in the same way.
|
||||
### Rack, with an authentication server
|
||||
|
||||
Gollum can also be ran 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).
|
||||
|
||||
## PAGE FILES
|
||||
### Docker
|
||||
|
||||
Page files may be written in any format supported by
|
||||
[GitHub-Markup](http://github.com/github/markup) (except roff). The
|
||||
current list of formats and allowed extensions is:
|
||||
Gollum can also be ran via [Docker](https://www.docker.com/). More on that [over here](https://github.com/gollum/gollum/wiki/Gollum-via-Docker).
|
||||
|
||||
* ASCIIDoc: .asciidoc
|
||||
* Creole: .creole
|
||||
* Markdown: .markdown, .mdown, .mkdn, .mkd, .md
|
||||
* Org Mode: .org
|
||||
* Pod: .pod
|
||||
* RDoc: .rdoc
|
||||
* ReStructuredText: .rest.txt, .rst.txt, .rest, .rst
|
||||
* Textile: .textile
|
||||
* MediaWiki: .mediawiki, .wiki
|
||||
### Service
|
||||
|
||||
Gollum detects the page file format via the extension, so files must have one
|
||||
of the supported extensions in order to be converted.
|
||||
Gollum can also be ran as a service. More on that [over here](https://github.com/gollum/gollum/wiki/Gollum-as-a-service).
|
||||
|
||||
Page file names may contain any printable UTF-8 character except space
|
||||
(U+0020) and forward slash (U+002F). If you commit a page file with any of
|
||||
these characters in the name it will not be accessible via the web interface.
|
||||
## CONFIGURATION
|
||||
|
||||
Even though page files may be placed in any directory, there is still only a
|
||||
single namespace for page names, so all page files should have globally unique
|
||||
names regardless of where they are located in the repository.
|
||||
Gollum comes with the following command line options:
|
||||
|
||||
The special page file `Home.ext` (where the extension is one of the supported
|
||||
formats) will be used as the entrance page to your wiki. If it is missing, an
|
||||
automatically generated table of contents will be shown instead.
|
||||
| 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. |
|
||||
| --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. |
|
||||
|
||||
## SIDEBAR FILES
|
||||
**Notes:**
|
||||
|
||||
Sidebar files allow you to add a simple sidebar to your wiki. Sidebar files
|
||||
are named `_Sidebar.ext` where the extension is one of the supported formats.
|
||||
Sidebars affect all pages in their directory and any subdirectories that do not
|
||||
have a sidebar file of their own.
|
||||
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.
|
||||
|
||||
## FOOTER FILES
|
||||
### Config file
|
||||
|
||||
Footer files allow you to add a simple footer to your wiki. Footer files must
|
||||
be named `_Footer.ext` where the extension is one of the supported formats.
|
||||
Like sidebars, footers affect all pages in their directory and any
|
||||
subdirectories that do not have a footer file of their own.
|
||||
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.
|
||||
|
||||
**All of the mentioned alterations work both for Gollum's config file (`config.rb`) and Rack's config file (`config.ru`).**
|
||||
|
||||
## HTML SANITIZATION
|
||||
## CONTRIBUTING
|
||||
|
||||
For security and compatibility reasons Gollum wikis may not contain custom CSS
|
||||
or JavaScript. These tags will be stripped from the converted HTML. See
|
||||
`docs/sanitization.md` for more details on what tags and attributes are
|
||||
allowed.
|
||||
|
||||
|
||||
## BRACKET TAGS
|
||||
|
||||
A variety of Gollum tags use a double bracket syntax. For example:
|
||||
|
||||
[[Link]]
|
||||
|
||||
Some tags will accept attributes which are separated by pipe symbols. For
|
||||
example:
|
||||
|
||||
[[Link|Page Title]]
|
||||
|
||||
In all cases, the first thing in the link is what is displayed on the page.
|
||||
So, if the tag is an internal wiki link, the first thing in the tag will be
|
||||
the link text displayed on the page. If the tag is an embedded image, the
|
||||
first thing in the tag will be a path to an image file. Use this trick to
|
||||
easily remember which order things should appear in tags.
|
||||
|
||||
Some formats, such as MediaWiki, support the opposite syntax:
|
||||
|
||||
[[Page Title|Link]]
|
||||
|
||||
## PAGE LINKS
|
||||
|
||||
To link to another Gollum wiki page, use the Gollum Page Link Tag.
|
||||
|
||||
[[Frodo Baggins]]
|
||||
|
||||
The above tag will create a link to the corresponding page file named
|
||||
`Frodo-Baggins.ext` where `ext` may be any of the allowed extension types. The
|
||||
conversion is as follows:
|
||||
|
||||
1. Replace any spaces (U+0020) with dashes (U+002D)
|
||||
2. Replace any slashes (U+002F) with dashes (U+002D)
|
||||
|
||||
If you'd like the link text to be something that doesn't map directly to the
|
||||
page name, you can specify the actual page name after a pipe:
|
||||
|
||||
[[Frodo|Frodo Baggins]]
|
||||
|
||||
The above tag will link to `Frodo-Baggins.ext` using "Frodo" as the link text.
|
||||
|
||||
The page file may exist anywhere in the directory structure of the repository.
|
||||
Gollum does a breadth first search and uses the first match that it finds.
|
||||
|
||||
Here are a few more examples:
|
||||
|
||||
[[J. R. R. Tolkien]] -> J.-R.-R.-Tolkien.ext
|
||||
[[Movies / The Hobbit]] -> Movies---The-Hobbit.ext
|
||||
[[モルドール]] -> モルドール.ext
|
||||
|
||||
|
||||
## EXTERNAL LINKS
|
||||
|
||||
As a convenience, simple external links can be placed within brackets and they
|
||||
will be linked to the given URL with the URL as the link text. For example:
|
||||
|
||||
[[http://example.com]]
|
||||
|
||||
External links must begin with either "http://" or "https://". If you need
|
||||
something more flexible, you can resort to the link syntax in the page's
|
||||
underlying markup format.
|
||||
|
||||
|
||||
## ABSOLUTE VS. RELATIVE VS. EXTERNAL PATH
|
||||
|
||||
For Gollum tags that operate on static files (images, PDFs, etc), the paths
|
||||
may be referenced as either relative, absolute, or external. Relative paths
|
||||
point to a static file relative to the page file within the directory
|
||||
structure of the Gollum repo (even though after conversion, all page files
|
||||
appear to be top level). These paths are NOT prefixed with a slash. For
|
||||
example:
|
||||
|
||||
gollum.pdf
|
||||
docs/diagram.png
|
||||
|
||||
Absolute paths point to a static file relative to the Gollum repo's
|
||||
root, regardless of where the page file is stored within the directory
|
||||
structure. These paths ARE prefixed with a slash. For example:
|
||||
|
||||
/pdfs/gollum.pdf
|
||||
/docs/diagram.png
|
||||
|
||||
External paths are full URLs. An external path must begin with either
|
||||
"http://" or "https://". For example:
|
||||
|
||||
http://example.com/pdfs/gollum.pdf
|
||||
http://example.com/images/diagram.png
|
||||
|
||||
All of the examples in this README use relative paths, but you may use
|
||||
whatever works best in your situation.
|
||||
|
||||
|
||||
## FILE LINKS
|
||||
|
||||
To link to static files that are contained in the Gollum repository you should
|
||||
use the Gollum File Link Tag.
|
||||
|
||||
[[Gollum|gollum.pdf]]
|
||||
|
||||
The first part of the tag is the link text. The path to the file appears after
|
||||
the pipe.
|
||||
|
||||
|
||||
## IMAGES
|
||||
|
||||
To display images that are contained in the Gollum repository you should use
|
||||
the Gollum Image Tag. This will display the actual image on the page.
|
||||
|
||||
[[gollum.png]]
|
||||
|
||||
In addition to the simple format, there are a variety of options that you
|
||||
can specify between pipe delimiters.
|
||||
|
||||
To specify alt text, use the `alt=` option. Default is no alt text.
|
||||
|
||||
[[gollum.png|alt=Gollum and his precious wiki]]
|
||||
|
||||
To place the image in a frame, use the `frame` option. When combined with the
|
||||
`alt=` option, the alt text will be used as a caption as well. Default is no
|
||||
frame.
|
||||
|
||||
[[gollum.png|frame|alt=Gollum and his precious wiki]]
|
||||
|
||||
To specify the alignment of the image on the page, use the `align=` option.
|
||||
Possible values are `left`, `center`, and `right`. Default is `left`.
|
||||
|
||||
[[gollum.png|align=center]]
|
||||
|
||||
To float an image so that text flows around it, use the `float` option. When
|
||||
`float` is specified, only `left` and `right` are valid `align` options.
|
||||
Default is not floating. When floating is activated but no alignment is
|
||||
specified, default alignment is `left`.
|
||||
|
||||
[[gollum.png|float]]
|
||||
|
||||
To specify a max-width, use the `width=` option. Units must be specified in
|
||||
either `px` or `em`.
|
||||
|
||||
[[gollum.png|width=400px]]
|
||||
|
||||
To specify a max-height, use the `height=` option. Units must be specified in
|
||||
either `px` or `em`.
|
||||
|
||||
[[gollum.png|height=300px]]
|
||||
|
||||
Any of these options may be composed together by simply separating them with
|
||||
pipes.
|
||||
|
||||
|
||||
## ESCAPING GOLLUM TAGS
|
||||
|
||||
If you need the literal text of a wiki or static link to show up in your final
|
||||
wiki page, simply preface the link with a single quote (like in LISP):
|
||||
|
||||
'[[Page Link]]
|
||||
'[[File Link|file.pdf]]
|
||||
'[[image.jpg]]
|
||||
|
||||
This is useful for writing about the link syntax in your wiki pages.
|
||||
|
||||
|
||||
## SYNTAX HIGHLIGHTING
|
||||
|
||||
In page files you can get automatic syntax highlighting for a wide range of
|
||||
languages (courtesy of [Pygments](http://pygments.org/) - must install
|
||||
separately) by using the following syntax:
|
||||
|
||||
```ruby
|
||||
def foo
|
||||
puts 'bar'
|
||||
end
|
||||
```
|
||||
|
||||
The block must start with three backticks, at the beginning of a line or
|
||||
indented with any number of spaces or tabs.
|
||||
After that comes the name of the language that is contained by the
|
||||
block. The language must be one of the `short name` lexer strings supported by
|
||||
Pygments. See the [list of lexers](http://pygments.org/docs/lexers/) for valid
|
||||
options.
|
||||
|
||||
The block contents should be indented at the same level than the opening backticks.
|
||||
If the block contents are indented with an additional two spaces or one tab,
|
||||
then that whitespace will be ignored (this makes the blocks easier to read in plaintext).
|
||||
|
||||
The block must end with three backticks indented at the same level than the opening
|
||||
backticks.
|
||||
|
||||
## MATHEMATICAL EQUATIONS
|
||||
|
||||
|
||||
Page files may contain mathematic equations in TeX syntax that will be nicely
|
||||
typeset into the expected output. A block-style equation is delimited by `\[`
|
||||
and `\]`. For example:
|
||||
|
||||
\[ P(E) = {n \choose k} p^k (1-p)^{ n-k} \]
|
||||
|
||||
Inline equations are delimited by `\(` and `\)`. These equations will appear
|
||||
inline with regular text. For example:
|
||||
|
||||
The Pythagorean theorem is \( a^2 + b^2 = c^2 \).
|
||||
|
||||
### INSTALLATION REQUIREMENTS
|
||||
|
||||
In order to get the mathematical equations rendering to work, you need the following binaries:
|
||||
|
||||
* LaText, TeTex or MacTex/BasicTeX (latex, dvips)
|
||||
* ImageMagick (convert)
|
||||
* Ghostscript (gs)
|
||||
|
||||
## SEQUENCE DIAGRAMS
|
||||
|
||||
You may imbed sequence diagrams into your wiki page (rendered by
|
||||
[WebSequenceDiagrams](http://www.websequencediagrams.com) by using the
|
||||
following syntax:
|
||||
|
||||
{{{ blue-modern
|
||||
alice->bob: Test
|
||||
bob->alice: Test response
|
||||
}}}
|
||||
|
||||
You can replace the string "blue-modern" with any supported style.
|
||||
|
||||
## API DOCUMENTATION
|
||||
|
||||
The Gollum API 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.
|
||||
|
||||
Initialize the Gollum::Repo object:
|
||||
|
||||
# Require rubygems if necessary
|
||||
require 'rubygems'
|
||||
|
||||
# Require the Gollum library
|
||||
require 'gollum'
|
||||
|
||||
# Create a new Gollum::Wiki object by initializing it with the path to the
|
||||
# Git repository.
|
||||
wiki = Gollum::Wiki.new("my-gollum-repo.git")
|
||||
# => <Gollum::Wiki>
|
||||
|
||||
By default, internal wiki links are all absolute from the root. To specify a different base path, you can specify the `:base_path` option:
|
||||
|
||||
wiki = Gollum::Wiki.new("my-gollum-repo.git", :base_path => "/wiki")
|
||||
|
||||
Get the latest version of the given human or canonical page name:
|
||||
|
||||
page = wiki.page('page-name')
|
||||
# => <Gollum::Page>
|
||||
|
||||
page.raw_data
|
||||
# => "# My wiki page"
|
||||
|
||||
page.formatted_data
|
||||
# => "<h1>My wiki page</h1>"
|
||||
|
||||
page.format
|
||||
# => :markdown
|
||||
|
||||
vsn = page.version
|
||||
# => <Grit::Commit>
|
||||
|
||||
vsn.id
|
||||
# => '3ca43e12377ea1e32ea5c9ce5992ec8bf266e3e5'
|
||||
|
||||
Get the footer (if any) for a given page:
|
||||
|
||||
page.footer
|
||||
# => <Gollum::Page>
|
||||
|
||||
Get a list of versions for a given page:
|
||||
|
||||
vsns = wiki.page('page-name').versions
|
||||
# => [<Grit::Commit, <Grit::Commit, <Grit::Commit>]
|
||||
|
||||
vsns.first.id
|
||||
# => '3ca43e12377ea1e32ea5c9ce5992ec8bf266e3e5'
|
||||
|
||||
vsns.first.authored_date
|
||||
# => Sun Mar 28 19:11:21 -0700 2010
|
||||
|
||||
Get a specific version of a given canonical page file:
|
||||
|
||||
wiki.page('page-name', '5ec521178e0eec4dc39741a8978a2ba6616d0f0a')
|
||||
|
||||
Get the latest version of a given static file:
|
||||
|
||||
file = wiki.file('asset.js')
|
||||
# => <Gollum::File>
|
||||
|
||||
file.raw_data
|
||||
# => "alert('hello');"
|
||||
|
||||
file.version
|
||||
# => <Grit::Commit>
|
||||
|
||||
Get a specific version of a given static file:
|
||||
|
||||
wiki.file('asset.js', '5ec521178e0eec4dc39741a8978a2ba6616d0f0a')
|
||||
|
||||
Get an in-memory Page preview (useful for generating previews for web
|
||||
interfaces):
|
||||
|
||||
preview = wiki.preview_page("My Page", "# Contents", :markdown)
|
||||
preview.formatted_data
|
||||
# => "<h1>Contents</h1>"
|
||||
|
||||
Methods that write to the repository require a Hash of commit data that takes
|
||||
the following form:
|
||||
|
||||
commit = { :message => 'commit message',
|
||||
:name => 'Tom Preston-Werner',
|
||||
:email => 'tom@github.com' }
|
||||
|
||||
Write a new version of a page (the file will be created if it does not already
|
||||
exist) and commit the change. The file will be written at the repo root.
|
||||
|
||||
wiki.write_page('Page Name', :markdown, 'Page contents', commit)
|
||||
|
||||
Update an existing page. If the format is different than the page's current
|
||||
format, the file name will be changed to reflect the new format.
|
||||
|
||||
page = wiki.page('Page Name')
|
||||
wiki.update_page(page, page.name, page.format, 'Page contents', commit)
|
||||
|
||||
To delete a page and commit the change:
|
||||
|
||||
wiki.delete_page(page, commit)
|
||||
|
||||
### RACK
|
||||
|
||||
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.
|
||||
|
||||
#!/usr/bin/env ruby
|
||||
require 'rubygems'
|
||||
require 'gollum/frontend/app'
|
||||
|
||||
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
|
||||
run Precious::App
|
||||
|
||||
## Testing
|
||||
|
||||
[](http://travis-ci.org/github/gollum)
|
||||
|
||||
## CONTRIBUTE
|
||||
|
||||
If you'd like to hack on Gollum, start by forking my repo on GitHub:
|
||||
|
||||
http://github.com/github/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 github/gollum project.
|
||||
|
||||
## RELEASING
|
||||
|
||||
$ rake gemspec
|
||||
$ gem build gollum.gemspec
|
||||
$ gem push gollum-X.Y.Z.gem
|
||||
Please consider helping out! See [CONTRIBUTING](CONTRIBUTING.md) for information on how to submit issues, and how to start hacking on gollum.
|
||||
|
||||
@@ -17,6 +17,27 @@ def version
|
||||
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
||||
end
|
||||
|
||||
# assumes x.y.z all digit version
|
||||
def next_version
|
||||
# x.y.z
|
||||
v = version.split '.'
|
||||
# bump z
|
||||
v[-1] = v[-1].to_i + 1
|
||||
v.join '.'
|
||||
end
|
||||
|
||||
def bump_version
|
||||
old_file = File.read("lib/#{name}.rb")
|
||||
old_version_line = old_file[/^\s*VERSION\s*=\s*.*/]
|
||||
new_version = next_version
|
||||
# replace first match of old vesion with new version
|
||||
old_file.sub!(old_version_line, " VERSION = '#{new_version}'")
|
||||
|
||||
File.write("lib/#{name}.rb", old_file)
|
||||
|
||||
new_version
|
||||
end
|
||||
|
||||
def date
|
||||
Date.today.to_s
|
||||
end
|
||||
@@ -50,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"
|
||||
@@ -71,7 +93,14 @@ end
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
|
||||
desc "Update version number and gemspec"
|
||||
task :bump do
|
||||
puts "Updated version to #{bump_version}"
|
||||
# Execute does not invoke dependencies.
|
||||
# Manually invoke gemspec then validate.
|
||||
Rake::Task[:gemspec].execute
|
||||
Rake::Task[:validate].execute
|
||||
end
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
@@ -79,19 +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 --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"
|
||||
@@ -99,7 +132,12 @@ task :build => :gemspec do
|
||||
sh "mv #{gem_file} pkg"
|
||||
end
|
||||
|
||||
desc 'Validate gemspec'
|
||||
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
|
||||
spec = File.read(gemspec_file)
|
||||
@@ -117,7 +155,7 @@ task :gemspec => :validate do
|
||||
split("\n").
|
||||
sort.
|
||||
reject { |file| file =~ /^\./ }.
|
||||
reject { |file| file =~ /^(rdoc|pkg)/ }.
|
||||
reject { |file| file =~ /^(rdoc|pkg|test|Home\.md|\.gitattributes)/ }.
|
||||
map { |file| " #{file}" }.
|
||||
join("\n")
|
||||
|
||||
@@ -139,4 +177,22 @@ task :validate do
|
||||
puts "A `VERSION` file at root level violates Gem best practices."
|
||||
exit!
|
||||
end
|
||||
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
|
||||
|
||||
+216
-49
@@ -2,70 +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.') do |path|
|
||||
wiki_options[:template_dir] = path
|
||||
end
|
||||
opts.on('--template-page', 'Use _Template in root 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("--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("--ref [REF]", "Specify the repository ref to use (default: master).") do |ref|
|
||||
wiki_options[:ref] = ref
|
||||
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 = 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:
|
||||
@@ -91,36 +238,56 @@ if options['irb']
|
||||
end
|
||||
|
||||
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/frontend/app'
|
||||
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)
|
||||
Precious::App.settings.mustache[:templates] = wiki_options[:template_dir] if wiki_options[:template_dir]
|
||||
|
||||
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
|
||||
require cfg
|
||||
end
|
||||
|
||||
Precious::App.run!(options)
|
||||
base_path = wiki_options[:base_path]
|
||||
|
||||
if base_path.nil?
|
||||
Precious::App.run!(options)
|
||||
else
|
||||
require 'rack'
|
||||
|
||||
# Rack::Handler does not work with Ctrl + C. Use Rack::Server instead.
|
||||
Rack::Server.new(:app => Precious::MapGollum.new(base_path), :Port => options[:port], :Host => options[:bind]).start
|
||||
end
|
||||
end
|
||||
|
||||
Executable
+271
@@ -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
|
||||
@@ -0,0 +1,11 @@
|
||||
=begin
|
||||
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,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
|
||||
Executable
+79
@@ -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
|
||||
@@ -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
|
||||
+1204
-193
File diff suppressed because it is too large
Load Diff
+8
-17
@@ -1,33 +1,25 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
# stdlib
|
||||
require 'digest/md5'
|
||||
require 'digest/sha1'
|
||||
require 'ostruct'
|
||||
|
||||
# external
|
||||
require 'grit'
|
||||
require 'github/markup'
|
||||
require 'sanitize'
|
||||
require 'rhino' if RUBY_PLATFORM == 'java'
|
||||
|
||||
# internal
|
||||
require File.expand_path('../gollum/git_access', __FILE__)
|
||||
require File.expand_path('../gollum/committer', __FILE__)
|
||||
require File.expand_path('../gollum/pagination', __FILE__)
|
||||
require File.expand_path('../gollum/blob_entry', __FILE__)
|
||||
require File.expand_path('../gollum/wiki', __FILE__)
|
||||
require File.expand_path('../gollum/page', __FILE__)
|
||||
require File.expand_path('../gollum/file', __FILE__)
|
||||
require File.expand_path('../gollum/markup', __FILE__)
|
||||
require File.expand_path('../gollum/sanitization', __FILE__)
|
||||
require File.expand_path('../gollum/tex', __FILE__)
|
||||
require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
|
||||
require File.expand_path('../gollum/uri_encode_component', __FILE__)
|
||||
|
||||
module Gollum
|
||||
VERSION = '2.0.0'
|
||||
VERSION = '5.1.1'
|
||||
|
||||
def self.assets_path
|
||||
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
||||
::File.expand_path('gollum/public', ::File.dirname(__FILE__))
|
||||
end
|
||||
|
||||
class Error < StandardError; end
|
||||
class Error < StandardError;
|
||||
end
|
||||
|
||||
class DuplicatePageError < Error
|
||||
attr_accessor :dir
|
||||
@@ -42,4 +34,3 @@ module Gollum
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,687 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
require 'cgi'
|
||||
require 'sinatra'
|
||||
require 'sinatra/namespace'
|
||||
require 'gollum-lib'
|
||||
require 'mustache/sinatra'
|
||||
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/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 File.expand_path '../helpers', __FILE__
|
||||
|
||||
#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
|
||||
#
|
||||
# There are a number of wiki options that can be set for the frontend
|
||||
#
|
||||
# Example
|
||||
# require 'gollum/app'
|
||||
# Precious::App.set(:wiki_options, {
|
||||
# :universal_toc => false,
|
||||
# }
|
||||
#
|
||||
# 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
|
||||
|
||||
dir = File.dirname(File.expand_path(__FILE__))
|
||||
|
||||
set :sprockets, ::Precious::Assets.sprockets(dir)
|
||||
|
||||
set :default_markup, :markdown
|
||||
|
||||
set :mustache, {
|
||||
# Tell mustache where the Views constant lives
|
||||
:namespace => Precious,
|
||||
|
||||
# Mustache templates live here
|
||||
:templates => "#{dir}/templates",
|
||||
|
||||
# Tell mustache where the views are
|
||||
:views => "#{dir}/views"
|
||||
}
|
||||
|
||||
# Sinatra error handling
|
||||
configure :development, :staging do
|
||||
enable :show_exceptions, :dump_errors
|
||||
disable :raise_errors, :clean_trace
|
||||
end
|
||||
|
||||
configure :test do
|
||||
enable :logging, :raise_errors, :dump_errors
|
||||
end
|
||||
|
||||
before do
|
||||
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'
|
||||
Precious::App.set(:mustache, {:templates => settings.wiki_options[:template_dir]}) if settings.wiki_options[:template_dir]
|
||||
|
||||
@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]
|
||||
@mathjax_config = settings.wiki_options[:mathjax_config]
|
||||
|
||||
@use_static_assets = settings.wiki_options.fetch(:static, settings.environment == :production || settings.environment == :staging)
|
||||
@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
|
||||
redirect clean_url(::File.join(@base_url, wiki_new.index_page))
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
get '/assets/mathjax/*' do
|
||||
env['PATH_INFO'].sub!('/gollum/assets/mathjax', '')
|
||||
Rack::Static.new(not_found_proc, {:root => @mathjax_path, :urls => ['']}).call(env)
|
||||
end
|
||||
|
||||
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
|
||||
settings.sprockets.call(env)
|
||||
end
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
committer.commit
|
||||
|
||||
# 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)) if @redirects_enabled
|
||||
|
||||
page = wiki_page(new_path).page
|
||||
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]))}"
|
||||
page_name = CGI.unescape(params[:page])
|
||||
wiki = wiki_new
|
||||
page = wiki.page(::File.join(path, page_name))
|
||||
|
||||
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
|
||||
|
||||
committer = Gollum::Committer.new(wiki, commit_message)
|
||||
commit = { :committer => committer }
|
||||
|
||||
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
|
||||
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
get '/create/*' do
|
||||
forbid unless @allow_editing
|
||||
if settings.wiki_options[:template_page] then
|
||||
temppage = wiki_page('/_Template')
|
||||
@template_page = (temppage.page != nil) ? temppage.page.raw_data : 'Template page option is set, but no /_Template page is present or committed.'
|
||||
if defined?(Gollum::TemplateFilter)
|
||||
@template_page = Gollum::TemplateFilter.filter(@template_page)
|
||||
end
|
||||
end
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@name = wikip.name
|
||||
@ext = wikip.ext
|
||||
@path = wikip.path
|
||||
@allow_uploads = wikip.wiki.allow_uploads
|
||||
@upload_dest = find_upload_dest(wikip.fullpath)
|
||||
|
||||
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
|
||||
|
||||
post '/create' do
|
||||
name = params[:page]
|
||||
path = sanitize_empty_params(params[:path]) || ''
|
||||
format = params[:format].intern
|
||||
wiki = wiki_new
|
||||
|
||||
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
|
||||
|
||||
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]
|
||||
|
||||
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
|
||||
|
||||
post '/preview' do
|
||||
wiki = wiki_new
|
||||
@name = params[:page] ? strip_page_name(CGI.unescape(params[:page])) : 'Preview'
|
||||
@page = wiki.preview_page(@name, wiki.normalize(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, version)
|
||||
name = wikip.fullname
|
||||
path = wikip.path
|
||||
if page = wikip.page
|
||||
@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 '/\.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
|
||||
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
|
||||
@allow_uploads = wiki.allow_uploads
|
||||
@navbar = true
|
||||
mustache :page
|
||||
elsif file = wiki.file(fullpath, wiki.ref, true)
|
||||
show_file(file)
|
||||
elsif @redirects_enabled && redirect_path = wiki.redirects[fullpath]
|
||||
redirect to("#{encodeURIComponent(redirect_path)}?redirected_from=#{encodeURIComponent(fullpath)}")
|
||||
else
|
||||
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 update_wiki_page(wiki, page, content, commit, name = nil, format = nil)
|
||||
return if !page ||
|
||||
((!content || page.raw_data == content) && page.format == format)
|
||||
name ||= page.name
|
||||
format = (format || page.format).to_sym
|
||||
content ||= page.raw_data
|
||||
wiki.update_page(page, name, format, content.to_s, commit)
|
||||
end
|
||||
|
||||
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.
|
||||
# :name - The String author full name.
|
||||
# :email - The String email address.
|
||||
# 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 }
|
||||
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,78 +0,0 @@
|
||||
module Gollum
|
||||
class BlobEntry
|
||||
# Gets the String SHA for this blob.
|
||||
attr_reader :sha
|
||||
|
||||
# Gets the full path String for this blob.
|
||||
attr_reader :path
|
||||
|
||||
# Gets the Fixnum size of this blob.
|
||||
attr_reader :size
|
||||
|
||||
def initialize(sha, path, size = nil)
|
||||
@sha = sha
|
||||
@path = path
|
||||
@size = size
|
||||
@dir = @name = @blob = nil
|
||||
end
|
||||
|
||||
# Gets the normalized directory path String for this blob.
|
||||
def dir
|
||||
@dir ||= self.class.normalize_dir(::File.dirname(@path))
|
||||
end
|
||||
|
||||
# Gets the file base name String for this blob.
|
||||
def name
|
||||
@name ||= ::File.basename(@path)
|
||||
end
|
||||
|
||||
# Gets a Grit::Blob instance for this blob.
|
||||
#
|
||||
# repo - Grit::Repo instance for the Grit::Blob.
|
||||
#
|
||||
# Returns an unbaked Grit::Blob instance.
|
||||
def blob(repo)
|
||||
@blob ||= Grit::Blob.create(repo,
|
||||
:id => @sha, :name => name, :size => @size)
|
||||
end
|
||||
|
||||
# Gets a Page instance for this blob.
|
||||
#
|
||||
# wiki - Gollum::Wiki instance for the Gollum::Page
|
||||
#
|
||||
# Returns a Gollum::Page instance.
|
||||
def page(wiki, commit)
|
||||
blob = self.blob(wiki.repo)
|
||||
page = wiki.page_class.new(wiki).populate(blob, self.dir)
|
||||
page.version = commit
|
||||
page
|
||||
end
|
||||
|
||||
def inspect
|
||||
%(#<Gollum::BlobEntry #{@sha} #{@path}>)
|
||||
end
|
||||
|
||||
# Normalizes a given directory name for searching through tree paths.
|
||||
# Ensures that a directory begins with a slash, or
|
||||
#
|
||||
# normalize_dir("") # => ""
|
||||
# normalize_dir(".") # => ""
|
||||
# normalize_dir("foo") # => "/foo"
|
||||
# normalize_dir("/foo/") # => "/foo"
|
||||
# normalize_dir("/") # => ""
|
||||
# normalize_dir("c:/") # => ""
|
||||
#
|
||||
# dir - String directory name.
|
||||
#
|
||||
# Returns a normalized String directory name, or nil if no directory
|
||||
# is given.
|
||||
def self.normalize_dir(dir)
|
||||
return '' if dir =~ /^.:\/$/
|
||||
if dir
|
||||
dir = ::File.expand_path(dir, '/')
|
||||
dir = '' if dir == '/'
|
||||
end
|
||||
dir
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,218 +0,0 @@
|
||||
module Gollum
|
||||
# Responsible for handling the commit process for a Wiki. It sets up the
|
||||
# Git index, provides methods for modifying the tree, and stores callbacks
|
||||
# to be fired after the commit has been made. This is specifically
|
||||
# designed to handle multiple updated pages in a single commit.
|
||||
class Committer
|
||||
# Gets the instance of the Gollum::Wiki that is being updated.
|
||||
attr_reader :wiki
|
||||
|
||||
# Gets a Hash of commit options.
|
||||
attr_reader :options
|
||||
|
||||
# Initializes the Committer.
|
||||
#
|
||||
# wiki - The Gollum::Wiki instance that is being updated.
|
||||
# options - The commit Hash details:
|
||||
# :message - The String commit message.
|
||||
# :name - The String author full name.
|
||||
# :email - The String email address.
|
||||
# :parent - Optional Grit::Commit parent to this update.
|
||||
# :tree - Optional String SHA of the tree to create the
|
||||
# index from.
|
||||
# :committer - Optional Gollum::Committer instance. If provided,
|
||||
# assume that this operation is part of batch of
|
||||
# updates and the commit happens later.
|
||||
#
|
||||
# Returns the Committer instance.
|
||||
def initialize(wiki, options = {})
|
||||
@wiki = wiki
|
||||
@options = options
|
||||
@callbacks = []
|
||||
end
|
||||
|
||||
# Public: References the Git index for this commit.
|
||||
#
|
||||
# Returns a Grit::Index.
|
||||
def index
|
||||
@index ||= begin
|
||||
idx = @wiki.repo.index
|
||||
if tree = options[:tree]
|
||||
idx.read_tree(tree)
|
||||
elsif parent = parents.first
|
||||
idx.read_tree(parent.tree.id)
|
||||
end
|
||||
idx
|
||||
end
|
||||
end
|
||||
|
||||
# Public: The committer for this commit.
|
||||
#
|
||||
# Returns a Grit::Actor.
|
||||
def actor
|
||||
@actor ||= begin
|
||||
@options[:name] = @wiki.default_committer_name if @options[:name].to_s.empty?
|
||||
@options[:email] = @wiki.default_committer_email if @options[:email].to_s.empty?
|
||||
Grit::Actor.new(@options[:name], @options[:email])
|
||||
end
|
||||
end
|
||||
|
||||
# Public: The parent commits to this pending commit.
|
||||
#
|
||||
# Returns an array of Grit::Commit instances.
|
||||
def parents
|
||||
@parents ||= begin
|
||||
arr = [@options[:parent] || @wiki.repo.commit(@wiki.ref)]
|
||||
arr.flatten!
|
||||
arr.compact!
|
||||
arr
|
||||
end
|
||||
end
|
||||
|
||||
# Adds a page to the given Index.
|
||||
#
|
||||
# dir - The String subdirectory of the Gollum::Page without any
|
||||
# prefix or suffix slashes (e.g. "foo/bar").
|
||||
# name - The String Gollum::Page filename_stripped.
|
||||
# format - The Symbol Gollum::Page format.
|
||||
# data - The String wiki data to store in the tree map.
|
||||
# allow_same_ext - A Boolean determining if the tree map allows the same
|
||||
# filename with the same extension.
|
||||
#
|
||||
# Raises Gollum::DuplicatePageError if a matching filename already exists.
|
||||
# This way, pages are not inadvertently overwritten.
|
||||
#
|
||||
# Returns nothing (modifies the Index in place).
|
||||
def add_to_index(dir, name, format, data, allow_same_ext = false)
|
||||
path = @wiki.page_file_name(name, format)
|
||||
|
||||
dir = '/' if dir.strip.empty?
|
||||
|
||||
fullpath = ::File.join(*[@wiki.page_file_dir, dir, path].compact)
|
||||
fullpath = fullpath[1..-1] if fullpath =~ /^\//
|
||||
|
||||
if index.current_tree && tree = index.current_tree / dir
|
||||
downpath = path.downcase.sub(/\.\w+$/, '')
|
||||
|
||||
tree.blobs.each do |blob|
|
||||
next if page_path_scheduled_for_deletion?(index.tree, fullpath)
|
||||
file = blob.name.downcase.sub(/\.\w+$/, '')
|
||||
file_ext = ::File.extname(blob.name).sub(/^\./, '')
|
||||
if downpath == file && !(allow_same_ext && file_ext == ext)
|
||||
raise DuplicatePageError.new(dir, blob.name, path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
index.add(fullpath, @wiki.normalize(data))
|
||||
end
|
||||
|
||||
# Update the given file in the repository's working directory if there
|
||||
# is a working directory present.
|
||||
#
|
||||
# dir - The String directory in which the file lives.
|
||||
# name - The String name of the page or the stripped filename
|
||||
# (should be pre-canonicalized if required).
|
||||
# format - The Symbol format of the page.
|
||||
#
|
||||
# Returns nothing.
|
||||
def update_working_dir(dir, name, format)
|
||||
unless @wiki.repo.bare
|
||||
if @wiki.page_file_dir
|
||||
dir = dir.size.zero? ? @wiki.page_file_dir : ::File.join(dir, @wiki.page_file_dir)
|
||||
end
|
||||
|
||||
path =
|
||||
if dir == ''
|
||||
@wiki.page_file_name(name, format)
|
||||
else
|
||||
::File.join(dir, @wiki.page_file_name(name, format))
|
||||
end
|
||||
|
||||
Dir.chdir(::File.join(@wiki.repo.path, '..')) do
|
||||
if file_path_scheduled_for_deletion?(index.tree, path)
|
||||
@wiki.repo.git.rm({'f' => true}, '--', path)
|
||||
else
|
||||
@wiki.repo.git.checkout({}, 'HEAD', '--', path)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Writes the commit to Git and runs the after_commit callbacks.
|
||||
#
|
||||
# Returns the String SHA1 of the new commit.
|
||||
def commit
|
||||
sha1 = index.commit(@options[:message], parents, actor, nil, @wiki.ref)
|
||||
@callbacks.each do |cb|
|
||||
cb.call(self, sha1)
|
||||
end
|
||||
sha1
|
||||
end
|
||||
|
||||
# Adds a callback to be fired after a commit.
|
||||
#
|
||||
# block - A block that expects this Committer instance and the created
|
||||
# commit's SHA1 as the arguments.
|
||||
#
|
||||
# Returns nothing.
|
||||
def after_commit(&block)
|
||||
@callbacks << block
|
||||
end
|
||||
|
||||
# Determine if a given page (regardless of format) is scheduled to be
|
||||
# deleted in the next commit for the given Index.
|
||||
#
|
||||
# map - The Hash map:
|
||||
# key - The String directory or filename.
|
||||
# val - The Hash submap or the String contents of the file.
|
||||
# path - The String path of the page file. This may include the format
|
||||
# extension in which case it will be ignored.
|
||||
#
|
||||
# Returns the Boolean response.
|
||||
def page_path_scheduled_for_deletion?(map, path)
|
||||
parts = path.split('/')
|
||||
if parts.size == 1
|
||||
deletions = map.keys.select { |k| !map[k] }
|
||||
downfile = parts.first.downcase.sub(/\.\w+$/, '')
|
||||
deletions.any? { |d| d.downcase.sub(/\.\w+$/, '') == downfile }
|
||||
else
|
||||
part = parts.shift
|
||||
if rest = map[part]
|
||||
page_path_scheduled_for_deletion?(rest, parts.join('/'))
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Determine if a given file is scheduled to be deleted in the next commit
|
||||
# for the given Index.
|
||||
#
|
||||
# map - The Hash map:
|
||||
# key - The String directory or filename.
|
||||
# val - The Hash submap or the String contents of the file.
|
||||
# path - The String path of the file including extension.
|
||||
#
|
||||
# Returns the Boolean response.
|
||||
def file_path_scheduled_for_deletion?(map, path)
|
||||
parts = path.split('/')
|
||||
if parts.size == 1
|
||||
deletions = map.keys.select { |k| !map[k] }
|
||||
deletions.any? { |d| d == parts.first }
|
||||
else
|
||||
part = parts.shift
|
||||
if rest = map[part]
|
||||
file_path_scheduled_for_deletion?(rest, parts.join('/'))
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Proxies methods t
|
||||
def method_missing(name, *args)
|
||||
index.send(name, *args)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,64 +0,0 @@
|
||||
module Gollum
|
||||
class File
|
||||
Wiki.file_class = self
|
||||
|
||||
# Public: Initialize a file.
|
||||
#
|
||||
# wiki - The Gollum::Wiki in question.
|
||||
#
|
||||
# Returns a newly initialized Gollum::File.
|
||||
def initialize(wiki)
|
||||
@wiki = wiki
|
||||
@blob = nil
|
||||
@path = nil
|
||||
end
|
||||
|
||||
# Public: The on-disk filename of the file.
|
||||
#
|
||||
# Returns the String name.
|
||||
def name
|
||||
@blob && @blob.name
|
||||
end
|
||||
|
||||
# Public: The raw contents of the page.
|
||||
#
|
||||
# Returns the String data.
|
||||
def raw_data
|
||||
@blob && @blob.data
|
||||
end
|
||||
|
||||
# Public: The Grit::Commit version of the file.
|
||||
attr_reader :version
|
||||
|
||||
# Public: The String path of the file.
|
||||
attr_reader :path
|
||||
|
||||
# Public: The String mime type of the file.
|
||||
def mime_type
|
||||
@blob.mime_type
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# Internal Methods
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
# Find a file in the given Gollum repo.
|
||||
#
|
||||
# name - The full String path.
|
||||
# version - The String version ID to find.
|
||||
#
|
||||
# Returns a Gollum::File or nil if the file could not be found.
|
||||
def find(name, version)
|
||||
checked = name.downcase
|
||||
map = @wiki.tree_map_for(version)
|
||||
if entry = map.detect { |entry| entry.path.downcase == checked }
|
||||
@path = name
|
||||
@blob = entry.blob(@wiki.repo)
|
||||
@version = version.is_a?(Grit::Commit) ? version : @wiki.commit_for(version)
|
||||
self
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,222 +0,0 @@
|
||||
require 'cgi'
|
||||
require 'sinatra'
|
||||
require 'gollum'
|
||||
require 'mustache/sinatra'
|
||||
|
||||
require 'gollum/frontend/views/layout'
|
||||
require 'gollum/frontend/views/editable'
|
||||
|
||||
module Precious
|
||||
class App < Sinatra::Base
|
||||
register Mustache::Sinatra
|
||||
|
||||
dir = File.dirname(File.expand_path(__FILE__))
|
||||
|
||||
# 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,
|
||||
|
||||
# Mustache templates live here
|
||||
:templates => "#{dir}/templates",
|
||||
|
||||
# Tell mustache where the views are
|
||||
:views => "#{dir}/views"
|
||||
}
|
||||
|
||||
# Sinatra error handling
|
||||
configure :development, :staging do
|
||||
enable :show_exceptions, :dump_errors
|
||||
disable :raise_errors, :clean_trace
|
||||
end
|
||||
|
||||
configure :test do
|
||||
enable :logging, :raise_errors, :dump_errors
|
||||
end
|
||||
|
||||
get '/' do
|
||||
show_page_or_file('Home')
|
||||
end
|
||||
|
||||
get '/edit/*' do
|
||||
@name = params[:splat].first
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
if page = wiki.page(@name)
|
||||
@page = page
|
||||
@page.version = wiki.repo.log(wiki.ref, @page.path).first
|
||||
@content = page.raw_data
|
||||
mustache :edit
|
||||
else
|
||||
mustache :create
|
||||
end
|
||||
end
|
||||
|
||||
post '/edit/*' do
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
page = wiki.page(params[:splat].first)
|
||||
name = params[:rename] || page.name
|
||||
committer = Gollum::Committer.new(wiki, commit_message)
|
||||
commit = {:committer => committer}
|
||||
|
||||
update_wiki_page(wiki, page, params[:content], commit, name,
|
||||
params[:format])
|
||||
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
|
||||
|
||||
redirect "/#{CGI.escape(Gollum::Page.cname(name))}"
|
||||
end
|
||||
|
||||
post '/create' do
|
||||
name = params[:page]
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
|
||||
format = params[:format].intern
|
||||
|
||||
begin
|
||||
wiki.write_page(name, format, params[:content], commit_message)
|
||||
redirect "/#{CGI.escape(Gollum::Page.cname(name))}"
|
||||
rescue Gollum::DuplicatePageError => e
|
||||
@message = "Duplicate page: #{e.message}"
|
||||
mustache :error
|
||||
end
|
||||
end
|
||||
|
||||
post '/revert/:page/*' do
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
@name = params[:page]
|
||||
@page = wiki.page(@name)
|
||||
shas = params[:splat].first.split("/")
|
||||
sha1 = shas.shift
|
||||
sha2 = shas.shift
|
||||
|
||||
if wiki.revert_page(@page, sha1, sha2, commit_message)
|
||||
redirect "/#{CGI.escape(@name)}"
|
||||
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
|
||||
end
|
||||
end
|
||||
|
||||
post '/preview' do
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
@name = "Preview"
|
||||
@page = wiki.preview_page(@name, params[:content], params[:format])
|
||||
@content = @page.formatted_data
|
||||
@editable = false
|
||||
mustache :page
|
||||
end
|
||||
|
||||
get '/history/:name' do
|
||||
@name = params[:name]
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
@page = wiki.page(@name)
|
||||
@page_num = [params[:page].to_i, 1].max
|
||||
@versions = @page.versions :page => @page_num
|
||||
mustache :history
|
||||
end
|
||||
|
||||
post '/compare/:name' do
|
||||
@versions = params[:versions] || []
|
||||
if @versions.size < 2
|
||||
redirect "/history/#{CGI.escape(params[:name])}"
|
||||
else
|
||||
redirect "/compare/%s/%s...%s" % [
|
||||
CGI.escape(params[:name]),
|
||||
@versions.last,
|
||||
@versions.first]
|
||||
end
|
||||
end
|
||||
|
||||
get '/compare/:name/:version_list' do
|
||||
@name = params[:name]
|
||||
@versions = params[:version_list].split(/\.{2,3}/)
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
@page = wiki.page(@name)
|
||||
diffs = wiki.repo.diff(@versions.first, @versions.last, @page.path)
|
||||
@diff = diffs.first
|
||||
mustache :compare
|
||||
end
|
||||
|
||||
get '/_tex.png' do
|
||||
content_type 'image/png'
|
||||
formula = Base64.decode64(params[:data])
|
||||
Gollum::Tex.render_formula(formula)
|
||||
end
|
||||
|
||||
get %r{^/(javascript|css|images)} do
|
||||
halt 404
|
||||
end
|
||||
|
||||
get %r{/(.+?)/([0-9a-f]{40})} do
|
||||
name = params[:captures][0]
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
if page = wiki.page(name, params[:captures][1])
|
||||
@page = page
|
||||
@name = name
|
||||
@content = page.formatted_data
|
||||
@editable = true
|
||||
mustache :page
|
||||
else
|
||||
halt 404
|
||||
end
|
||||
end
|
||||
|
||||
get '/search' do
|
||||
@query = params[:q]
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
@results = wiki.search @query
|
||||
@name = @query
|
||||
mustache :search
|
||||
end
|
||||
|
||||
get '/pages' do
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
@results = wiki.pages
|
||||
@ref = wiki.ref
|
||||
mustache :pages
|
||||
end
|
||||
|
||||
get '/*' do
|
||||
show_page_or_file(params[:splat].first)
|
||||
end
|
||||
|
||||
def show_page_or_file(name)
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
if page = wiki.page(name)
|
||||
@page = page
|
||||
@name = name
|
||||
@content = page.formatted_data
|
||||
@editable = true
|
||||
mustache :page
|
||||
elsif file = wiki.file(name)
|
||||
content_type file.mime_type
|
||||
file.raw_data
|
||||
else
|
||||
@name = name
|
||||
mustache :create
|
||||
end
|
||||
end
|
||||
|
||||
def update_wiki_page(wiki, page, content, commit_message, name = nil, format = nil)
|
||||
return if !page ||
|
||||
((!content || page.raw_data == content) && page.format == format)
|
||||
name ||= page.name
|
||||
format = (format || page.format).to_sym
|
||||
content ||= page.raw_data
|
||||
wiki.update_page(page, name, format, content.to_s, commit_message)
|
||||
end
|
||||
|
||||
def commit_message
|
||||
{ :message => params[:message] }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,141 +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: 96.5%;
|
||||
}
|
||||
|
||||
#gollum-dialog-dialog-body fieldset .field input.code {
|
||||
font-family: 'Monaco', 'Courier New', Courier, monospace;
|
||||
}
|
||||
|
||||
#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,530 +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-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#gollum-editor-body {
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
font-size: 1em;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
line-height: 1.4em;
|
||||
margin: 1em 0 0.4em;
|
||||
padding: 0.5em; /* I don't really like mixing pct & em here… */
|
||||
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: 1em 0 0.5em;
|
||||
}
|
||||
|
||||
#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.4em 0 0 0.3em;
|
||||
text-shadow: 0 -1px 0 #fff;
|
||||
}
|
||||
|
||||
#gollum-editor .collapsed a.button:hover,
|
||||
#gollum-editor .expanded h4 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: 1.3em;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
height: 7em;
|
||||
line-height: 1.8em;
|
||||
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,678 +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: 80%;
|
||||
}
|
||||
|
||||
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: 4.5em 0 0.5em;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#head h1 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#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 */
|
||||
#wiki-body {
|
||||
display: block;
|
||||
float: left;
|
||||
margin-right: 3%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.has-rightbar #wiki-body {
|
||||
width: 68%;
|
||||
}
|
||||
|
||||
/* @section rightbar */
|
||||
#wiki-rightbar {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #ddd;
|
||||
font-size: 13px;
|
||||
float: right;
|
||||
padding: 7px;
|
||||
width: 25%;
|
||||
|
||||
border-radius: 0.5em;
|
||||
-moz-border-radius: 0.5em;
|
||||
-webkit-border-radius: 0.5em;
|
||||
}
|
||||
|
||||
#wiki-rightbar p {
|
||||
margin: 13px 0 0;
|
||||
}
|
||||
|
||||
#wiki-rightbar > p:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#wiki-rightbar 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-rightbar p.parent:before {
|
||||
color: #666;
|
||||
content: "← ";
|
||||
}
|
||||
|
||||
#wiki-rightbar h3 {
|
||||
font-size: 1.2em;
|
||||
color: #333;
|
||||
margin: 1.2em 0 0;
|
||||
padding: 0;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
#wiki-rightbar ul {
|
||||
margin: 0.5em 0 1em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#wiki-rightbar ul li {
|
||||
color: #bbb;
|
||||
margin: 0 0 0 1em;
|
||||
padding: 0;
|
||||
line-height: 1.75em;
|
||||
list-style-position: inside;
|
||||
list-style-type: round;
|
||||
}
|
||||
|
||||
#wiki-rightbar #nav ul li a {
|
||||
font-weight: bold;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
/* @section footer */
|
||||
|
||||
#wiki-footer {
|
||||
clear: both;
|
||||
margin: 2em 0 5em;
|
||||
}
|
||||
|
||||
.has-rightbar #wiki-footer {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
#wiki-footer #footer-content {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #ddd;
|
||||
font-size: 1.2em;
|
||||
line-height: 1.5em;
|
||||
margin-top: 1.5em;
|
||||
padding: 1em;
|
||||
|
||||
border-radius: 0.5em;
|
||||
-moz-border-radius: 0.5em;
|
||||
-webkit-border-radius: 0.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 {
|
||||
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;
|
||||
}
|
||||
@@ -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,382 +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;
|
||||
}
|
||||
|
||||
#template {
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
/* Link Colors */
|
||||
a.absent {
|
||||
color: #c00;
|
||||
}
|
||||
|
||||
/* Primary Body Copy */
|
||||
#template p {
|
||||
margin: 1.4em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* ReST first graf in nested list */
|
||||
#template * li p.first {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Headings */
|
||||
#template h1, #template h2, #template h3,
|
||||
#template h4, #template h5, #template h6 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#template h1 {
|
||||
font-size: 28px;
|
||||
line-height: normal;
|
||||
padding: 10px 0 0 0;
|
||||
margin: 30px 0 10px;
|
||||
}
|
||||
|
||||
#template h2 {
|
||||
border-bottom: 1px solid #ddd;
|
||||
font-size: 22px;
|
||||
line-height: 1.6;
|
||||
margin: 22px 0 10px;
|
||||
padding: 7px 0 0;
|
||||
}
|
||||
|
||||
#template h3 {
|
||||
font-size: 16px;
|
||||
line-height: 26px;
|
||||
padding: 26px 0 0;
|
||||
}
|
||||
|
||||
#template h4 {
|
||||
font-size: 14px;
|
||||
line-height: 26px;
|
||||
padding: 18px 0 4px;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
#template h5 {
|
||||
font-size: 13px;
|
||||
line-height: 26px;
|
||||
margin-bottom: -19px;
|
||||
padding: 14px 0 0;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
#template h6 {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
line-height: 26px;
|
||||
margin-bottom: -19px;
|
||||
padding: 18px 0 0;
|
||||
font-weight: normal;
|
||||
font-variant: italic;
|
||||
}
|
||||
|
||||
#template hr {
|
||||
background-color: #ccc;
|
||||
color: #ccc;
|
||||
border: 2px solid #ccc;
|
||||
margin: 20px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Border Reset for headers with horizontal rules */
|
||||
#template > h2:first-child,
|
||||
#template > h1:first-child {
|
||||
margin: 12px 0 10px;
|
||||
padding: 10px 0 10px;
|
||||
}
|
||||
|
||||
|
||||
/* Lists, Blockquotes & Such */
|
||||
#template ul,
|
||||
#template ol {
|
||||
margin: 15px 0;
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
/* Nested Lists */
|
||||
#template ul li,
|
||||
#template ol li,
|
||||
#template ul li ul,
|
||||
#template ol li ol,
|
||||
#template ul li ol,
|
||||
#template ol li ul,
|
||||
#template ul ul,
|
||||
#template ol ol {
|
||||
padding: 0;
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
#template dl {
|
||||
margin: 0;
|
||||
padding: 20px 0 0;
|
||||
}
|
||||
|
||||
#template dl dt {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
line-height: normal;
|
||||
margin: 0;
|
||||
padding: 20px 0 0;
|
||||
}
|
||||
|
||||
#template dl dt:first-child {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#template dl dd {
|
||||
font-size: 13px;
|
||||
margin: 0;
|
||||
padding: 3px 0 0;
|
||||
}
|
||||
|
||||
/* Tables */
|
||||
#template table {
|
||||
border-collapse: collapse;
|
||||
margin: 20px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#template table * tr {
|
||||
border-top: 1px solid #ccc;
|
||||
background-color: #fff;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#template table * tr:nth-child(2n) {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
#template table * tr th,
|
||||
#template table * tr td {
|
||||
border: 1px solid #ccc;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
padding: 6px 13px;
|
||||
}
|
||||
|
||||
/* Images & Stuff */
|
||||
#template img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Gollum Image Tags */
|
||||
|
||||
/* Framed */
|
||||
#template span.frame {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#template span.frame > span {
|
||||
border: 1px solid #ddd;
|
||||
display: block;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
margin: 13px 0 0;
|
||||
padding: 7px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#template span.frame span img {
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#template span.frame span span {
|
||||
clear: both;
|
||||
color: #333;
|
||||
display: block;
|
||||
padding: 5px 0 0;
|
||||
}
|
||||
|
||||
#template span.align-center {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#template span.align-center > span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px auto 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#template span.align-center span img {
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#template span.align-right {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#template span.align-right > span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px 0 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#template span.align-right span img {
|
||||
margin: 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#template span.float-left {
|
||||
display: block;
|
||||
margin-right: 13px;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#template span.float-left span {
|
||||
margin: 13px 0 0;
|
||||
}
|
||||
|
||||
#template span.float-right {
|
||||
display: block;
|
||||
margin-left: 13px;
|
||||
overflow: hidden;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#template span.float-right > span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px auto 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
/* Code */
|
||||
#template code, #template tt {
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #dedede;
|
||||
font-size: 13px;
|
||||
padding: 1px 5px;
|
||||
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#template .highlight pre, #template pre {
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #ccc;
|
||||
font-size: 13px;
|
||||
line-height: 19px;
|
||||
overflow: auto;
|
||||
padding: 6px 10px;
|
||||
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
pre, code {
|
||||
font: 12px 'Bitstream Vera Sans Mono','Courier',monospace
|
||||
}
|
||||
|
||||
#template pre code, #template pre tt {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Highlight rules from pull req 191
|
||||
https://github.com/eboto/gollum/commit/5df09477abf4a04c82c7fcaa2bd7ee2a85e7ec82
|
||||
*/
|
||||
#template .highlight { background:#fff; }
|
||||
#template .highlight .c { color:#998;font-style:italic; }
|
||||
#template .highlight .err { color:#a61717;background-color:#e3d2d2; }
|
||||
#template .highlight .k { font-weight:bold; }
|
||||
#template .highlight .o { font-weight:bold; }
|
||||
#template .highlight .cm { color:#998;font-style:italic; }
|
||||
#template .highlight .cp { color:#999;font-weight:bold; }
|
||||
#template .highlight .c1 { color:#998;font-style:italic; }
|
||||
#template .highlight .cs { color:#999;font-weight:bold;font-style:italic; }
|
||||
#template .highlight .gd { color:#000;background-color:#fdd; }
|
||||
#template .highlight .gd .x { color:#000;background-color:#faa; }
|
||||
#template .highlight .ge { font-style:italic; }
|
||||
#template .highlight .gr { color:#a00; }
|
||||
#template .highlight .gh { color:#999; }
|
||||
#template .highlight .gi { color:#000;background-color:#dfd; }
|
||||
#template .highlight .gi .x { color:#000;background-color:#afa; }
|
||||
#template .highlight .go { color:#888; }
|
||||
#template .highlight .gp { color:#555; }
|
||||
#template .highlight .gs { font-weight:bold; }
|
||||
#template .highlight .gu { color:#800080;font-weight:bold; }
|
||||
#template .highlight .gt { color:#a00; }
|
||||
#template .highlight .kc { font-weight:bold; }
|
||||
#template .highlight .kd { font-weight:bold; }
|
||||
#template .highlight .kp { font-weight:bold; }
|
||||
#template .highlight .kr { font-weight:bold; }
|
||||
#template .highlight .kt { color:#458;font-weight:bold; }
|
||||
#template .highlight .m { color:#099; }
|
||||
#template .highlight .s { color:#d14; }
|
||||
#template .highlight .na { color:#008080; }
|
||||
#template .highlight .nb { color:#0086B3; }
|
||||
#template .highlight .nc { color:#458;font-weight:bold; }
|
||||
#template .highlight .no { color:#008080; }
|
||||
#template .highlight .ni { color:#800080; }
|
||||
#template .highlight .ne { color:#900;font-weight:bold; }
|
||||
#template .highlight .nf { color:#900;font-weight:bold; }
|
||||
#template .highlight .nn { color:#555; }
|
||||
#template .highlight .nt { color:#000080; }
|
||||
#template .highlight .nv { color:#008080; }
|
||||
#template .highlight .ow { font-weight:bold; }
|
||||
#template .highlight .w { color:#bbb; }
|
||||
#template .highlight .mf { color:#099; }
|
||||
#template .highlight .mh { color:#099; }
|
||||
#template .highlight .mi { color:#099; }
|
||||
#template .highlight .mo { color:#099; }
|
||||
#template .highlight .sb { color:#d14; }
|
||||
#template .highlight .sc { color:#d14; }
|
||||
#template .highlight .sd { color:#d14; }
|
||||
#template .highlight .s2 { color:#d14; }
|
||||
#template .highlight .se { color:#d14; }
|
||||
#template .highlight .sh { color:#d14; }
|
||||
#template .highlight .si { color:#d14; }
|
||||
#template .highlight .sx { color:#d14; }
|
||||
#template .highlight .sr { color:#009926; }
|
||||
#template .highlight .s1 { color:#d14; }
|
||||
#template .highlight .ss { color:#990073; }
|
||||
#template .highlight .bp { color:#999; }
|
||||
#template .highlight .vc { color:#008080; }
|
||||
#template .highlight .vg { color:#008080; }
|
||||
#template .highlight .vi { color:#008080; }
|
||||
#template .highlight .il { color:#099; }
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.3 KiB |
@@ -1,167 +0,0 @@
|
||||
/**
|
||||
* ASCIIDoc Language Definition
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var ASCIIDoc = {
|
||||
|
||||
'function-bold' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "*$1*$2"
|
||||
},
|
||||
|
||||
'function-italic' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "_$1_$2"
|
||||
},
|
||||
|
||||
'function-code' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "+$1+$2"
|
||||
},
|
||||
|
||||
'function-ul' : {
|
||||
search: /(^[\n]+)([\n\s]*)/g,
|
||||
replace: "* $1$2"
|
||||
},
|
||||
|
||||
'function-ol' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: ". $1$2"
|
||||
},
|
||||
|
||||
'function-blockquote' : {
|
||||
search: /(.+)([\n]?)/g,
|
||||
replace: "----\n$1$2\n----\n"
|
||||
},
|
||||
|
||||
'function-link' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
$.GollumEditor.Dialog.init({
|
||||
title: 'Insert Link',
|
||||
fields: [
|
||||
{
|
||||
id: 'text',
|
||||
name: 'Link Text',
|
||||
type: 'text',
|
||||
help: 'The text to display to the user.'
|
||||
},
|
||||
{
|
||||
id: 'href',
|
||||
name: 'URL',
|
||||
type: 'text',
|
||||
help: 'The URL to link to.'
|
||||
}
|
||||
],
|
||||
OK: function( res ) {
|
||||
var h = '';
|
||||
if ( res['text'] && res['href'] ) {
|
||||
h = res['href'] + '[' +
|
||||
res['text'] + ']';
|
||||
}
|
||||
$.GollumEditor.replaceSelection( h );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
'function-image' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
$.GollumEditor.Dialog.init({
|
||||
title: 'Insert Image',
|
||||
fields: [
|
||||
{
|
||||
id: 'url',
|
||||
name: 'Image URL',
|
||||
type: 'text'
|
||||
},
|
||||
{
|
||||
id: 'alt',
|
||||
name: 'Alt Text',
|
||||
type: 'text'
|
||||
}
|
||||
],
|
||||
OK: function( res ) {
|
||||
var h = '';
|
||||
if ( res['url'] && res['alt'] ) {
|
||||
h = 'image::' + res['url'] +
|
||||
'[' + res['alt'] + ']';
|
||||
}
|
||||
$.GollumEditor.replaceSelection( h );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.GollumEditor.defineLanguage('asciidoc', ASCIIDoc);
|
||||
|
||||
|
||||
var ASCIIDocHelp = [
|
||||
{
|
||||
menuName: 'Text Formatting',
|
||||
content: [
|
||||
{
|
||||
menuName: 'Headers',
|
||||
data: '<p>ASCIIDoc headers can be written in two ways: with differing underlines or with different indentation using <code>=</code> (equals sign). ASCIIDoc supports headings 1-4. The editor will automatically use the <code>=</code> notation. To create a level one header, prefix your line with one <code>=</code>. Level two headers are created with <code>==</code> and so on.</p>'
|
||||
},
|
||||
{
|
||||
menuName: 'Bold / Italic',
|
||||
data: '<p>To display text as <strong>bold</strong>, wrap the text in <code>*</code> (asterisks). To display text as <em>italic</em>, wrap the text in <code>_</code> (underscores). To create <code>monospace</code> text, wrap the text in <code>+</code> (plus signs).'
|
||||
},
|
||||
{
|
||||
menuName: 'Scripts',
|
||||
data: '<p>Superscript and subscript is created the same way as other inline formats. To create superscript text, wrap your text in <code>^</code> (carats). To create subscript text, wrap your text in <code>~</code> (tildes).</p>'
|
||||
},
|
||||
{
|
||||
menuName: 'Special Characters',
|
||||
data: '<p>ASCIIDoc will automatically convert textual representations of commonly-used special characters. For example, <code>(R)</code> becomes ®, <code>(C)</code> becomes © and <code>(TM)</code> becomes ™.</p>'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
menuName: 'Blocks',
|
||||
content: [
|
||||
{
|
||||
menuName: 'Paragraphs',
|
||||
data: '<p>ASCIIDoc allows paragraphs to have optional titles or icons to denote special sections. To make a normal paragraph, simply add a line between blocks and a new paragraph will start. If you want to title your paragraphs, adda line prefixed by <code>.</code> (full stop). An example paragraph with optional title is displayed below:<br><br><code>.Optional Title<br><br>This is my paragraph. It is two sentences long.</code></p>'
|
||||
},
|
||||
{
|
||||
menuName: 'Source Blocks',
|
||||
data: '<p>To create source blocks (long blocks of code), follow the same syntax as above but with an extra line denoting the inline source and lines of four dashes (<code>----</code>) delimiting the source block.. An example of Python source is below:<br><br><code>.python.py<br>[source,python]<br>----<br># i just wrote a comment in python<br># and maybe one more<br>----</code></p>'
|
||||
},
|
||||
{
|
||||
menuName: 'Comment Blocks',
|
||||
data: '<p>Comment blocks are useful if you want to keep notes for yourself inline but do not want them displayed to the public. To create a comment block, simply wrap the paragraph in dividers with four slashes (<code>////</code>). An example comment block is below:<br><br><code>////<br>My comment block is here now<br><br>It can be multiple paragraphs. Really.<br>////</p>'
|
||||
},
|
||||
{
|
||||
menuName: 'Quote Blocks',
|
||||
data: '<p>Quote blocks work much like comment blocks — simply create dividers using four underscores (<code>____</code>) around your quote. An example quote block is displayed below:<br><code>____<br>This is my quote block. Quote something nice here, otherwise there is no point in quoting.<br>____</code></p>'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
menuName: 'Macros',
|
||||
content: [
|
||||
{
|
||||
menuName: 'Links',
|
||||
data: '<p>To create links to external pages, you can simply write the URI if you want the URI to link to itself. (i.e., <code>http://github.com/</code> will automatically be parsed to <a href="javascript:void(0);">http://github.com/</a>. If you want different text to be displayed, simply append it to the end of the URI in between <code>[</code> (brackets.) For example, <code>http://github.com/[GitHub]</code> will be parsed as <a href="javascript:void(0);">GitHub</a>, with the URI pointing to <code>http://github.com</code>.</p>'
|
||||
},
|
||||
{
|
||||
menuName: 'Images',
|
||||
data: '<p>Images in ASCIIDoc work much like hyperlinks, but image URLs are prefixed with <code>image:</code>. For example, to link to an image at <code>images/icons/home.png</code>, write <code>image:images/icons/home.png</code>. Alt text can be added by appending the text to the URI in <code>[</code> (brackets).</p>'
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
$.GollumEditor.defineHelp('asciidoc', ASCIIDocHelp);
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,104 +0,0 @@
|
||||
/**
|
||||
* Creole Language Definition
|
||||
*
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
var Creole = {
|
||||
|
||||
'function-bold' : {
|
||||
search: /([^\n]+)([\n]*)/gi,
|
||||
replace: "**$1**$2"
|
||||
},
|
||||
|
||||
'function-italic' : {
|
||||
search: /([^\n]+)([\n]*)/gi,
|
||||
replace: "//$1//$2"
|
||||
},
|
||||
|
||||
'function-code' : {
|
||||
search: /([^\n]+)([\n]*)/gi,
|
||||
replace: "{{{$1}}}$2"
|
||||
},
|
||||
|
||||
'function-hr' : {
|
||||
append: "\n\n----\n\n"
|
||||
},
|
||||
|
||||
'function-ul' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "* $1$2"
|
||||
},
|
||||
|
||||
/* This looks silly but is completely valid Markdown */
|
||||
'function-ol' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "# $1$2"
|
||||
},
|
||||
|
||||
'function-link' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
$.GollumEditor.Dialog.init({
|
||||
title: 'Insert Link',
|
||||
fields: [
|
||||
{
|
||||
id: 'text',
|
||||
name: 'Link Text',
|
||||
type: 'text',
|
||||
help: 'The text to display to the user.'
|
||||
},
|
||||
{
|
||||
id: 'href',
|
||||
name: 'URL',
|
||||
type: 'text',
|
||||
help: 'The URL to link to.'
|
||||
}
|
||||
],
|
||||
OK: function( res ) {
|
||||
var h = '[[' + res['href'] + '|' +
|
||||
res['text'] + ']]';
|
||||
$.GollumEditor.replaceSelection( h );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
'function-image' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var results = null;
|
||||
$.GollumEditor.Dialog.init({
|
||||
title: 'Insert Image',
|
||||
fields: [
|
||||
{
|
||||
id: 'url',
|
||||
name: 'Image URL',
|
||||
type: 'text'
|
||||
},
|
||||
{
|
||||
id: 'alt',
|
||||
name: 'Alt Text',
|
||||
type: 'text'
|
||||
}
|
||||
],
|
||||
OK: function( res ) {
|
||||
var h = '';
|
||||
if ( res['url'] && res['alt'] ) {
|
||||
h = '{{' + res['url'];
|
||||
if ( res['alt'] != '' ) {
|
||||
h += '|' + res['alt'] + '}}';
|
||||
}
|
||||
}
|
||||
$.GollumEditor.replaceSelection( h );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.GollumEditor.defineLanguage('creole', Creole);
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,74 +0,0 @@
|
||||
/**
|
||||
* Markdown Language Definition
|
||||
*
|
||||
* A language definition for string manipulation operations, in this case
|
||||
* for the Markdown, uh, markup language. Uses regexes for various functions
|
||||
* by default. If regexes won't do and you need to do some serious
|
||||
* manipulation, you can declare a function in the object instead.
|
||||
*
|
||||
* Code example:
|
||||
* 'functionbar-id' : {
|
||||
* exec: function(text, selectedText) {
|
||||
* functionStuffHere();
|
||||
* },
|
||||
* search: /somesearchregex/gi,
|
||||
* replace: 'replace text for RegExp.replace',
|
||||
* append: "just add this where the cursor is"
|
||||
* }
|
||||
*
|
||||
**/
|
||||
(function($) {
|
||||
|
||||
var RDoc = {
|
||||
|
||||
'function-bold' : {
|
||||
search: /([^\n]+)([\n\s]*)/g,
|
||||
replace: "((*$1*))$2"
|
||||
},
|
||||
'function-code' : {
|
||||
search: /([^\n]+)([\n\s]*)/g,
|
||||
replace: "(({$1}))$2"
|
||||
},
|
||||
|
||||
'function-ul' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "* $1$2"
|
||||
},
|
||||
|
||||
'function-ol' : {
|
||||
exec: function( txt, selText, $field ) {
|
||||
var count = 1;
|
||||
// split into lines
|
||||
var repText = '';
|
||||
var lines = selText.split("\n");
|
||||
var hasContent = /[\w]+/;
|
||||
for ( var i = 0; i < lines.length; i++ ) {
|
||||
if ( hasContent.test(lines[i]) ) {
|
||||
repText += '(' + (i + 1).toString() + ') ' +
|
||||
lines[i];
|
||||
}
|
||||
}
|
||||
$.GollumEditor.replaceSelection( repText );
|
||||
}
|
||||
},
|
||||
|
||||
'function-h1' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "= $1$2"
|
||||
},
|
||||
|
||||
'function-h2' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "== $1$2"
|
||||
},
|
||||
|
||||
'function-h3' : {
|
||||
search: /(.+)([\n]?)/gi,
|
||||
replace: "=== $1$2"
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.GollumEditor.defineLanguage('rdoc', RDoc);
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,263 +0,0 @@
|
||||
/**
|
||||
* gollum.dialog.js
|
||||
*
|
||||
* Used for dialogs. Duh.
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var Dialog = {
|
||||
|
||||
debugOn: false,
|
||||
markupCreated: false,
|
||||
markup: '',
|
||||
|
||||
attachEvents: function( evtOK ) {
|
||||
$('#gollum-dialog-action-ok').click(function( e ) {
|
||||
Dialog.eventOK( e, evtOK );
|
||||
});
|
||||
$('#gollum-dialog-action-cancel').click( Dialog.eventCancel );
|
||||
$('#gollum-dialog-dialog input[type="text"]').keydown(function( e ) {
|
||||
if ( e.keyCode == 13 ) {
|
||||
Dialog.eventOK( e, evtOK );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
detachEvents: function() {
|
||||
$('#gollum-dialog-action-ok').unbind('click');
|
||||
$('#gollum-dialog-action-cancel').unbind('click');
|
||||
},
|
||||
|
||||
createFieldMarkup: function( fieldArray ) {
|
||||
var fieldMarkup = '<fieldset>';
|
||||
for ( var i=0; i < fieldArray.length; i++ ) {
|
||||
if ( typeof fieldArray[i] == 'object' ) {
|
||||
fieldMarkup += '<div class="field">';
|
||||
switch ( fieldArray[i].type ) {
|
||||
|
||||
// only text is supported for now
|
||||
case 'text':
|
||||
fieldMarkup += Dialog.createFieldText( fieldArray[i] );
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
fieldMarkup += '</div>';
|
||||
}
|
||||
|
||||
}
|
||||
fieldMarkup += '</fieldset>';
|
||||
return fieldMarkup;
|
||||
},
|
||||
|
||||
createFieldText: function( fieldAttributes ) {
|
||||
var html = '';
|
||||
|
||||
if ( fieldAttributes.name ) {
|
||||
html += '<label';
|
||||
if ( fieldAttributes.id ) {
|
||||
html += ' for="' + fieldAttributes.name + '"';
|
||||
}
|
||||
html += '>' + fieldAttributes.name + '</label>';
|
||||
}
|
||||
|
||||
html += '<input type="text"';
|
||||
|
||||
if ( fieldAttributes.id ) {
|
||||
html += ' name="' + fieldAttributes.id + '"'
|
||||
if ( fieldAttributes.type == 'code' ) {
|
||||
html+= ' class="code"';
|
||||
}
|
||||
html += ' id="gollum-dialog-dialog-generated-field-' +
|
||||
fieldAttributes.id + '">';
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
createMarkup: function( title, body ) {
|
||||
Dialog.markupCreated = true;
|
||||
if ($.facebox) {
|
||||
return '<div id="gollum-dialog-dialog">' +
|
||||
'<div id="gollum-dialog-dialog-title"><h4>' +
|
||||
title +'</h4></div>' +
|
||||
'<div id="gollum-dialog-dialog-body">' + body + '</div>' +
|
||||
'<div id="gollum-dialog-dialog-buttons">' +
|
||||
'<a href="#" title="Cancel" id="gollum-dialog-action-cancel" ' +
|
||||
'class="gollum-minibutton">Cancel</a>' +
|
||||
'<a href="#" title="OK" id="gollum-dialog-action-ok" '+
|
||||
'class="gollum-minibutton">OK</a>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
} else {
|
||||
return '<div id="gollum-dialog-dialog">' +
|
||||
'<div id="gollum-dialog-dialog-inner">' +
|
||||
'<div id="gollum-dialog-dialog-bg">' +
|
||||
'<div id="gollum-dialog-dialog-title"><h4>' +
|
||||
title +'</h4></div>' +
|
||||
'<div id="gollum-dialog-dialog-body">' + body + '</div>' +
|
||||
'<div id="gollum-dialog-dialog-buttons">' +
|
||||
'<a href="#" title="Cancel" id="gollum-dialog-action-cancel" ' +
|
||||
'class="minibutton">Cancel</a>' +
|
||||
'<a href="#" title="OK" id="gollum-dialog-action-ok" '+
|
||||
'class="minibutton">OK</a>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
},
|
||||
|
||||
eventCancel: function( e ) {
|
||||
e.preventDefault();
|
||||
debug('Cancelled dialog.');
|
||||
Dialog.hide();
|
||||
},
|
||||
|
||||
eventOK: function( e, evtOK ) {
|
||||
e.preventDefault();
|
||||
|
||||
var results = [];
|
||||
// get the results from each field and build them into the object
|
||||
$('#gollum-dialog-dialog-body input').each(function() {
|
||||
results[$(this).attr('name')] = $(this).val();
|
||||
});
|
||||
|
||||
// pass them to evtOK if it exists (which it should)
|
||||
if ( evtOK &&
|
||||
typeof evtOK == 'function' ) {
|
||||
evtOK( results );
|
||||
}
|
||||
Dialog.hide();
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
if ( $.facebox ) {
|
||||
Dialog.markupCreated = false;
|
||||
$(document).trigger('close.facebox');
|
||||
Dialog.detachEvents();
|
||||
} else {
|
||||
if ( $.browser.msie ) {
|
||||
$('#gollum-dialog-dialog').hide().removeClass('active');
|
||||
$('select').css('visibility', 'visible');
|
||||
} else {
|
||||
$('#gollum-dialog-dialog').animate({ opacity: 0 }, {
|
||||
duration: 200,
|
||||
complete: function() {
|
||||
$('#gollum-dialog-dialog').removeClass('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
init: function( argObject ) {
|
||||
var title = '';
|
||||
var body = '';
|
||||
|
||||
// bail out if necessary
|
||||
if ( !argObject ||
|
||||
typeof argObject != 'object' ) {
|
||||
debug('Editor Dialog: Cannot init; invalid init object');
|
||||
return;
|
||||
}
|
||||
|
||||
if ( argObject.body && typeof argObject.body == 'string' ) {
|
||||
body = '<p>' + argObject.body + '</p>';
|
||||
}
|
||||
|
||||
// alright, build out fields
|
||||
if ( argObject.fields && typeof argObject.fields == 'object' ) {
|
||||
body += Dialog.createFieldMarkup( argObject.fields );
|
||||
}
|
||||
|
||||
if ( argObject.title && typeof argObject.title == 'string' ) {
|
||||
title = argObject.title;
|
||||
}
|
||||
|
||||
if ( Dialog.markupCreated ) {
|
||||
if ($.facebox) {
|
||||
$(document).trigger('close.facebox');
|
||||
} else {
|
||||
$('#gollum-dialog-dialog').remove();
|
||||
}
|
||||
}
|
||||
|
||||
Dialog.markup = Dialog.createMarkup( title, body );
|
||||
|
||||
if ($.facebox) {
|
||||
$(document).bind('reveal.facebox', function() {
|
||||
if ( argObject.OK &&
|
||||
typeof argObject.OK == 'function' ) {
|
||||
Dialog.attachEvents( argObject.OK );
|
||||
$($('#facebox input[type="text"]').get(0)).focus();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('body').append( Dialog.markup );
|
||||
if ( argObject.OK &&
|
||||
typeof argObject.OK == 'function' ) {
|
||||
Dialog.attachEvents( argObject.OK );
|
||||
}
|
||||
}
|
||||
|
||||
Dialog.show();
|
||||
},
|
||||
|
||||
show: function() {
|
||||
if ( !Dialog.markupCreated ) {
|
||||
debug('Dialog: No markup to show. Please use init first.');
|
||||
} else {
|
||||
debug('Showing dialog');
|
||||
if ($.facebox) {
|
||||
$.facebox( Dialog.markup );
|
||||
} else {
|
||||
if ( $.browser.msie ) {
|
||||
$('#gollum-dialog.dialog').addClass('active');
|
||||
Dialog.position();
|
||||
$('select').css('visibility', 'hidden');
|
||||
} else {
|
||||
$('#gollum-dialog.dialog').css('display', 'none');
|
||||
$('#gollum-dialog-dialog').animate({ opacity: 0 }, {
|
||||
duration: 0,
|
||||
complete: function() {
|
||||
$('#gollum-dialog-dialog').css('display', 'block');
|
||||
Dialog.position(); // position this thing
|
||||
$('#gollum-dialog-dialog').animate({ opacity: 1 }, {
|
||||
duration: 500
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
position: function() {
|
||||
var dialogHeight = $('#gollum-dialog-dialog-inner').height();
|
||||
$('#gollum-dialog-dialog-inner')
|
||||
.css('height', dialogHeight + 'px')
|
||||
.css('margin-top', -1 * parseInt( dialogHeight / 2 ));
|
||||
}
|
||||
};
|
||||
|
||||
if ($.facebox) {
|
||||
$(document).bind('reveal.facebox', function() {
|
||||
$('#facebox img.close_image').remove();
|
||||
});
|
||||
}
|
||||
|
||||
var debug = function(m) {
|
||||
if ( Dialog.debugOn
|
||||
&& typeof console != 'undefined' ) {
|
||||
console.log( m );
|
||||
}
|
||||
};
|
||||
|
||||
$.GollumDialog = Dialog;
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,161 +0,0 @@
|
||||
// ua
|
||||
$(document).ready(function() {
|
||||
var nodeSelector = {
|
||||
node1: null,
|
||||
node2: null,
|
||||
|
||||
selectNodeRange: function( n1, n2 ) {
|
||||
if ( nodeSelector.node1 && nodeSelector.node2 ) {
|
||||
$('#wiki-history td.selected').removeClass('selected');
|
||||
nodeSelector.node1.addClass('selected');
|
||||
nodeSelector.node2.addClass('selected');
|
||||
|
||||
// swap the nodes around if they went in reverse
|
||||
if ( nodeSelector.nodeComesAfter( nodeSelector.node1,
|
||||
nodeSelector.node2 ) ) {
|
||||
var n = nodeSelector.node1;
|
||||
nodeSelector.node1 = nodeSelector.node2;
|
||||
nodeSelector.node2 = n;
|
||||
}
|
||||
|
||||
var s = true;
|
||||
var $nextNode = nodeSelector.node1.next();
|
||||
while ( $nextNode ) {
|
||||
$nextNode.addClass('selected');
|
||||
if ( $nextNode[0] == nodeSelector.node2[0] ) {
|
||||
break;
|
||||
}
|
||||
$nextNode = $nextNode.next();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
nodeComesAfter: function ( n1, n2 ) {
|
||||
var s = false;
|
||||
$(n1).prevAll().each(function() {
|
||||
if ( $(this)[0] == $(n2)[0] ) {
|
||||
s = true;
|
||||
}
|
||||
});
|
||||
return s;
|
||||
},
|
||||
|
||||
checkNode: function( nodeCheckbox ) {
|
||||
var $nodeCheckbox = nodeCheckbox;
|
||||
var $node = $(nodeCheckbox).parent().parent();
|
||||
// if we're unchecking
|
||||
if ( !$nodeCheckbox.is(':checked') ) {
|
||||
|
||||
// remove the range, since we're breaking it
|
||||
$('#wiki-history tr.selected').each(function() {
|
||||
if ( $(this).find('td.checkbox input').is(':checked') ) {
|
||||
return;
|
||||
}
|
||||
$(this).removeClass('selected');
|
||||
});
|
||||
|
||||
// no longer track this
|
||||
if ( $node[0] == nodeSelector.node1[0] ) {
|
||||
nodeSelector.node1 = null;
|
||||
if ( nodeSelector.node2 ) {
|
||||
nodeSelector.node1 = nodeSelector.node2;
|
||||
nodeSelector.node2 = null;
|
||||
}
|
||||
} else if ( $node[0] == nodeSelector.node2[0] ) {
|
||||
nodeSelector.node2 = null;
|
||||
}
|
||||
|
||||
} else {
|
||||
if ( !nodeSelector.node1 ) {
|
||||
nodeSelector.node1 = $node;
|
||||
nodeSelector.node1.addClass('selected');
|
||||
} else if ( !nodeSelector.node2 ) {
|
||||
// okay, we don't have a node 2 but have a node1
|
||||
nodeSelector.node2 = $node;
|
||||
nodeSelector.node2.addClass('selected');
|
||||
nodeSelector.selectNodeRange( nodeSelector.node1,
|
||||
nodeSelector.node2 );
|
||||
} else {
|
||||
// we have two selected already
|
||||
$nodeCheckbox[0].checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ua detection
|
||||
if ($.browser.mozilla) {
|
||||
$('body').addClass('ff');
|
||||
} else if ($.browser.webkit) {
|
||||
$('body').addClass('webkit');
|
||||
} else if ($.browser.msie) {
|
||||
$('body').addClass('ie');
|
||||
if ($.browser.version == "7.0") {
|
||||
$('body').addClass('ie7');
|
||||
} else if ($.browser.version == "8.0") {
|
||||
$('body').addClass('ie8');
|
||||
}
|
||||
}
|
||||
|
||||
if ($('#minibutton-new-page').length) {
|
||||
$('#minibutton-new-page').removeClass('jaws');
|
||||
$('#minibutton-new-page').click(function(e) {
|
||||
e.preventDefault();
|
||||
$.GollumDialog.init({
|
||||
title: 'Create New Page',
|
||||
fields: [
|
||||
{
|
||||
id: 'name',
|
||||
name: 'Page Name',
|
||||
type: 'text'
|
||||
}
|
||||
],
|
||||
OK: function( res ) {
|
||||
var n = 'New Page';
|
||||
if ( res['name'] )
|
||||
var n = res['name'];
|
||||
n = encodeURIComponent( n );
|
||||
window.location = '/' + n;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#wiki-wrapper').hasClass('history')) {
|
||||
$('#wiki-history td.checkbox input').each(function() {
|
||||
$(this).click(function() {
|
||||
nodeSelector.checkNode($(this));
|
||||
});
|
||||
if ( $(this).is(':checked') ) {
|
||||
nodeSelector.checkNode($(this));
|
||||
}
|
||||
});
|
||||
|
||||
if ($('.history a.action-compare-revision').length) {
|
||||
$('.history a.action-compare-revision').click(function() {
|
||||
$("#version-form").submit();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ($('#searchbar a#search-submit').length) {
|
||||
$.GollumPlaceholder.add($('#searchbar #search-query'));
|
||||
$('#searchbar a#search-submit').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#searchbar #search-form')[0].submit();
|
||||
});
|
||||
$('#searchbar #search-form').submit(function(e) {
|
||||
$.GollumPlaceholder.clearAll();
|
||||
$(this).unbind('submit');
|
||||
$(this).submit();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#gollum-revert-form').length &&
|
||||
$('.gollum-revert-button').length ) {
|
||||
$('a.gollum-revert-button').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#gollum-revert-form').submit();
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* jQuery Color Animations
|
||||
* Copyright 2007 John Resig
|
||||
* Released under the MIT and GPL licenses.
|
||||
*/
|
||||
|
||||
(function(jQuery){
|
||||
|
||||
// We override the animation for all of these color styles
|
||||
jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
|
||||
jQuery.fx.step[attr] = function(fx){
|
||||
if ( fx.state == 0 ) {
|
||||
fx.start = getColor( fx.elem, attr );
|
||||
fx.end = getRGB( fx.end );
|
||||
}
|
||||
|
||||
fx.elem.style[attr] = "rgb(" + [
|
||||
Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
|
||||
Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
|
||||
Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
|
||||
].join(",") + ")";
|
||||
}
|
||||
});
|
||||
|
||||
// Color Conversion functions from highlightFade
|
||||
// By Blair Mitchelmore
|
||||
// http://jquery.offput.ca/highlightFade/
|
||||
|
||||
// Parse strings looking for color tuples [255,255,255]
|
||||
function getRGB(color) {
|
||||
var result;
|
||||
|
||||
// Check if we're already dealing with an array of colors
|
||||
if ( color && color.constructor == Array && color.length == 3 )
|
||||
return color;
|
||||
|
||||
// Look for rgb(num,num,num)
|
||||
if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
|
||||
return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
|
||||
|
||||
// Look for rgb(num%,num%,num%)
|
||||
if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
|
||||
return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
|
||||
|
||||
// Look for #a0b1c2
|
||||
if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
|
||||
return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
|
||||
|
||||
// Look for #fff
|
||||
if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
|
||||
return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
|
||||
|
||||
// Otherwise, we're most likely dealing with a named color
|
||||
return colors[jQuery.trim(color).toLowerCase()];
|
||||
}
|
||||
|
||||
function getColor(elem, attr) {
|
||||
var color;
|
||||
|
||||
do {
|
||||
color = jQuery.curCSS(elem, attr);
|
||||
|
||||
// Keep going until we find an element that has color, or we hit the body
|
||||
if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
|
||||
break;
|
||||
|
||||
attr = "backgroundColor";
|
||||
} while ( elem = elem.parentNode );
|
||||
|
||||
return getRGB(color);
|
||||
};
|
||||
|
||||
// Some named colors to work with
|
||||
// From Interface by Stefan Petre
|
||||
// http://interface.eyecon.ro/
|
||||
|
||||
var colors = {
|
||||
aqua:[0,255,255],
|
||||
azure:[240,255,255],
|
||||
beige:[245,245,220],
|
||||
black:[0,0,0],
|
||||
blue:[0,0,255],
|
||||
brown:[165,42,42],
|
||||
cyan:[0,255,255],
|
||||
darkblue:[0,0,139],
|
||||
darkcyan:[0,139,139],
|
||||
darkgrey:[169,169,169],
|
||||
darkgreen:[0,100,0],
|
||||
darkkhaki:[189,183,107],
|
||||
darkmagenta:[139,0,139],
|
||||
darkolivegreen:[85,107,47],
|
||||
darkorange:[255,140,0],
|
||||
darkorchid:[153,50,204],
|
||||
darkred:[139,0,0],
|
||||
darksalmon:[233,150,122],
|
||||
darkviolet:[148,0,211],
|
||||
fuchsia:[255,0,255],
|
||||
gold:[255,215,0],
|
||||
green:[0,128,0],
|
||||
indigo:[75,0,130],
|
||||
khaki:[240,230,140],
|
||||
lightblue:[173,216,230],
|
||||
lightcyan:[224,255,255],
|
||||
lightgreen:[144,238,144],
|
||||
lightgrey:[211,211,211],
|
||||
lightpink:[255,182,193],
|
||||
lightyellow:[255,255,224],
|
||||
lime:[0,255,0],
|
||||
magenta:[255,0,255],
|
||||
maroon:[128,0,0],
|
||||
navy:[0,0,128],
|
||||
olive:[128,128,0],
|
||||
orange:[255,165,0],
|
||||
pink:[255,192,203],
|
||||
purple:[128,0,128],
|
||||
violet:[128,0,128],
|
||||
red:[255,0,0],
|
||||
silver:[192,192,192],
|
||||
white:[255,255,255],
|
||||
yellow:[255,255,0]
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
-7179
File diff suppressed because it is too large
Load Diff
@@ -1,63 +0,0 @@
|
||||
<div id="wiki-wrapper" class="compare">
|
||||
<div id="head">
|
||||
<h1>History for <strong>{{path}}</strong></h1>
|
||||
|
||||
<ul class="actions">
|
||||
<li class="minibutton">
|
||||
{{>searchbar}}
|
||||
</li>
|
||||
<li class="minibutton"><a href="/{{escaped_name}}"
|
||||
class="action-view-page">View Page</a></li>
|
||||
<li class="minibutton"><a href="/edit/{{escaped_name}}"
|
||||
class="action-edit-page">Edit Page</a></li>
|
||||
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
||||
class="action-page-history">Page History</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{#message}}
|
||||
<p>{{message}}</p>
|
||||
{{/message}}
|
||||
|
||||
<div id="compare-content">
|
||||
|
||||
{{#show_revert}}
|
||||
<ul class="actions">
|
||||
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
||||
class="action-page-history">Back to Page History</a></li>
|
||||
<li class="minibutton">
|
||||
<form name="gollum-revert" action="/revert/{{escaped_name}}/{{before}}/{{after}}" method="post" id="gollum-revert-form">
|
||||
<a href="#" class="gollum-revert-button">Revert Changes</a>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
{{/show_revert}}
|
||||
|
||||
<div class="data highlight">
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
{{#lines}}
|
||||
<tr>
|
||||
<td class="line_numbers">{{ldln}}</td>
|
||||
<td class="line_numbers">{{rdln}}</td>
|
||||
<td>
|
||||
<pre><div class="{{class}}">{{line}}</div></pre>
|
||||
</td>
|
||||
</tr>
|
||||
{{/lines}}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<ul class="actions">
|
||||
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
||||
class="action-page-history">Back to Page History</a></li>
|
||||
{{#show_revert}}
|
||||
<li class="minibutton">
|
||||
<a href="#" class="gollum-revert-button">Revert Changes</a>
|
||||
</li>
|
||||
{{/show_revert}}
|
||||
<li class="minibutton"><a href="#">Back to Top</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,17 +0,0 @@
|
||||
<div id="wiki-wrapper">
|
||||
<div id="head">
|
||||
<h1>Create New Page</h1>
|
||||
</div>
|
||||
<div id="wiki-content" class="create edit">
|
||||
<div class="has-rightbar">
|
||||
{{>editor}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
$.GollumEditor({ NewFile: true, MarkupType: '{{default_markup}}' });
|
||||
});
|
||||
</script>
|
||||
|
||||
{{something}}
|
||||
@@ -1,17 +0,0 @@
|
||||
<div id="wiki-wrapper" class="edit">
|
||||
<div id="head">
|
||||
<h1>Editing <strong>{{title}}</strong></h1>
|
||||
<ul class="actions">
|
||||
<li class="minibutton"><a href="/{{escaped_name}}"
|
||||
class="action-view-page">View Page</a></li>
|
||||
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
||||
class="action-page-history">Page History</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="wiki-content">{{>editor}}</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
$.GollumEditor();
|
||||
});
|
||||
</script>
|
||||
@@ -1,116 +0,0 @@
|
||||
<div id="gollum-editor" data-escaped-name="{{escaped_name}}" class="{{#is_create_page}}create{{/is_create_page}}{{#is_edit_page}}edit{{/is_edit_page}}">
|
||||
{{#is_create_page}}
|
||||
<form name="gollum-editor" action="/create" method="post">
|
||||
{{/is_create_page}}
|
||||
{{#is_edit_page}}
|
||||
<form name="gollum-editor" action="/edit/{{escaped_name}}" method="post">
|
||||
{{/is_edit_page}}
|
||||
<fieldset id="gollum-editor-fields">
|
||||
{{#is_create_page}}
|
||||
<div id="gollum-editor-title-field" class="singleline">
|
||||
<label for="page" class="jaws">Page Title</label>
|
||||
<input type="text" name="page" id="gollum-editor-page-title" value="{{page_name}}">
|
||||
</div>
|
||||
{{/is_create_page}}
|
||||
{{#is_edit_page}}
|
||||
<input type="hidden" name="page" id="gollum-editor-page-title" value="{{page_name}}">
|
||||
{{/is_edit_page}}
|
||||
<div id="gollum-editor-function-bar">
|
||||
<div id="gollum-editor-function-buttons">
|
||||
<a href="#" id="function-bold" class="function-button">
|
||||
<span>Bold</span></a>
|
||||
<a href="#" id="function-italic" class="function-button">
|
||||
<span>Italic</span></a>
|
||||
<a href="#" id="function-code" class="function-button">
|
||||
<span>Code</span></a>
|
||||
<span class="function-divider"> </span>
|
||||
<a href="#" id="function-ul" class="function-button">
|
||||
<span>Unordered List</span></a>
|
||||
<a href="#" id="function-ol" class="function-button">
|
||||
<span>Ordered List</span></a>
|
||||
<a href="#" id="function-blockquote" class="function-button">
|
||||
<span>Blockquote</span></a>
|
||||
|
||||
<a href="#" id="function-hr" class="function-button">
|
||||
<span>Horizontal Rule</span></a>
|
||||
<span class="function-divider"> </span>
|
||||
<a href="#" id="function-h1" class="function-button">
|
||||
<span>h1</span></a>
|
||||
<a href="#" id="function-h2" class="function-button">
|
||||
<span>h2</span></a>
|
||||
<a href="#" id="function-h3" class="function-button">
|
||||
<span>h3</span></a>
|
||||
<span class="function-divider"> </span>
|
||||
<a href="#" id="function-link" class="function-button">
|
||||
<span>Link</span></a>
|
||||
<a href="#" id="function-image" class="function-button">
|
||||
<span>Image</span></a>
|
||||
<span class="function-divider"> </span>
|
||||
<a href="#" id="function-help" class="function-button">
|
||||
<span>Help</span></a>
|
||||
</div>
|
||||
|
||||
<div id="gollum-editor-format-selector">
|
||||
<select id="wiki_format" name="format">
|
||||
{{#formats}}
|
||||
<option {{#selected}}selected="selected" {{/selected}}value="{{id}}">
|
||||
{{name}}
|
||||
</option>
|
||||
{{/formats}}
|
||||
</select>
|
||||
<label for="format">Edit Mode</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="gollum-editor-help" class="jaws">
|
||||
<ul id="gollum-editor-help-parent">
|
||||
<li><a href="javascript:void(0);" class="selected">Help 1</a></li>
|
||||
<li><a href="javascript:void(0);">Help 1</a></li>
|
||||
<li><a href="javascript:void(0);">Help 1</a></li>
|
||||
</ul>
|
||||
<ul id="gollum-editor-help-list">
|
||||
<li><a href="javascript:void(0);">Help 2</a></li>
|
||||
<li><a href="javascript:void(0);">Help 3</a></li>
|
||||
<li><a href="javascript:void(0);">Help 4</a></li>
|
||||
<li><a href="javascript:void(0);">Help 5</a></li>
|
||||
<li><a href="javascript:void(0);">Help 6</a></li>
|
||||
<li><a href="javascript:void(0);">Help 7</a></li>
|
||||
<li><a href="javascript:void(0);">Help 8</a></li>
|
||||
</ul>
|
||||
<div id="gollum-editor-help-wrapper">
|
||||
<div id="gollum-editor-help-content">
|
||||
<p>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<textarea id="gollum-editor-body"
|
||||
data-markup-lang="{{format}}" name="content">{{content}}</textarea>
|
||||
|
||||
{{#footer}}
|
||||
<div id="gollum-editor-edit-footer" class="collapsed">
|
||||
<a href="#" class="button"><span>Expand/Collapse</span></a>
|
||||
<h4>Footer</h4>
|
||||
<textarea id="gollum-editor-footer" name="footer">{{footer}}</textarea>
|
||||
</div>
|
||||
{{/footer}}
|
||||
|
||||
{{#sidebar}}
|
||||
<div id="gollum-editor-edit-sidebar" class="collapsed">
|
||||
<a href="#" class="button"><span>Expand/Collapse</span></a>
|
||||
<h4>Sidebar</h4>
|
||||
<textarea id="gollum-editor-sidebar" name="sidebar">{{sidebar}}</textarea>
|
||||
</div>
|
||||
{{/sidebar}}
|
||||
|
||||
<div id="gollum-editor-edit-summary" class="singleline">
|
||||
<label for="message" class="jaws">Edit message:</label>
|
||||
<input type="text" name="message" id="gollum-editor-message-field" value="Write a small message here explaining this change. (Optional)">
|
||||
</div>
|
||||
|
||||
|
||||
<span class="jaws"><br></span>
|
||||
<input type="submit" id="gollum-editor-submit" value="Save" title="Save current changes">
|
||||
<a href="/preview" id="gollum-editor-preview" class="minibutton" title="Preview this Page">Preview</a>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
@@ -1,62 +0,0 @@
|
||||
<div id="wiki-wrapper" class="history">
|
||||
<div id="head">
|
||||
<h1>History for <strong>{{title}}</strong></h1>
|
||||
<ul class="actions">
|
||||
<li class="minibutton">
|
||||
{{>searchbar}}
|
||||
</li>
|
||||
<li class="minibutton"><a href="/{{escaped_name}}"
|
||||
class="action-view-page">View Page</a></li>
|
||||
<li class="minibutton"><a href="/edit/{{escaped_name}}"
|
||||
class="action-edit-page">Edit Page</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="wiki-history">
|
||||
|
||||
<ul class="actions">
|
||||
<li class="minibutton"><a href="javascript:void(0);"
|
||||
class="action-compare-revision">Compare Revisions</a></li>
|
||||
</ul>
|
||||
|
||||
<form name="compare-versions" id="version-form" method="post"
|
||||
action="/compare/{{escaped_name}}">
|
||||
<fieldset>
|
||||
<table>
|
||||
<tbody>
|
||||
|
||||
{{#versions}}
|
||||
<tr>
|
||||
<td class="checkbox">
|
||||
<input type="checkbox" name="versions[]" value="{{id}}">
|
||||
</td>
|
||||
<td class="author">
|
||||
<a href="javascript:void(0)">
|
||||
<img src="https://secure.gravatar.com/avatar/{{gravatar}}?s=16"
|
||||
alt="avatar: {{author}}" class="mini-gravatar">
|
||||
<span class="username">{{author}}</span>
|
||||
</a>
|
||||
</td>
|
||||
<td class="commit-name">
|
||||
<span class="time-elapsed">{{date}}:</span>
|
||||
{{message}}
|
||||
[<a href="/{{escaped_name}}/{{id}}" title="View commit">{{id7}}</a>]
|
||||
</td>
|
||||
</tr>
|
||||
{{/versions}}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<ul class="actions">
|
||||
<li class="minibutton"><a href="javascript:void(0);"
|
||||
class="action-compare-revision">Compare Revisions</a></li>
|
||||
|
||||
<!-- only show this button if we have more than 20 revisions -->
|
||||
<li class="minibutton"><a href="#"
|
||||
class="action-back-to-top">Back to Top</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,28 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-type" content="text/html;charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="/css/gollum.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="/css/editor.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="/css/dialog.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="/css/template.css" media="all">
|
||||
|
||||
<!--[if IE 7]>
|
||||
<link rel="stylesheet" type="text/css" href="/css/ie7.css" media="all">
|
||||
<![endif]-->
|
||||
|
||||
<script type="text/javascript" src="/javascript/jquery.js"></script>
|
||||
<script type="text/javascript" src="/javascript/gollum.js"></script>
|
||||
<script type="text/javascript" src="/javascript/gollum.dialog.js"></script>
|
||||
<script type="text/javascript" src="/javascript/gollum.placeholder.js"></script>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="/javascript/editor/gollum.editor.js"></script>
|
||||
<title>{{title}}</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{{{yield}}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,45 +0,0 @@
|
||||
<div id="wiki-wrapper" class="page">
|
||||
<div id="head">
|
||||
<h1>{{title}}</h1>
|
||||
<ul class="actions">
|
||||
<li class="minibutton">
|
||||
{{>searchbar}}
|
||||
</li>
|
||||
<li class="minibutton"><a href="/pages"
|
||||
class="action-all-pages">All Pages</a></li>
|
||||
<li class="minibutton" class="jaws">
|
||||
<a href="#" id="minibutton-new-page">New Page</a></li>
|
||||
{{#editable}}
|
||||
<li class="minibutton"><a href="/edit/{{escaped_name}}"
|
||||
class="action-edit-page">Edit Page</a></li>
|
||||
{{/editable}}
|
||||
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
||||
class="action-page-history">Page History</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="wiki-content">
|
||||
<div class="wrap {{#has_footer}} has-footer {{/has_footer}} {{#has_sidebar}} has-rightbar{{/has_sidebar}}">
|
||||
<div id="wiki-body" class="gollum-{{format}}-content">
|
||||
<div id="template">
|
||||
{{{content}}}
|
||||
</div>
|
||||
</div>
|
||||
{{#has_sidebar}}
|
||||
<div id="wiki-rightbar" class="gollum-{{sidebar_format}}-content">
|
||||
{{{sidebar_content}}}
|
||||
</div>
|
||||
{{/has_sidebar}}
|
||||
{{#has_footer}}
|
||||
<div id="wiki-footer" class="gollum-{{footer_format}}-content">
|
||||
<div id="footer-content">
|
||||
{{{footer_content}}}
|
||||
</div>
|
||||
</div>
|
||||
{{/has_footer}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="last-edit">Last edited by <b>{{author}}</b>, {{date}}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,37 +0,0 @@
|
||||
<div id="wiki-wrapper" class="results">
|
||||
<div id="head">
|
||||
<h1>{{title}}</h1>
|
||||
<ul class="actions">
|
||||
<li class="minibutton">
|
||||
{{>searchbar}}
|
||||
</li>
|
||||
<li class="minibutton"><a href="/"
|
||||
class="action-edit-page">Home</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="results">
|
||||
|
||||
{{#has_results}}
|
||||
<ul>
|
||||
{{#results}}
|
||||
<li>
|
||||
<a href="/{{name}}">{{name}}</a>
|
||||
</li>
|
||||
{{/results}}
|
||||
</ul>
|
||||
{{/has_results}}
|
||||
|
||||
{{#no_results}}
|
||||
<p id="no-results">
|
||||
There are no pages in <strong>{{ref}}</strong>.
|
||||
</p>
|
||||
{{/no_results}}
|
||||
|
||||
</div>
|
||||
<div id="footer">
|
||||
<ul class="actions">
|
||||
<li class="minibutton"><a href="#">Back to Top</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
<div id="wiki-wrapper" class="results">
|
||||
<div id="head">
|
||||
<h1>Search Results for <strong>{{query}}</strong></h1>
|
||||
<ul class="actions">
|
||||
<li class="minibutton">
|
||||
{{>searchbar}}
|
||||
</li>
|
||||
<li class="minibutton"><a href="/"
|
||||
class="action-edit-page">Home</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="results">
|
||||
|
||||
{{#has_results}}
|
||||
<ul>
|
||||
{{#results}}
|
||||
<li>
|
||||
<a href="/{{name}}">{{name}}</a>
|
||||
<span class="count">({{count}} matches)</span>
|
||||
</li>
|
||||
{{/results}}
|
||||
</ul>
|
||||
{{/has_results}}
|
||||
|
||||
{{#no_results}}
|
||||
<p id="no-results">
|
||||
There are no results for your search <strong>{{query}}</strong>.
|
||||
</p>
|
||||
{{/no_results}}
|
||||
|
||||
</div>
|
||||
<div id="footer">
|
||||
<ul class="actions">
|
||||
<li class="minibutton"><a href="#">Back to Top</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<div id="searchbar">
|
||||
<form action="/search" method="get" id="search-form">
|
||||
<div id="searchbar-fauxtext">
|
||||
<input type="text" name="q" id="search-query" value="Search…" autocomplete="off">
|
||||
<a href="#" id="search-submit" title="Search this wiki">
|
||||
<span>Search</span>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -1,94 +0,0 @@
|
||||
module Precious
|
||||
module Views
|
||||
class Compare < Layout
|
||||
attr_reader :page, :diff, :versions, :message
|
||||
|
||||
def title
|
||||
"Comparison of #{@page.title}"
|
||||
end
|
||||
|
||||
def path
|
||||
@page.path
|
||||
end
|
||||
|
||||
def before
|
||||
@versions[0][0..6]
|
||||
end
|
||||
|
||||
def after
|
||||
@versions[1][0..6]
|
||||
end
|
||||
|
||||
def lines
|
||||
lines = []
|
||||
@diff.diff.split("\n")[2..-1].each_with_index do |line, line_index|
|
||||
lines << { :line => line,
|
||||
:class => line_class(line),
|
||||
:ldln => left_diff_line_number(0, line),
|
||||
:rdln => right_diff_line_number(0, line) }
|
||||
end if @diff
|
||||
lines
|
||||
end
|
||||
|
||||
def show_revert
|
||||
!@message
|
||||
end
|
||||
|
||||
# private
|
||||
|
||||
def line_class(line)
|
||||
if line =~ /^@@/
|
||||
'gc'
|
||||
elsif line =~ /^\+/
|
||||
'gi'
|
||||
elsif line =~ /^\-/
|
||||
'gd'
|
||||
else
|
||||
''
|
||||
end
|
||||
end
|
||||
|
||||
@left_diff_line_number = nil
|
||||
def left_diff_line_number(id, line)
|
||||
if line =~ /^@@/
|
||||
m, li = *line.match(/\-(\d+)/)
|
||||
@left_diff_line_number = li.to_i
|
||||
@current_line_number = @left_diff_line_number
|
||||
ret = '...'
|
||||
elsif line[0] == ?-
|
||||
ret = @left_diff_line_number.to_s
|
||||
@left_diff_line_number += 1
|
||||
@current_line_number = @left_diff_line_number - 1
|
||||
elsif line[0] == ?+
|
||||
ret = ' '
|
||||
else
|
||||
ret = @left_diff_line_number.to_s
|
||||
@left_diff_line_number += 1
|
||||
@current_line_number = @left_diff_line_number - 1
|
||||
end
|
||||
ret
|
||||
end
|
||||
|
||||
@right_diff_line_number = nil
|
||||
def right_diff_line_number(id, line)
|
||||
if line =~ /^@@/
|
||||
m, ri = *line.match(/\+(\d+)/)
|
||||
@right_diff_line_number = ri.to_i
|
||||
@current_line_number = @right_diff_line_number
|
||||
ret = '...'
|
||||
elsif line[0] == ?-
|
||||
ret = ' '
|
||||
elsif line[0] == ?+
|
||||
ret = @right_diff_line_number.to_s
|
||||
@right_diff_line_number += 1
|
||||
@current_line_number = @right_diff_line_number - 1
|
||||
else
|
||||
ret = @right_diff_line_number.to_s
|
||||
@right_diff_line_number += 1
|
||||
@current_line_number = @right_diff_line_number - 1
|
||||
end
|
||||
ret
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,13 +0,0 @@
|
||||
module Precious
|
||||
module Editable
|
||||
def formats(selected = @page.format)
|
||||
Gollum::Page::FORMAT_NAMES.map do |key, val|
|
||||
{ :name => val,
|
||||
:id => key.to_s,
|
||||
:selected => selected == key}
|
||||
end.sort do |a, b|
|
||||
a[:name].downcase <=> b[:name].downcase
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,44 +0,0 @@
|
||||
module Precious
|
||||
module Views
|
||||
class History < Layout
|
||||
attr_reader :page, :page_num
|
||||
|
||||
def title
|
||||
@page.title
|
||||
end
|
||||
|
||||
def versions
|
||||
i = @versions.size + 1
|
||||
@versions.map do |v|
|
||||
i -= 1
|
||||
{ :id => v.id,
|
||||
:id7 => v.id[0..6],
|
||||
:num => i,
|
||||
:selected => @page.version.id == v.id,
|
||||
:author => v.author.name,
|
||||
:message => v.message,
|
||||
:date => v.committed_date.strftime("%B %d, %Y"),
|
||||
:gravatar => Digest::MD5.hexdigest(v.author.email) }
|
||||
end
|
||||
end
|
||||
|
||||
def previous_link
|
||||
label = "« Previous"
|
||||
if @page_num == 1
|
||||
%(<span class="disabled">#{label}</span>)
|
||||
else
|
||||
%(<a href="/history/#{@page.name}?page=#{@page_num-1}" hotkey="h">#{label}</a>)
|
||||
end
|
||||
end
|
||||
|
||||
def next_link
|
||||
label = "Next »"
|
||||
if @versions.size == Gollum::Page.per_page
|
||||
%(<a href="/history/#{@page.name}?page=#{@page_num+1}" hotkey="l">#{label}</a>)
|
||||
else
|
||||
%(<span class="disabled">#{label}</span>)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,20 +0,0 @@
|
||||
require 'cgi'
|
||||
|
||||
module Precious
|
||||
module Views
|
||||
class Layout < Mustache
|
||||
include Rack::Utils
|
||||
alias_method :h, :escape_html
|
||||
|
||||
attr_reader :name
|
||||
|
||||
def escaped_name
|
||||
CGI.escape(@name)
|
||||
end
|
||||
|
||||
def title
|
||||
"Home"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,57 +0,0 @@
|
||||
module Precious
|
||||
module Views
|
||||
class Page < Layout
|
||||
attr_reader :content, :page, :footer
|
||||
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
|
||||
DEFAULT_AUTHOR = 'you'
|
||||
|
||||
def title
|
||||
@page.title
|
||||
end
|
||||
|
||||
def format
|
||||
@page.format.to_s
|
||||
end
|
||||
|
||||
def author
|
||||
return DEFAULT_AUTHOR unless @page.version
|
||||
@page.version.author.name
|
||||
end
|
||||
|
||||
def date
|
||||
return Time.now.strftime(DATE_FORMAT) unless @page.version
|
||||
@page.version.authored_date.strftime(DATE_FORMAT)
|
||||
end
|
||||
|
||||
def editable
|
||||
@editable
|
||||
end
|
||||
|
||||
def has_footer
|
||||
@footer = (@page.footer || false) if @footer.nil?
|
||||
!!@footer
|
||||
end
|
||||
|
||||
def footer_content
|
||||
has_footer && @footer.formatted_data
|
||||
end
|
||||
|
||||
def footer_format
|
||||
has_footer && @footer.format.to_s
|
||||
end
|
||||
|
||||
def has_sidebar
|
||||
@sidebar = (@page.sidebar || false) if @sidebar.nil?
|
||||
!!@sidebar
|
||||
end
|
||||
|
||||
def sidebar_content
|
||||
has_sidebar && @sidebar.formatted_data
|
||||
end
|
||||
|
||||
def sidebar_format
|
||||
has_sidebar && @sidebar.format.to_s
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,19 +0,0 @@
|
||||
module Precious
|
||||
module Views
|
||||
class Pages < Layout
|
||||
attr_reader :results, :ref
|
||||
|
||||
def title
|
||||
"All pages in #{@ref}"
|
||||
end
|
||||
|
||||
def has_results
|
||||
!@results.empty?
|
||||
end
|
||||
|
||||
def no_results
|
||||
@results.empty?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,20 +0,0 @@
|
||||
module Precious
|
||||
module Views
|
||||
class Search < Layout
|
||||
attr_reader :content, :page, :footer, :results, :query
|
||||
|
||||
def title
|
||||
"Search results for " + @query
|
||||
end
|
||||
|
||||
def has_results
|
||||
!@results.empty?
|
||||
end
|
||||
|
||||
def no_results
|
||||
@results.empty?
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,248 +0,0 @@
|
||||
module Gollum
|
||||
# Controls all access to the Git objects from Gollum. Extend this class to
|
||||
# add custom caching for special cases.
|
||||
class GitAccess
|
||||
# Initializes the GitAccess instance.
|
||||
#
|
||||
# path - The String path to the Git repository that holds the
|
||||
# Gollum site.
|
||||
# page_file_dir - String the directory in which all page files reside
|
||||
#
|
||||
# Returns this instance.
|
||||
def initialize(path, page_file_dir = nil)
|
||||
@page_file_dir = page_file_dir
|
||||
@path = path
|
||||
@repo = Grit::Repo.new(path)
|
||||
clear
|
||||
end
|
||||
|
||||
# Public: Determines whether the Git repository exists on disk.
|
||||
#
|
||||
# Returns true if it exists, or false.
|
||||
def exist?
|
||||
@repo.git.exist?
|
||||
end
|
||||
|
||||
# Public: Converts a given Git reference to a SHA, using the cache if
|
||||
# available.
|
||||
#
|
||||
# ref - a String Git reference (ex: "master")
|
||||
#
|
||||
# Returns a String, or nil if the ref isn't found.
|
||||
def ref_to_sha(ref)
|
||||
ref = ref.to_s
|
||||
return if ref.empty?
|
||||
sha =
|
||||
if sha?(ref)
|
||||
ref
|
||||
else
|
||||
get_cache(:ref, ref) { ref_to_sha!(ref) }
|
||||
end.to_s
|
||||
sha.empty? ? nil : sha
|
||||
end
|
||||
|
||||
# Public: Gets a recursive list of Git blobs for the whole tree at the
|
||||
# given commit.
|
||||
#
|
||||
# ref - A String Git reference or Git SHA to a commit.
|
||||
#
|
||||
# Returns an Array of BlobEntry instances.
|
||||
def tree(ref)
|
||||
if sha = ref_to_sha(ref)
|
||||
get_cache(:tree, sha) { tree!(sha) }
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
|
||||
# Public: Fetches the contents of the Git blob at the given SHA.
|
||||
#
|
||||
# sha - A String Git SHA.
|
||||
#
|
||||
# Returns the String content of the blob.
|
||||
def blob(sha)
|
||||
cat_file!(sha)
|
||||
end
|
||||
|
||||
# Public: Looks up the Git commit using the given Git SHA or ref.
|
||||
#
|
||||
# ref - A String Git SHA or ref.
|
||||
#
|
||||
# Returns a Grit::Commit.
|
||||
def commit(ref)
|
||||
if sha?(ref)
|
||||
get_cache(:commit, ref) { commit!(ref) }
|
||||
else
|
||||
if sha = get_cache(:ref, ref)
|
||||
commit(sha)
|
||||
else
|
||||
if cm = commit!(ref)
|
||||
set_cache(:ref, ref, cm.id)
|
||||
set_cache(:commit, cm.id, cm)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Public: Clears all of the cached data that this GitAccess is tracking.
|
||||
#
|
||||
# Returns nothing.
|
||||
def clear
|
||||
@ref_map = {}
|
||||
@tree_map = {}
|
||||
@commit_map = {}
|
||||
end
|
||||
|
||||
# Public: Refreshes just the cached Git reference data. This should
|
||||
# be called after every Gollum update.
|
||||
#
|
||||
# Returns nothing.
|
||||
def refresh
|
||||
@ref_map.clear
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# Internal Methods
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
# Gets the String path to the Git repository.
|
||||
attr_reader :path
|
||||
|
||||
# Gets the Grit::Repo instance for the Git repository.
|
||||
attr_reader :repo
|
||||
|
||||
# Gets a Hash cache of refs to commit SHAs.
|
||||
#
|
||||
# {"master" => "abc123", ...}
|
||||
#
|
||||
attr_reader :ref_map
|
||||
|
||||
# Gets a Hash cache of commit SHAs to a recursive tree of blobs.
|
||||
#
|
||||
# {"abc123" => [<BlobEntry>, <BlobEntry>]}
|
||||
#
|
||||
attr_reader :tree_map
|
||||
|
||||
# Gets a Hash cache of commit SHAs to the Grit::Commit instance.
|
||||
#
|
||||
# {"abcd123" => <Grit::Commit>}
|
||||
#
|
||||
attr_reader :commit_map
|
||||
|
||||
# Checks to see if the given String is a 40 character hex SHA.
|
||||
#
|
||||
# str - Possible String SHA.
|
||||
#
|
||||
# Returns true if the String is a SHA, or false.
|
||||
def sha?(str)
|
||||
!!(str =~ /^[0-9a-f]{40}$/)
|
||||
end
|
||||
|
||||
# Looks up the Git SHA for the given Git ref.
|
||||
#
|
||||
# ref - String Git ref.
|
||||
#
|
||||
# Returns a String SHA.
|
||||
def ref_to_sha!(ref)
|
||||
@repo.git.rev_list({:max_count=>1}, ref)
|
||||
rescue Grit::GitRuby::Repository::NoSuchShaFound
|
||||
end
|
||||
|
||||
# Looks up the Git blobs for a given commit.
|
||||
#
|
||||
# sha - String commit SHA.
|
||||
#
|
||||
# Returns an Array of BlobEntry instances.
|
||||
def tree!(sha)
|
||||
tree = @repo.git.native(:ls_tree,
|
||||
{:r => true, :l => true, :z => true}, sha)
|
||||
if tree.respond_to?(:force_encoding)
|
||||
tree.force_encoding("UTF-8")
|
||||
end
|
||||
items = tree.split("\0").inject([]) do |memo, line|
|
||||
memo << parse_tree_line(line)
|
||||
end
|
||||
|
||||
if dir = @page_file_dir
|
||||
regex = /^#{dir}\//
|
||||
items.select { |i| i.path =~ regex }
|
||||
else
|
||||
items
|
||||
end
|
||||
end
|
||||
|
||||
# Reads the content from the Git db at the given SHA.
|
||||
#
|
||||
# sha - The String SHA.
|
||||
#
|
||||
# Returns the String content of the Git object.
|
||||
def cat_file!(sha)
|
||||
@repo.git.cat_file({:p => true}, sha)
|
||||
end
|
||||
|
||||
# Reads a Git commit.
|
||||
#
|
||||
# sha - The string SHA of the Git commit.
|
||||
#
|
||||
# Returns a Grit::Commit.
|
||||
def commit!(sha)
|
||||
@repo.commit(sha)
|
||||
end
|
||||
|
||||
# Attempts to get the given data from a cache. If it doesn't exist, it'll
|
||||
# pass the results of the yielded block to the cache for future accesses.
|
||||
#
|
||||
# name - The cache prefix used in building the full cache key.
|
||||
# key - The unique cache key suffix, usually a String Git SHA.
|
||||
#
|
||||
# Yields a block to pass to the cache.
|
||||
# Returns the cached result.
|
||||
def get_cache(name, key)
|
||||
cache = instance_variable_get("@#{name}_map")
|
||||
value = cache[key]
|
||||
if value.nil? && block_given?
|
||||
set_cache(name, key, value = yield)
|
||||
end
|
||||
value == :_nil ? nil : value
|
||||
end
|
||||
|
||||
# Writes some data to the internal cache.
|
||||
#
|
||||
# name - The cache prefix used in building the full cache key.
|
||||
# key - The unique cache key suffix, usually a String Git SHA.
|
||||
# value - The value to write to the cache.
|
||||
#
|
||||
# Returns nothing.
|
||||
def set_cache(name, key, value)
|
||||
cache = instance_variable_get("@#{name}_map")
|
||||
cache[key] = value || :_nil
|
||||
end
|
||||
|
||||
# Parses a line of output from the `ls-tree` command.
|
||||
#
|
||||
# line - A String line of output:
|
||||
# "100644 blob 839c2291b30495b9a882c17d08254d3c90d8fb53 Home.md"
|
||||
#
|
||||
# Returns an Array of BlobEntry instances.
|
||||
def parse_tree_line(line)
|
||||
mode, type, sha, size, *name = line.split(/\s+/)
|
||||
BlobEntry.new(sha, name.join(' '), size.to_i)
|
||||
end
|
||||
|
||||
# Decode octal sequences (\NNN) in tree path names.
|
||||
#
|
||||
# path - String path name.
|
||||
#
|
||||
# Returns a decoded String.
|
||||
def decode_git_path(path)
|
||||
if path[0] == ?" && path[-1] == ?"
|
||||
path = path[1...-1]
|
||||
path.gsub!(/\\\d{3}/) { |m| m[1..-1].to_i(8).chr }
|
||||
end
|
||||
path.gsub!(/\\[rn"\\]/) { |m| eval(%("#{m.to_s}")) }
|
||||
path
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,50 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
require 'gemojione'
|
||||
|
||||
module Precious
|
||||
module Helpers
|
||||
|
||||
EMOJI_PATHNAME = Pathname.new(Gemojione.images_path).freeze
|
||||
|
||||
def sanitize_empty_params(param)
|
||||
[nil, ''].include?(param) ? nil : CGI.unescape(param)
|
||||
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)
|
||||
return url if url.nil?
|
||||
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
|
||||
@@ -1,493 +0,0 @@
|
||||
require 'digest/sha1'
|
||||
require 'cgi'
|
||||
require 'pygments'
|
||||
require 'base64'
|
||||
|
||||
module Gollum
|
||||
|
||||
class Markup
|
||||
# Initialize a new Markup object.
|
||||
#
|
||||
# page - The Gollum::Page.
|
||||
#
|
||||
# Returns a new Gollum::Markup object, ready for rendering.
|
||||
def initialize(page)
|
||||
@wiki = page.wiki
|
||||
@name = page.filename
|
||||
@data = page.text_data
|
||||
@version = page.version.id if page.version
|
||||
@format = page.format
|
||||
@dir = ::File.dirname(page.path)
|
||||
@tagmap = {}
|
||||
@codemap = {}
|
||||
@texmap = {}
|
||||
@wsdmap = {}
|
||||
@premap = {}
|
||||
end
|
||||
|
||||
# Render the content with Gollum wiki syntax on top of the file's own
|
||||
# markup language.
|
||||
#
|
||||
# no_follow - Boolean that determines if rel="nofollow" is added to all
|
||||
# <a> tags.
|
||||
# encoding - Encoding Constant or String.
|
||||
#
|
||||
# Returns the formatted String content.
|
||||
def render(no_follow = false, encoding = nil)
|
||||
sanitize = no_follow ?
|
||||
@wiki.history_sanitizer :
|
||||
@wiki.sanitizer
|
||||
|
||||
data = @data.dup
|
||||
data = extract_code(data)
|
||||
data = extract_tex(data)
|
||||
data = extract_wsd(data)
|
||||
data = extract_tags(data)
|
||||
begin
|
||||
data = GitHub::Markup.render(@name, data)
|
||||
if data.nil?
|
||||
raise "There was an error converting #{@name} to HTML."
|
||||
end
|
||||
rescue Object => e
|
||||
data = %{<p class="gollum-error">#{e.message}</p>}
|
||||
end
|
||||
data = process_tags(data)
|
||||
data = process_code(data, encoding)
|
||||
if sanitize || block_given?
|
||||
doc = Nokogiri::HTML::DocumentFragment.parse(data)
|
||||
doc = sanitize.clean_node!(doc) if sanitize
|
||||
yield doc if block_given?
|
||||
data = doc.to_html
|
||||
end
|
||||
data = process_tex(data)
|
||||
data = process_wsd(data)
|
||||
data.gsub!(/<p><\/p>/, '')
|
||||
data
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# TeX
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
# Extract all TeX into the texmap and replace with placeholders.
|
||||
#
|
||||
# data - The raw String data.
|
||||
#
|
||||
# Returns the placeholder'd String data.
|
||||
def extract_tex(data)
|
||||
data.gsub(/\\\[\s*(.*?)\s*\\\]/m) do
|
||||
tag = CGI.escapeHTML($1)
|
||||
id = Digest::SHA1.hexdigest(tag)
|
||||
@texmap[id] = [:block, tag]
|
||||
id
|
||||
end.gsub(/\\\(\s*(.*?)\s*\\\)/m) do
|
||||
tag = CGI.escapeHTML($1)
|
||||
id = Digest::SHA1.hexdigest(tag)
|
||||
@texmap[id] = [:inline, tag]
|
||||
id
|
||||
end
|
||||
end
|
||||
|
||||
# Process all TeX from the texmap and replace the placeholders with the
|
||||
# final markup.
|
||||
#
|
||||
# data - The String data (with placeholders).
|
||||
#
|
||||
# Returns the marked up String data.
|
||||
def process_tex(data)
|
||||
@texmap.each do |id, spec|
|
||||
type, tex = *spec
|
||||
out = %{<img src="#{::File.join(@wiki.base_path, '_tex.png')}?type=#{type}&data=#{Base64.encode64(tex).chomp}" alt="#{CGI.escapeHTML(tex)}">}
|
||||
data.gsub!(id, out)
|
||||
end
|
||||
data
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# Tags
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
# Extract all tags into the tagmap and replace with placeholders.
|
||||
#
|
||||
# data - The raw String data.
|
||||
#
|
||||
# Returns the placeholder'd String data.
|
||||
def extract_tags(data)
|
||||
if @format == :asciidoc
|
||||
return data
|
||||
end
|
||||
data.gsub!(/(.?)\[\[(.+?)\]\]([^\[]?)/m) do
|
||||
if $1 == "'" && $3 != "'"
|
||||
"[[#{$2}]]#{$3}"
|
||||
elsif $2.include?('][')
|
||||
if $2[0..4] == 'file:'
|
||||
pre = $1
|
||||
post = $3
|
||||
parts = $2.split('][')
|
||||
parts[0][0..4] = ""
|
||||
link = "#{parts[1]}|#{parts[0].sub(/\.org/,'')}"
|
||||
id = Digest::SHA1.hexdigest(link)
|
||||
@tagmap[id] = link
|
||||
"#{pre}#{id}#{post}"
|
||||
else
|
||||
$&
|
||||
end
|
||||
else
|
||||
id = Digest::SHA1.hexdigest($2)
|
||||
@tagmap[id] = $2
|
||||
"#{$1}#{id}#{$3}"
|
||||
end
|
||||
end
|
||||
data
|
||||
end
|
||||
|
||||
# Process all tags from the tagmap and replace the placeholders with the
|
||||
# final markup.
|
||||
#
|
||||
# data - The String data (with placeholders).
|
||||
#
|
||||
# Returns the marked up String data.
|
||||
def process_tags(data)
|
||||
@tagmap.each do |id, tag|
|
||||
data.gsub!(id, process_tag(tag))
|
||||
end
|
||||
data
|
||||
end
|
||||
|
||||
# Process a single tag into its final HTML form.
|
||||
#
|
||||
# tag - The String tag contents (the stuff inside the double
|
||||
# brackets).
|
||||
#
|
||||
# Returns the String HTML version of the tag.
|
||||
def process_tag(tag)
|
||||
if html = process_image_tag(tag)
|
||||
html
|
||||
elsif html = process_file_link_tag(tag)
|
||||
html
|
||||
else
|
||||
process_page_link_tag(tag)
|
||||
end
|
||||
end
|
||||
|
||||
# Attempt to process the tag as an image tag.
|
||||
#
|
||||
# tag - The String tag contents (the stuff inside the double brackets).
|
||||
#
|
||||
# Returns the String HTML if the tag is a valid image tag or nil
|
||||
# if it is not.
|
||||
def process_image_tag(tag)
|
||||
parts = tag.split('|')
|
||||
return if parts.size.zero?
|
||||
|
||||
name = parts[0].strip
|
||||
path = if file = find_file(name)
|
||||
::File.join @wiki.base_path, file.path
|
||||
elsif name =~ /^https?:\/\/.+(jpg|png|gif|svg|bmp)$/i
|
||||
name
|
||||
end
|
||||
|
||||
if path
|
||||
opts = parse_image_tag_options(tag)
|
||||
|
||||
containered = false
|
||||
|
||||
classes = [] # applied to whatever the outermost container is
|
||||
attrs = [] # applied to the image
|
||||
|
||||
align = opts['align']
|
||||
if opts['float']
|
||||
containered = true
|
||||
align ||= 'left'
|
||||
if %w{left right}.include?(align)
|
||||
classes << "float-#{align}"
|
||||
end
|
||||
elsif %w{top texttop middle absmiddle bottom absbottom baseline}.include?(align)
|
||||
attrs << %{align="#{align}"}
|
||||
elsif align
|
||||
if %w{left center right}.include?(align)
|
||||
containered = true
|
||||
classes << "align-#{align}"
|
||||
end
|
||||
end
|
||||
|
||||
if width = opts['width']
|
||||
if width =~ /^\d+(\.\d+)?(em|px)$/
|
||||
attrs << %{width="#{width}"}
|
||||
end
|
||||
end
|
||||
|
||||
if height = opts['height']
|
||||
if height =~ /^\d+(\.\d+)?(em|px)$/
|
||||
attrs << %{height="#{height}"}
|
||||
end
|
||||
end
|
||||
|
||||
if alt = opts['alt']
|
||||
attrs << %{alt="#{alt}"}
|
||||
end
|
||||
|
||||
attr_string = attrs.size > 0 ? attrs.join(' ') + ' ' : ''
|
||||
|
||||
if opts['frame'] || containered
|
||||
classes << 'frame' if opts['frame']
|
||||
%{<span class="#{classes.join(' ')}">} +
|
||||
%{<span>} +
|
||||
%{<img src="#{path}" #{attr_string}/>} +
|
||||
(alt ? %{<span>#{alt}</span>} : '') +
|
||||
%{</span>} +
|
||||
%{</span>}
|
||||
else
|
||||
%{<img src="#{path}" #{attr_string}/>}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Parse any options present on the image tag and extract them into a
|
||||
# Hash of option names and values.
|
||||
#
|
||||
# tag - The String tag contents (the stuff inside the double brackets).
|
||||
#
|
||||
# Returns the options Hash:
|
||||
# key - The String option name.
|
||||
# val - The String option value or true if it is a binary option.
|
||||
def parse_image_tag_options(tag)
|
||||
tag.split('|')[1..-1].inject({}) do |memo, attr|
|
||||
parts = attr.split('=').map { |x| x.strip }
|
||||
memo[parts[0]] = (parts.size == 1 ? true : parts[1])
|
||||
memo
|
||||
end
|
||||
end
|
||||
|
||||
# Attempt to process the tag as a file link tag.
|
||||
#
|
||||
# tag - The String tag contents (the stuff inside the double
|
||||
# brackets).
|
||||
#
|
||||
# Returns the String HTML if the tag is a valid file link tag or nil
|
||||
# if it is not.
|
||||
def process_file_link_tag(tag)
|
||||
parts = tag.split('|')
|
||||
return if parts.size.zero?
|
||||
|
||||
name = parts[0].strip
|
||||
path = parts[1] && parts[1].strip
|
||||
path = if path && file = find_file(path)
|
||||
::File.join @wiki.base_path, file.path
|
||||
elsif path =~ %r{^https?://}
|
||||
path
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
||||
if name && path && file
|
||||
%{<a href="#{::File.join @wiki.base_path, file.path}">#{name}</a>}
|
||||
elsif name && path
|
||||
%{<a href="#{path}">#{name}</a>}
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
# Attempt to process the tag as a page link tag.
|
||||
#
|
||||
# tag - The String tag contents (the stuff inside the double
|
||||
# brackets).
|
||||
#
|
||||
# Returns the String HTML if the tag is a valid page link tag or nil
|
||||
# if it is not.
|
||||
def process_page_link_tag(tag)
|
||||
parts = tag.split('|')
|
||||
parts.reverse! if @format == :mediawiki
|
||||
|
||||
name, page_name = *parts.compact.map(&:strip)
|
||||
cname = @wiki.page_class.cname(page_name || name)
|
||||
|
||||
if name =~ %r{^https?://} && page_name.nil?
|
||||
%{<a href="#{name}">#{name}</a>}
|
||||
else
|
||||
presence = "absent"
|
||||
link_name = cname
|
||||
page, extra = find_page_from_name(cname)
|
||||
if page
|
||||
link_name = @wiki.page_class.cname(page.name)
|
||||
presence = "present"
|
||||
end
|
||||
link = ::File.join(@wiki.base_path, CGI.escape(link_name))
|
||||
%{<a class="internal #{presence}" href="#{link}#{extra}">#{name}</a>}
|
||||
end
|
||||
end
|
||||
|
||||
# Find the given file in the repo.
|
||||
#
|
||||
# name - The String absolute or relative path of the file.
|
||||
#
|
||||
# Returns the Gollum::File or nil if none was found.
|
||||
def find_file(name)
|
||||
if name =~ /^\//
|
||||
@wiki.file(name[1..-1], @version)
|
||||
else
|
||||
path = @dir == '.' ? name : ::File.join(@dir, name)
|
||||
@wiki.file(path, @version)
|
||||
end
|
||||
end
|
||||
|
||||
# Find a page from a given cname. If the page has an anchor (#) and has
|
||||
# no match, strip the anchor and try again.
|
||||
#
|
||||
# cname - The String canonical page name.
|
||||
#
|
||||
# Returns a Gollum::Page instance if a page is found, or an Array of
|
||||
# [Gollum::Page, String extra] if a page without the extra anchor data
|
||||
# is found.
|
||||
def find_page_from_name(cname)
|
||||
if page = @wiki.page(cname)
|
||||
return page
|
||||
end
|
||||
if pos = cname.index('#')
|
||||
[@wiki.page(cname[0...pos]), cname[pos..-1]]
|
||||
end
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# Code
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
# Extract all code blocks into the codemap and replace with placeholders.
|
||||
#
|
||||
# data - The raw String data.
|
||||
#
|
||||
# Returns the placeholder'd String data.
|
||||
def extract_code(data)
|
||||
data.gsub!(/^([ \t]*)``` ?([^\r\n]+)?\r?\n(.+?)\r?\n\1```\r?$/m) do
|
||||
id = Digest::SHA1.hexdigest("#{$2}.#{$3}")
|
||||
cached = check_cache(:code, id)
|
||||
@codemap[id] = cached ?
|
||||
{ :output => cached } :
|
||||
{ :lang => $2, :code => $3, :indent => $1 }
|
||||
"#{$1}#{id}" # print the SHA1 ID with the proper indentation
|
||||
end
|
||||
data
|
||||
end
|
||||
|
||||
# Remove the leading space from a code block. Leading space
|
||||
# is only removed if every single line in the block has leading
|
||||
# whitespace.
|
||||
#
|
||||
# code - The code block to remove spaces from
|
||||
# regex - A regex to match whitespace
|
||||
def remove_leading_space(code, regex)
|
||||
if code.lines.all? { |line| line =~ /\A\r?\n\Z/ || line =~ regex }
|
||||
code.gsub!(regex, '')
|
||||
end
|
||||
end
|
||||
|
||||
# Process all code from the codemap and replace the placeholders with the
|
||||
# final HTML.
|
||||
#
|
||||
# data - The String data (with placeholders).
|
||||
# encoding - Encoding Constant or String.
|
||||
#
|
||||
# Returns the marked up String data.
|
||||
def process_code(data, encoding = nil)
|
||||
return data if data.nil? || data.size.zero? || @codemap.size.zero?
|
||||
|
||||
blocks = []
|
||||
@codemap.each do |id, spec|
|
||||
next if spec[:output] # cached
|
||||
|
||||
code = spec[:code]
|
||||
|
||||
remove_leading_space(code, /^#{spec[:indent]}/m)
|
||||
remove_leading_space(code, /^( |\t)/m)
|
||||
|
||||
blocks << [spec[:lang], code]
|
||||
end
|
||||
|
||||
highlighted = begin
|
||||
encoding ||= 'utf-8'
|
||||
blocks.map { |lang, code|
|
||||
Pygments.highlight(code, :lexer => lang, :options => {:encoding => encoding.to_s})
|
||||
}
|
||||
rescue ::RubyPython::PythonError
|
||||
[]
|
||||
end
|
||||
|
||||
@codemap.each do |id, spec|
|
||||
body = spec[:output] || begin
|
||||
if (body = highlighted.shift.to_s).size > 0
|
||||
update_cache(:code, id, body)
|
||||
body
|
||||
else
|
||||
"<pre><code>#{CGI.escapeHTML(spec[:code])}</code></pre>"
|
||||
end
|
||||
end
|
||||
data.gsub!(id, body)
|
||||
end
|
||||
|
||||
data
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# Sequence Diagrams
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
# Extract all sequence diagram blocks into the wsdmap and replace with
|
||||
# placeholders.
|
||||
#
|
||||
# data - The raw String data.
|
||||
#
|
||||
# Returns the placeholder'd String data.
|
||||
def extract_wsd(data)
|
||||
data.gsub(/^\{\{\{ ?(.+?)\r?\n(.+?)\r?\n\}\}\}\r?$/m) do
|
||||
id = Digest::SHA1.hexdigest($2)
|
||||
@wsdmap[id] = { :style => $1, :code => $2 }
|
||||
id
|
||||
end
|
||||
end
|
||||
|
||||
# Process all diagrams from the wsdmap and replace the placeholders with
|
||||
# the final HTML.
|
||||
#
|
||||
# data - The String data (with placeholders).
|
||||
#
|
||||
# Returns the marked up String data.
|
||||
def process_wsd(data)
|
||||
@wsdmap.each do |id, spec|
|
||||
style = spec[:style]
|
||||
code = spec[:code]
|
||||
data.gsub!(id, Gollum::WebSequenceDiagram.new(code, style).to_tag)
|
||||
end
|
||||
data
|
||||
end
|
||||
|
||||
# Hook for getting the formatted value of extracted tag data.
|
||||
#
|
||||
# type - Symbol value identifying what type of data is being extracted.
|
||||
# id - String SHA1 hash of original extracted tag data.
|
||||
#
|
||||
# Returns the String cached formatted data, or nil.
|
||||
def check_cache(type, id)
|
||||
end
|
||||
|
||||
# Hook for caching the formatted value of extracted tag data.
|
||||
#
|
||||
# type - Symbol value identifying what type of data is being extracted.
|
||||
# id - String SHA1 hash of original extracted tag data.
|
||||
# data - The String formatted value to be cached.
|
||||
#
|
||||
# Returns nothing.
|
||||
def update_cache(type, id, data)
|
||||
end
|
||||
end
|
||||
|
||||
MarkupGFM = Markup
|
||||
end
|
||||
@@ -1,408 +0,0 @@
|
||||
module Gollum
|
||||
class Page
|
||||
include Pagination
|
||||
|
||||
Wiki.page_class = self
|
||||
|
||||
VALID_PAGE_RE = /^(.+)\.(md|mkdn?|mdown|markdown|textile|rdoc|org|creole|re?st(\.txt)?|asciidoc|pod|(media)?wiki)$/i
|
||||
FORMAT_NAMES = { :markdown => "Markdown",
|
||||
:textile => "Textile",
|
||||
:rdoc => "RDoc",
|
||||
:org => "Org-mode",
|
||||
:creole => "Creole",
|
||||
:rest => "reStructuredText",
|
||||
:asciidoc => "AsciiDoc",
|
||||
:mediawiki => "MediaWiki",
|
||||
:pod => "Pod" }
|
||||
|
||||
# Sets a Boolean determing whether this page is a historical version.
|
||||
#
|
||||
# Returns nothing.
|
||||
attr_writer :historical
|
||||
|
||||
# Checks if a filename has a valid extension understood by GitHub::Markup.
|
||||
#
|
||||
# filename - String filename, like "Home.md".
|
||||
#
|
||||
# Returns the matching String basename of the file without the extension.
|
||||
def self.valid_filename?(filename)
|
||||
filename && filename.to_s =~ VALID_PAGE_RE && $1
|
||||
end
|
||||
|
||||
# Checks if a filename has a valid extension understood by GitHub::Markup.
|
||||
# Also, checks if the filename has no "_" in the front (such as
|
||||
# _Footer.md).
|
||||
#
|
||||
# filename - String filename, like "Home.md".
|
||||
#
|
||||
# Returns the matching String basename of the file without the extension.
|
||||
def self.valid_page_name?(filename)
|
||||
match = valid_filename?(filename)
|
||||
filename =~ /^_/ ? false : match
|
||||
end
|
||||
|
||||
# Public: The format of a given filename.
|
||||
#
|
||||
# filename - The String filename.
|
||||
#
|
||||
# Returns the Symbol format of the page. One of:
|
||||
# [ :markdown | :textile | :rdoc | :org | :rest | :asciidoc | :pod |
|
||||
# :roff ]
|
||||
def self.format_for(filename)
|
||||
case filename.to_s
|
||||
when /\.(md|mkdn?|mdown|markdown)$/i
|
||||
:markdown
|
||||
when /\.(textile)$/i
|
||||
:textile
|
||||
when /\.(rdoc)$/i
|
||||
:rdoc
|
||||
when /\.(org)$/i
|
||||
:org
|
||||
when /\.(creole)$/i
|
||||
:creole
|
||||
when /\.(re?st(\.txt)?)$/i
|
||||
:rest
|
||||
when /\.(asciidoc)$/i
|
||||
:asciidoc
|
||||
when /\.(pod)$/i
|
||||
:pod
|
||||
when /\.(\d)$/i
|
||||
:roff
|
||||
when /\.(media)?wiki$/i
|
||||
:mediawiki
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
# Reusable filter to turn a filename (without path) into a canonical name.
|
||||
# Strips extension, converts dashes to spaces.
|
||||
#
|
||||
# Returns the filtered String.
|
||||
def self.canonicalize_filename(filename)
|
||||
strip_filename(filename).gsub('-', ' ')
|
||||
end
|
||||
|
||||
# Reusable filter to strip extension and path from filename
|
||||
#
|
||||
# filename - The string path or filename to strip
|
||||
#
|
||||
# Returns the stripped String.
|
||||
def self.strip_filename(filename)
|
||||
::File.basename(filename, ::File.extname(filename))
|
||||
end
|
||||
|
||||
# Public: Initialize a page.
|
||||
#
|
||||
# wiki - The Gollum::Wiki in question.
|
||||
#
|
||||
# Returns a newly initialized Gollum::Page.
|
||||
def initialize(wiki)
|
||||
@wiki = wiki
|
||||
@blob = @footer = @sidebar = nil
|
||||
end
|
||||
|
||||
# Public: The on-disk filename of the page including extension.
|
||||
#
|
||||
# Returns the String name.
|
||||
def filename
|
||||
@blob && @blob.name
|
||||
end
|
||||
|
||||
# Public: The on-disk filename of the page with extension stripped.
|
||||
#
|
||||
# Returns the String name.
|
||||
def filename_stripped
|
||||
self.class.strip_filename(filename)
|
||||
end
|
||||
|
||||
# Public: The canonical page name without extension, and dashes converted
|
||||
# to spaces.
|
||||
#
|
||||
# Returns the String name.
|
||||
def name
|
||||
self.class.canonicalize_filename(filename)
|
||||
end
|
||||
|
||||
# Public: The title will be constructed from the
|
||||
# filename by stripping the extension and replacing any dashes with
|
||||
# spaces.
|
||||
#
|
||||
# Returns the fully sanitized String title.
|
||||
def title
|
||||
header = Sanitize.clean(name).strip
|
||||
end
|
||||
|
||||
# Public: The path of the page within the repo.
|
||||
#
|
||||
# Returns the String path.
|
||||
attr_reader :path
|
||||
|
||||
# Public: The raw contents of the page.
|
||||
#
|
||||
# Returns the String data.
|
||||
def raw_data
|
||||
@blob && @blob.data
|
||||
end
|
||||
|
||||
# Public: A text data encoded in specified encoding.
|
||||
#
|
||||
# encoding - An Encoding or nil
|
||||
#
|
||||
# Returns a character encoding aware String.
|
||||
def text_data(encoding=nil)
|
||||
if raw_data.respond_to?(:encoding)
|
||||
raw_data.force_encoding(encoding || Encoding::UTF_8)
|
||||
else
|
||||
raw_data
|
||||
end
|
||||
end
|
||||
|
||||
# Public: The formatted contents of the page.
|
||||
#
|
||||
# encoding - Encoding Constant or String.
|
||||
#
|
||||
# Returns the String data.
|
||||
def formatted_data(encoding = nil, &block)
|
||||
@blob && markup_class.render(historical?, encoding, &block)
|
||||
end
|
||||
|
||||
# Public: The format of the page.
|
||||
#
|
||||
# Returns the Symbol format of the page. One of:
|
||||
# [ :markdown | :textile | :rdoc | :org | :rest | :asciidoc | :pod |
|
||||
# :roff ]
|
||||
def format
|
||||
self.class.format_for(@blob.name)
|
||||
end
|
||||
|
||||
# Gets the Gollum::Markup instance that will render this page's content.
|
||||
#
|
||||
# Returns a Gollum::Markup instance.
|
||||
def markup_class
|
||||
@markup_class ||= @wiki.markup_classes[format].new(self)
|
||||
end
|
||||
|
||||
# Public: The current version of the page.
|
||||
#
|
||||
# Returns the Grit::Commit.
|
||||
attr_reader :version
|
||||
|
||||
# Public: All of the versions that have touched the Page.
|
||||
#
|
||||
# options - The options Hash:
|
||||
# :page - The Integer page number (default: 1).
|
||||
# :per_page - The Integer max count of items to return.
|
||||
# :follow - Follow's a file across renames, but falls back
|
||||
# to a slower Grit native call. (default: false)
|
||||
#
|
||||
# Returns an Array of Grit::Commit.
|
||||
def versions(options = {})
|
||||
if options[:follow]
|
||||
options[:pretty] = 'raw'
|
||||
options.delete :max_count
|
||||
options.delete :skip
|
||||
log = @wiki.repo.git.native "log", options, @wiki.ref, "--", @path
|
||||
Grit::Commit.list_from_string(@wiki.repo, log)
|
||||
else
|
||||
@wiki.repo.log(@wiki.ref, @path, log_pagination_options(options))
|
||||
end
|
||||
end
|
||||
|
||||
# Public: The footer Page.
|
||||
#
|
||||
# Returns the footer Page or nil if none exists.
|
||||
def footer
|
||||
@footer ||= find_sub_page(:footer)
|
||||
end
|
||||
|
||||
# Public: The sidebar Page.
|
||||
#
|
||||
# Returns the sidebar Page or nil if none exists.
|
||||
def sidebar
|
||||
@sidebar ||= find_sub_page(:sidebar)
|
||||
end
|
||||
|
||||
# Gets a Boolean determining whether this page is a historical version.
|
||||
# Historical pages are pulled using exact SHA hashes and format all links
|
||||
# with rel="nofollow"
|
||||
#
|
||||
# Returns true if the page is pulled from a named branch or tag, or false.
|
||||
def historical?
|
||||
!!@historical
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# Class Methods
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
# Convert a human page name into a canonical page name.
|
||||
#
|
||||
# name - The String human page name.
|
||||
# char_white_sub - Substitution for whitespace
|
||||
# char_other_sub - Substitution for other special chars
|
||||
#
|
||||
# Examples
|
||||
#
|
||||
# Page.cname("Bilbo Baggins")
|
||||
# # => 'Bilbo-Baggins'
|
||||
#
|
||||
# Page.cname("Bilbo Baggins",'_')
|
||||
# # => 'Bilbo_Baggins'
|
||||
#
|
||||
# Returns the String canonical name.
|
||||
def self.cname(name, char_white_sub = '-', char_other_sub = '-')
|
||||
name.respond_to?(:gsub) ?
|
||||
name.gsub(%r{\s},char_white_sub).gsub(%r{[/<>+]}, char_other_sub) :
|
||||
''
|
||||
end
|
||||
|
||||
# Convert a format Symbol into an extension String.
|
||||
#
|
||||
# format - The format Symbol.
|
||||
#
|
||||
# Returns the String extension (no leading period).
|
||||
def self.format_to_ext(format)
|
||||
case format
|
||||
when :markdown then 'md'
|
||||
when :textile then 'textile'
|
||||
when :rdoc then 'rdoc'
|
||||
when :org then 'org'
|
||||
when :creole then 'creole'
|
||||
when :rest then 'rest'
|
||||
when :asciidoc then 'asciidoc'
|
||||
when :pod then 'pod'
|
||||
when :mediawiki then 'mediawiki'
|
||||
end
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# Internal Methods
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
# The underlying wiki repo.
|
||||
#
|
||||
# Returns the Gollum::Wiki containing the page.
|
||||
attr_reader :wiki
|
||||
|
||||
# Set the Grit::Commit version of the page.
|
||||
#
|
||||
# Returns nothing.
|
||||
attr_writer :version
|
||||
|
||||
# Find a page in the given Gollum repo.
|
||||
#
|
||||
# name - The human or canonical String page name to find.
|
||||
# version - The String version ID to find.
|
||||
#
|
||||
# Returns a Gollum::Page or nil if the page could not be found.
|
||||
def find(name, version)
|
||||
map = @wiki.tree_map_for(version.to_s)
|
||||
if page = find_page_in_tree(map, name)
|
||||
page.version = version.is_a?(Grit::Commit) ?
|
||||
version : @wiki.commit_for(version)
|
||||
page.historical = page.version.to_s == version.to_s
|
||||
page
|
||||
end
|
||||
rescue Grit::GitRuby::Repository::NoSuchShaFound
|
||||
end
|
||||
|
||||
# Find a page in a given tree.
|
||||
#
|
||||
# map - The Array tree map from Wiki#tree_map.
|
||||
# name - The canonical String page name.
|
||||
# checked_dir - Optional String of the directory a matching page needs
|
||||
# to be in. The string should
|
||||
#
|
||||
# Returns a Gollum::Page or nil if the page could not be found.
|
||||
def find_page_in_tree(map, name, checked_dir = nil)
|
||||
return nil if !map || name.to_s.empty?
|
||||
if checked_dir = BlobEntry.normalize_dir(checked_dir)
|
||||
checked_dir.downcase!
|
||||
end
|
||||
|
||||
map.each do |entry|
|
||||
next if entry.name.to_s.empty?
|
||||
next unless checked_dir.nil? || entry.dir.downcase == checked_dir
|
||||
next unless page_match(name, entry.name)
|
||||
return entry.page(@wiki, @version)
|
||||
end
|
||||
|
||||
return nil # nothing was found
|
||||
end
|
||||
|
||||
# Populate the Page with information from the Blob.
|
||||
#
|
||||
# blob - The Grit::Blob that contains the info.
|
||||
# path - The String directory path of the page file.
|
||||
#
|
||||
# Returns the populated Gollum::Page.
|
||||
def populate(blob, path=nil)
|
||||
@blob = blob
|
||||
@path = "#{path}/#{blob.name}"[1..-1]
|
||||
self
|
||||
end
|
||||
|
||||
# The full directory path for the given tree.
|
||||
#
|
||||
# treemap - The Hash treemap containing parentage information.
|
||||
# tree - The Grit::Tree for which to compute the path.
|
||||
#
|
||||
# Returns the String path.
|
||||
def tree_path(treemap, tree)
|
||||
if ptree = treemap[tree]
|
||||
tree_path(treemap, ptree) + '/' + tree.name
|
||||
else
|
||||
''
|
||||
end
|
||||
end
|
||||
|
||||
# Compare the canonicalized versions of the two names.
|
||||
#
|
||||
# name - The human or canonical String page name.
|
||||
# filename - the String filename on disk (including extension).
|
||||
#
|
||||
# Returns a Boolean.
|
||||
def page_match(name, filename)
|
||||
if match = self.class.valid_filename?(filename)
|
||||
@wiki.ws_subs.each do |sub|
|
||||
return true if Page.cname(name).downcase == Page.cname(match, sub).downcase
|
||||
end
|
||||
end
|
||||
false
|
||||
end
|
||||
|
||||
# Loads a sub page. Sub page nanes (footers) are prefixed with
|
||||
# an underscore to distinguish them from other Pages.
|
||||
#
|
||||
# name - String page name.
|
||||
#
|
||||
# Returns the Page or nil if none exists.
|
||||
def find_sub_page(name)
|
||||
return nil unless self.version
|
||||
return nil if self.filename =~ /^_/
|
||||
name = "_#{name.to_s.capitalize}"
|
||||
return nil if page_match(name, self.filename)
|
||||
|
||||
dirs = self.path.split('/')
|
||||
dirs.pop
|
||||
map = @wiki.tree_map_for(self.version.id)
|
||||
while !dirs.empty?
|
||||
if page = find_page_in_tree(map, name, dirs.join('/'))
|
||||
return page
|
||||
end
|
||||
dirs.pop
|
||||
end
|
||||
|
||||
find_page_in_tree(map, name, '')
|
||||
end
|
||||
|
||||
def inspect
|
||||
%(#<#{self.class.name}:#{object_id} #{name} (#{format}) @wiki=#{@wiki.repo.path.inspect}>)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,61 +0,0 @@
|
||||
module Gollum
|
||||
module Pagination
|
||||
def self.included(klass)
|
||||
klass.extend ClassMethods
|
||||
class << klass
|
||||
# Default Integer max count of items to return in git commands.
|
||||
attr_accessor :per_page
|
||||
end
|
||||
klass.per_page = 30
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
# Turns a page number into an offset number for the git skip option.
|
||||
#
|
||||
# page - Integer page number.
|
||||
#
|
||||
# Returns an Integer.
|
||||
def page_to_skip(page)
|
||||
([1, page.to_i].max - 1) * per_page
|
||||
end
|
||||
|
||||
# Fills in git-specific options for the log command using simple
|
||||
# pagination options.
|
||||
#
|
||||
# options - Hash of options:
|
||||
# page - Optional Integer page number (default: 1)
|
||||
# per_page - Optional Integer max count of items to return.
|
||||
# Defaults to #per_class class method.
|
||||
#
|
||||
# Returns Hash with :max_count and :skip keys.
|
||||
def log_pagination_options(options = {})
|
||||
skip = page_to_skip(options.delete(:page))
|
||||
options[:max_count] = [options.delete(:per_page).to_i, per_page].max
|
||||
options[:skip] = skip if skip > 0
|
||||
options
|
||||
end
|
||||
end
|
||||
|
||||
# Turns a page number into an offset number for the git skip option.
|
||||
#
|
||||
# page - Integer page number.
|
||||
#
|
||||
# Returns an Integer.
|
||||
def page_to_skip(page)
|
||||
self.class.page_to_skip(page)
|
||||
end
|
||||
|
||||
# Fills in git-specific options for the log command using simple
|
||||
# pagination options.
|
||||
#
|
||||
# options - Hash of options:
|
||||
# page - Optional Integer page number (default: 1)
|
||||
# per_page - Optional Integer max count of items to return.
|
||||
# Defaults to #per_class class method.
|
||||
#
|
||||
# Returns Hash with :max_count and :skip keys.
|
||||
def log_pagination_options(options = {})
|
||||
self.class.log_pagination_options(options)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
{"files":{"app-6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd.js":{"logical_path":"app.js","mtime":"2020-08-03T18:13:54+02:00","size":136032,"digest":"6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd","integrity":"sha256-bpJeOKEqQMT6ngQAzIdOD0+Xtm/euQoUTepSfbtUT70="},"editor-b2c10f22ef6ca1e120956a2d11ff4ca19ac44d7e7240f5cc43ec949184d8b708.js":{"logical_path":"editor.js","mtime":"2020-08-03T18:13:54+02:00","size":747273,"digest":"b2c10f22ef6ca1e120956a2d11ff4ca19ac44d7e7240f5cc43ec949184d8b708","integrity":"sha256-ssEPIu9soeEglWotEf9MoZrETX5yQPXMQ+yUkYTYtwg="},"app-b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7.css":{"logical_path":"app.css","mtime":"2020-03-30T11:12:22+02:00","size":298111,"digest":"b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7","integrity":"sha256-sgXlk6MPHMAFTi6e2fyK82WNjvSmK5cIwg8gRWDe77c="},"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css":{"logical_path":"criticmarkup.css","mtime":"2020-03-29T22:28:51+02:00","size":646,"digest":"31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4","integrity":"sha256-Ma5dMoK7uOe3w8mRfp+2jjMVprSnXabOxI0huIRpBcQ="},"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css":{"logical_path":"print.css","mtime":"2020-03-30T11:12:22+02:00","size":75,"digest":"512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb","integrity":"sha256-USSYw2i+DT+xuhBd+oQomuSDgOyfy++Ui9TiOwsJW/s="}},"assets":{"app.js":"app-6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd.js","editor.js":"editor-b2c10f22ef6ca1e120956a2d11ff4ca19ac44d7e7240f5cc43ec949184d8b708.js","app.css":"app-b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7.css","criticmarkup.css":"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css","print.css":"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css"}}
|
||||
+5
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
+21
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
+1
@@ -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}
|
||||
BIN
Binary file not shown.
+24
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
+1
@@ -0,0 +1 @@
|
||||
div#footer{display:none}nav.actions{display:none}.breadcrumb{display:none}
|
||||
BIN
Binary file not shown.
@@ -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
|
||||
|
||||
+202
@@ -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.
|
||||
File diff suppressed because one or more lines are too long
+75
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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");
|
||||
+19
@@ -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");
|
||||
File diff suppressed because one or more lines are too long
@@ -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);
|
||||
File diff suppressed because one or more lines are too long
+19
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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");
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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");
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user