├── .gitignore ├── LICENSE ├── README.md ├── assets ├── banner-1544×500.png ├── banner-772×250.png ├── banner.svg ├── icon-128x128.png ├── icon-256x256.png └── icon.svg ├── css └── md-github.css ├── md_github.php └── readme.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | wp_test/ 3 | dist/ 4 | svn/ 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Deprecated in favor of the improved WordPress Plugin [documents-from-git](https://wordpress.org/plugins/documents-from-git/) 2 | 3 | WordPress Plugin to use Github as collaboration and version control platform for Markdown documents. 4 | 5 | Advantages: 6 | 7 | - Easy to update by external users via pull requests, minimizes the chance of stale tutorials 8 | - Write Markdown in your favorite editor and just push to your repo to update your blog 9 | 10 | It features the following shortcodes: 11 | 12 | 1. `[md_github token=YourToken url=Github URL]`: Pulls raw HTML from the `https://api.github.com/repos/` endpoint and styles it with Github markdown CSS 13 | 2. `[checkout_github token=YourToken url=Github URL]`: Displays a formatted link to the repo with the date of the latest update 14 | 3. `[history_github token=YourToken url=Github URL]`: Displays a commit history of the last 5 commits. 15 | 4. `[md_dashedbox_github token=YourToken url=Github URL]`: Displays GitHub markdown file similar to [nbconvert](https://github.com/ghandic/nbconvert). This shortcode is mutually exclusive with `md_github` and `checkout_github`. 16 | 17 | Github API is queried on every new load of the page, so that changes in the repository will immediately be reflected on your blog. Private authentication tokens help increasing the API limit to 5000 requests per hour (enough even for Digital Ocean blogs) and accessing private repositories. 18 | 19 | Idea and most of the code is based on Andy Challis' WP plugin to display Jupyter notebooks https://github.com/ghandic/nbconvert. The CSS is taken from https://github.com/sindresorhus/github-markdown-css. 20 | 21 | ## Usage 22 | 23 | All shortcodes take `token` and `url` as attribute. `token` is your private personal access token, which you can generate [here](https://github.com/settings/developers). `url` is the full URL to your document on Github. E.g. 24 | 25 | `[md_github token=1d6ef5ba426648ef7d2273aca2fc80787 url=https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_PluginBasics.md]` 26 | 27 | `[checkout_github token=1d6ef5ba426648ef7d2273aca2fc80787 url=https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_PluginBasics.md]` 28 | 29 | `[history_github token=1d6ef5ba426648ef7d2273aca2fc80787 url=https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_PluginBasics.md]` 30 | 31 | `[md_dashedbox_github token=1d6ef5ba426648ef7d2273aca2fc80787 url=https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_PluginBasics.md]` 32 | 33 | ## Demo 34 | 35 | Check it out on of our blogs: 36 | 37 | https://gis-ops.com/react-redux-leaflet-turfjs-building-a-density-based-clustering-dbscan-app-with-the-almighty-here-maps-places-api/ 38 | 39 | https://www.beyond-storage.com/wordpress-plugin-github-markdown 40 | 41 | ## Wordpress versions 42 | 43 | **Min**: v4.0 44 | 45 | **Tested up to**: 5.0.2 46 | 47 | 48 | ## Contributors 49 | - Ulf Troppens: storageulf@gmail.com 50 | -------------------------------------------------------------------------------- /assets/banner-1544×500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gis-ops/md-github-wordpress/9541cbd39414b4a894dc5c579741c5bc65537089/assets/banner-1544×500.png -------------------------------------------------------------------------------- /assets/banner-772×250.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gis-ops/md-github-wordpress/9541cbd39414b4a894dc5c579741c5bc65537089/assets/banner-772×250.png -------------------------------------------------------------------------------- /assets/banner.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 56 | 63 | 69 | 77 | 82 | 87 | 88 | + 101 | 102 | 103 | -------------------------------------------------------------------------------- /assets/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gis-ops/md-github-wordpress/9541cbd39414b4a894dc5c579741c5bc65537089/assets/icon-128x128.png -------------------------------------------------------------------------------- /assets/icon-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gis-ops/md-github-wordpress/9541cbd39414b4a894dc5c579741c5bc65537089/assets/icon-256x256.png -------------------------------------------------------------------------------- /assets/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | image/svg+xml 45 | 48 | 53 | 54 | -------------------------------------------------------------------------------- /css/md-github.css: -------------------------------------------------------------------------------- 1 | /*From https://github.com/ghandic/nbconvert/blob/master/css/nbconvert.css*/ 2 | 3 | div.md_dashedbox { 4 | position: relative; 5 | font-size: 0.75em; 6 | border: 3px dashed; 7 | padding: 10px; 8 | margin-bottom:15px 9 | } 10 | 11 | div.md_dashedbox div.markdown-github { 12 | color:white; 13 | line-height: 20px; 14 | padding: 0px 5px; 15 | position: absolute; 16 | background-color: #345; 17 | top: -3px; 18 | left: -3px; 19 | text-transform:none; 20 | font-size:1em; 21 | font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; 22 | } 23 | 24 | div.markdown-github { 25 | position: relative; 26 | font-size: 0.75em; 27 | margin-bottom:15px; 28 | display: inline-block; 29 | } 30 | 31 | div.markdown-github label.github-last-update { 32 | color:rgba(225, 246, 255, 0.45); 33 | font-weight:200; 34 | display: inline; 35 | } 36 | 37 | div.markdown-github div.markdown-github-labels label.github-link a, 38 | div.markdown-github div.markdown-github-labels label.github-link a:focus { 39 | color:#fff; 40 | -webkit-box-shadow:none; 41 | box-shadow:none; 42 | } 43 | 44 | div.markdown-github div.markdown-github-labels { 45 | color:white; 46 | line-height: 20px; 47 | padding: 0px 5px; 48 | background-color: #345; 49 | text-transform:none; 50 | font-size:1.1em; 51 | font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; 52 | } 53 | 54 | @font-face { 55 | font-family: octicons-link; 56 | src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAAizAFoAAABiAGIAznjaY2BkYGAA4in8zwXi+W2+MjCzMIDApSwvXzC97Z4Ig8N/BxYGZgcgl52BCSQKAA3jCV8CAABfAAAAAAQAAEB42mNgZGBg4f3vACQZQABIMjKgAmYAKEgBXgAAeNpjYGY6wTiBgZWBg2kmUxoDA4MPhGZMYzBi1AHygVLYQUCaawqDA4PChxhmh/8ODDEsvAwHgMKMIDnGL0x7gJQCAwMAJd4MFwAAAHjaY2BgYGaA4DAGRgYQkAHyGMF8NgYrIM3JIAGVYYDT+AEjAwuDFpBmA9KMDEwMCh9i/v8H8sH0/4dQc1iAmAkALaUKLgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==) format('woff'); 57 | } 58 | 59 | .markdown-body .octicon { 60 | display: inline-block; 61 | fill: currentColor; 62 | vertical-align: text-bottom; 63 | } 64 | 65 | .markdown-body .anchor { 66 | float: left; 67 | line-height: 1; 68 | margin-left: -20px; 69 | padding-right: 4px; 70 | } 71 | 72 | .markdown-body .anchor:focus { 73 | outline: none; 74 | } 75 | 76 | .markdown-body h1 .octicon-link, 77 | .markdown-body h2 .octicon-link, 78 | .markdown-body h3 .octicon-link, 79 | .markdown-body h4 .octicon-link, 80 | .markdown-body h5 .octicon-link, 81 | .markdown-body h6 .octicon-link { 82 | color: #1b1f23; 83 | vertical-align: middle; 84 | visibility: hidden; 85 | } 86 | 87 | .markdown-body h1:hover .anchor, 88 | .markdown-body h2:hover .anchor, 89 | .markdown-body h3:hover .anchor, 90 | .markdown-body h4:hover .anchor, 91 | .markdown-body h5:hover .anchor, 92 | .markdown-body h6:hover .anchor { 93 | text-decoration: none; 94 | } 95 | 96 | .markdown-body h1:hover .anchor .octicon-link, 97 | .markdown-body h2:hover .anchor .octicon-link, 98 | .markdown-body h3:hover .anchor .octicon-link, 99 | .markdown-body h4:hover .anchor .octicon-link, 100 | .markdown-body h5:hover .anchor .octicon-link, 101 | .markdown-body h6:hover .anchor .octicon-link { 102 | visibility: visible; 103 | } 104 | 105 | .markdown-body { 106 | -ms-text-size-adjust: 100%; 107 | -webkit-text-size-adjust: 100%; 108 | color: #24292e; 109 | line-height: 1.5; 110 | font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol; 111 | font-size: 16px; 112 | line-height: 1.5; 113 | word-wrap: break-word; 114 | } 115 | 116 | .markdown-body .pl-c { 117 | color: #6a737d; 118 | } 119 | 120 | .markdown-body .pl-c1, 121 | .markdown-body .pl-s .pl-v { 122 | color: #005cc5; 123 | } 124 | 125 | .markdown-body .pl-e, 126 | .markdown-body .pl-en { 127 | color: #6f42c1; 128 | } 129 | 130 | .markdown-body .pl-s .pl-s1, 131 | .markdown-body .pl-smi { 132 | color: #24292e; 133 | } 134 | 135 | .markdown-body .pl-ent { 136 | color: #22863a; 137 | } 138 | 139 | .markdown-body .pl-k { 140 | color: #d73a49; 141 | } 142 | 143 | .markdown-body .pl-pds, 144 | .markdown-body .pl-s, 145 | .markdown-body .pl-s .pl-pse .pl-s1, 146 | .markdown-body .pl-sr, 147 | .markdown-body .pl-sr .pl-cce, 148 | .markdown-body .pl-sr .pl-sra, 149 | .markdown-body .pl-sr .pl-sre { 150 | color: #032f62; 151 | } 152 | 153 | .markdown-body .pl-smw, 154 | .markdown-body .pl-v { 155 | color: #e36209; 156 | } 157 | 158 | .markdown-body .pl-bu { 159 | color: #b31d28; 160 | } 161 | 162 | .markdown-body .pl-ii { 163 | background-color: #b31d28; 164 | color: #fafbfc; 165 | } 166 | 167 | .markdown-body .pl-c2 { 168 | background-color: #d73a49; 169 | color: #fafbfc; 170 | } 171 | 172 | .markdown-body .pl-c2:before { 173 | content: "^M"; 174 | } 175 | 176 | .markdown-body .pl-sr .pl-cce { 177 | color: #22863a; 178 | font-weight: 700; 179 | } 180 | 181 | .markdown-body .pl-ml { 182 | color: #735c0f; 183 | } 184 | 185 | .markdown-body .pl-mh, 186 | .markdown-body .pl-mh .pl-en, 187 | .markdown-body .pl-ms { 188 | color: #005cc5; 189 | font-weight: 700; 190 | } 191 | 192 | .markdown-body .pl-mi { 193 | color: #24292e; 194 | font-style: italic; 195 | } 196 | 197 | .markdown-body .pl-mb { 198 | color: #24292e; 199 | font-weight: 700; 200 | } 201 | 202 | .markdown-body .pl-md { 203 | background-color: #ffeef0; 204 | color: #b31d28; 205 | } 206 | 207 | .markdown-body .pl-mi1 { 208 | background-color: #f0fff4; 209 | color: #22863a; 210 | } 211 | 212 | .markdown-body .pl-mc { 213 | background-color: #ffebda; 214 | color: #e36209; 215 | } 216 | 217 | .markdown-body .pl-mi2 { 218 | background-color: #005cc5; 219 | color: #f6f8fa; 220 | } 221 | 222 | .markdown-body .pl-mdr { 223 | color: #6f42c1; 224 | font-weight: 700; 225 | } 226 | 227 | .markdown-body .pl-ba { 228 | color: #586069; 229 | } 230 | 231 | .markdown-body .pl-sg { 232 | color: #959da5; 233 | } 234 | 235 | .markdown-body .pl-corl { 236 | color: #032f62; 237 | text-decoration: underline; 238 | } 239 | 240 | .markdown-body details { 241 | display: block; 242 | } 243 | 244 | .markdown-body summary { 245 | display: list-item; 246 | } 247 | 248 | .markdown-body a { 249 | background-color: transparent; 250 | } 251 | 252 | .markdown-body a:active, 253 | .markdown-body a:hover { 254 | outline-width: 0; 255 | } 256 | 257 | .markdown-body strong { 258 | font-weight: inherit; 259 | font-weight: bolder; 260 | } 261 | 262 | .markdown-body h1 { 263 | font-size: 2em; 264 | margin: .67em 0; 265 | } 266 | 267 | .markdown-body img { 268 | border-style: none; 269 | } 270 | 271 | .markdown-body code, 272 | .markdown-body kbd, 273 | .markdown-body pre { 274 | font-family: monospace,monospace; 275 | font-size: 1em; 276 | } 277 | 278 | .markdown-body hr { 279 | box-sizing: content-box; 280 | height: 0; 281 | overflow: visible; 282 | } 283 | 284 | .markdown-body input { 285 | font: inherit; 286 | margin: 0; 287 | } 288 | 289 | .markdown-body input { 290 | overflow: visible; 291 | } 292 | 293 | .markdown-body [type=checkbox] { 294 | box-sizing: border-box; 295 | padding: 0; 296 | } 297 | 298 | .markdown-body * { 299 | box-sizing: border-box; 300 | } 301 | 302 | .markdown-body input { 303 | font-family: inherit; 304 | font-size: inherit; 305 | line-height: inherit; 306 | } 307 | 308 | .markdown-body a { 309 | color: #0366d6; 310 | text-decoration: none; 311 | } 312 | 313 | .markdown-body a:hover { 314 | text-decoration: underline; 315 | } 316 | 317 | .markdown-body strong { 318 | font-weight: 600; 319 | } 320 | 321 | .markdown-body hr { 322 | background: transparent; 323 | border: 0; 324 | border-bottom: 1px solid #dfe2e5; 325 | height: 0; 326 | margin: 15px 0; 327 | overflow: hidden; 328 | } 329 | 330 | .markdown-body hr:before { 331 | content: ""; 332 | display: table; 333 | } 334 | 335 | .markdown-body hr:after { 336 | clear: both; 337 | content: ""; 338 | display: table; 339 | } 340 | 341 | .markdown-body table { 342 | border-collapse: collapse; 343 | border-spacing: 0; 344 | } 345 | 346 | .markdown-body td, 347 | .markdown-body th { 348 | padding: 0; 349 | } 350 | 351 | .markdown-body details summary { 352 | cursor: pointer; 353 | } 354 | 355 | .markdown-body h1, 356 | .markdown-body h2, 357 | .markdown-body h3, 358 | .markdown-body h4, 359 | .markdown-body h5, 360 | .markdown-body h6 { 361 | margin-bottom: 0; 362 | margin-top: 0; 363 | } 364 | 365 | .markdown-body h1 { 366 | font-size: 32px; 367 | } 368 | 369 | .markdown-body h1, 370 | .markdown-body h2 { 371 | font-weight: 600; 372 | } 373 | 374 | .markdown-body h2 { 375 | font-size: 24px; 376 | } 377 | 378 | .markdown-body h3 { 379 | font-size: 20px; 380 | } 381 | 382 | .markdown-body h3, 383 | .markdown-body h4 { 384 | font-weight: 600; 385 | } 386 | 387 | .markdown-body h4 { 388 | font-size: 16px; 389 | } 390 | 391 | .markdown-body h5 { 392 | font-size: 14px; 393 | } 394 | 395 | .markdown-body h5, 396 | .markdown-body h6 { 397 | font-weight: 600; 398 | } 399 | 400 | .markdown-body h6 { 401 | font-size: 12px; 402 | } 403 | 404 | .markdown-body p { 405 | margin-bottom: 10px; 406 | margin-top: 0; 407 | } 408 | 409 | .markdown-body blockquote { 410 | margin: 0; 411 | } 412 | 413 | .markdown-body ol, 414 | .markdown-body ul { 415 | margin-bottom: 0; 416 | margin-top: 0; 417 | padding-left: 0; 418 | } 419 | 420 | .markdown-body ol ol, 421 | .markdown-body ul ol { 422 | list-style-type: lower-roman; 423 | } 424 | 425 | .markdown-body ol ol ol, 426 | .markdown-body ol ul ol, 427 | .markdown-body ul ol ol, 428 | .markdown-body ul ul ol { 429 | list-style-type: lower-alpha; 430 | } 431 | 432 | .markdown-body dd { 433 | margin-left: 0; 434 | } 435 | 436 | .markdown-body code, 437 | .markdown-body pre { 438 | font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace; 439 | font-size: 12px; 440 | } 441 | 442 | .markdown-body pre { 443 | margin-bottom: 0; 444 | margin-top: 0; 445 | } 446 | 447 | .markdown-body input::-webkit-inner-spin-button, 448 | .markdown-body input::-webkit-outer-spin-button { 449 | -webkit-appearance: none; 450 | appearance: none; 451 | margin: 0; 452 | } 453 | 454 | .markdown-body .border { 455 | border: 1px solid #e1e4e8!important; 456 | } 457 | 458 | .markdown-body .border-0 { 459 | border: 0!important; 460 | } 461 | 462 | .markdown-body .border-bottom { 463 | border-bottom: 1px solid #e1e4e8!important; 464 | } 465 | 466 | .markdown-body .rounded-1 { 467 | border-radius: 3px!important; 468 | } 469 | 470 | .markdown-body .bg-white { 471 | background-color: #fff!important; 472 | } 473 | 474 | .markdown-body .bg-gray-light { 475 | background-color: #fafbfc!important; 476 | } 477 | 478 | .markdown-body .text-gray-light { 479 | color: #6a737d!important; 480 | } 481 | 482 | .markdown-body .mb-0 { 483 | margin-bottom: 0!important; 484 | } 485 | 486 | .markdown-body .my-2 { 487 | margin-bottom: 8px!important; 488 | margin-top: 8px!important; 489 | } 490 | 491 | .markdown-body .pl-0 { 492 | padding-left: 0!important; 493 | } 494 | 495 | .markdown-body .py-0 { 496 | padding-bottom: 0!important; 497 | padding-top: 0!important; 498 | } 499 | 500 | .markdown-body .pl-1 { 501 | padding-left: 4px!important; 502 | } 503 | 504 | .markdown-body .pl-2 { 505 | padding-left: 8px!important; 506 | } 507 | 508 | .markdown-body .py-2 { 509 | padding-bottom: 8px!important; 510 | padding-top: 8px!important; 511 | } 512 | 513 | .markdown-body .pl-3, 514 | .markdown-body .px-3 { 515 | padding-left: 16px!important; 516 | } 517 | 518 | .markdown-body .px-3 { 519 | padding-right: 16px!important; 520 | } 521 | 522 | .markdown-body .pl-4 { 523 | padding-left: 24px!important; 524 | } 525 | 526 | .markdown-body .pl-5 { 527 | padding-left: 32px!important; 528 | } 529 | 530 | .markdown-body .pl-6 { 531 | padding-left: 40px!important; 532 | } 533 | 534 | .markdown-body .f6 { 535 | font-size: 12px!important; 536 | } 537 | 538 | .markdown-body .lh-condensed { 539 | line-height: 1.25!important; 540 | } 541 | 542 | .markdown-body .text-bold { 543 | font-weight: 600!important; 544 | } 545 | 546 | .markdown-body:before { 547 | content: ""; 548 | display: table; 549 | } 550 | 551 | .markdown-body:after { 552 | clear: both; 553 | content: ""; 554 | display: table; 555 | } 556 | 557 | .markdown-body>:first-child { 558 | margin-top: 0!important; 559 | } 560 | 561 | .markdown-body>:last-child { 562 | margin-bottom: 0!important; 563 | } 564 | 565 | .markdown-body a:not([href]) { 566 | color: inherit; 567 | text-decoration: none; 568 | } 569 | 570 | .markdown-body blockquote, 571 | .markdown-body dl, 572 | .markdown-body ol, 573 | .markdown-body p, 574 | .markdown-body pre, 575 | .markdown-body table, 576 | .markdown-body ul { 577 | margin-bottom: 16px; 578 | margin-top: 0; 579 | } 580 | 581 | .markdown-body hr { 582 | background-color: #e1e4e8; 583 | border: 0; 584 | height: .25em; 585 | margin: 24px 0; 586 | padding: 0; 587 | } 588 | 589 | .markdown-body blockquote { 590 | border-left: .25em solid #dfe2e5; 591 | color: #6a737d; 592 | padding: 0 1em; 593 | } 594 | 595 | .markdown-body blockquote>:first-child { 596 | margin-top: 0; 597 | } 598 | 599 | .markdown-body blockquote>:last-child { 600 | margin-bottom: 0; 601 | } 602 | 603 | .markdown-body kbd { 604 | background-color: #fafbfc; 605 | border: 1px solid #c6cbd1; 606 | border-bottom-color: #959da5; 607 | border-radius: 3px; 608 | box-shadow: inset 0 -1px 0 #959da5; 609 | color: #444d56; 610 | display: inline-block; 611 | font-size: 11px; 612 | line-height: 10px; 613 | padding: 3px 5px; 614 | vertical-align: middle; 615 | } 616 | 617 | .markdown-body h1, 618 | .markdown-body h2, 619 | .markdown-body h3, 620 | .markdown-body h4, 621 | .markdown-body h5, 622 | .markdown-body h6 { 623 | font-weight: 600; 624 | line-height: 1.25; 625 | margin-bottom: 16px; 626 | margin-top: 24px; 627 | } 628 | 629 | .markdown-body h1 { 630 | font-size: 2em; 631 | } 632 | 633 | .markdown-body h1, 634 | .markdown-body h2 { 635 | border-bottom: 1px solid #eaecef; 636 | padding-bottom: .3em; 637 | } 638 | 639 | .markdown-body h2 { 640 | font-size: 1.5em; 641 | } 642 | 643 | .markdown-body h3 { 644 | font-size: 1.25em; 645 | } 646 | 647 | .markdown-body h4 { 648 | font-size: 1em; 649 | } 650 | 651 | .markdown-body h5 { 652 | font-size: .875em; 653 | } 654 | 655 | .markdown-body h6 { 656 | color: #6a737d; 657 | font-size: .85em; 658 | } 659 | 660 | .markdown-body ol, 661 | .markdown-body ul { 662 | padding-left: 2em; 663 | } 664 | 665 | .markdown-body ol ol, 666 | .markdown-body ol ul, 667 | .markdown-body ul ol, 668 | .markdown-body ul ul { 669 | margin-bottom: 0; 670 | margin-top: 0; 671 | } 672 | 673 | .markdown-body li { 674 | word-wrap: break-all; 675 | } 676 | 677 | .markdown-body li>p { 678 | margin-top: 16px; 679 | } 680 | 681 | .markdown-body li+li { 682 | margin-top: .25em; 683 | } 684 | 685 | .markdown-body dl { 686 | padding: 0; 687 | } 688 | 689 | .markdown-body dl dt { 690 | font-size: 1em; 691 | font-style: italic; 692 | font-weight: 600; 693 | margin-top: 16px; 694 | padding: 0; 695 | } 696 | 697 | .markdown-body dl dd { 698 | margin-bottom: 16px; 699 | padding: 0 16px; 700 | } 701 | 702 | .markdown-body table { 703 | display: block; 704 | overflow: auto; 705 | width: 100%; 706 | } 707 | 708 | .markdown-body table th { 709 | font-weight: 600; 710 | } 711 | 712 | .markdown-body table td, 713 | .markdown-body table th { 714 | border: 1px solid #dfe2e5; 715 | padding: 6px 13px; 716 | } 717 | 718 | .markdown-body table tr { 719 | background-color: #fff; 720 | border-top: 1px solid #c6cbd1; 721 | } 722 | 723 | .markdown-body table tr:nth-child(2n) { 724 | background-color: #f6f8fa; 725 | } 726 | 727 | .markdown-body img { 728 | background-color: #fff; 729 | box-sizing: content-box; 730 | max-width: 100%; 731 | } 732 | 733 | .markdown-body img[align=right] { 734 | padding-left: 20px; 735 | } 736 | 737 | .markdown-body img[align=left] { 738 | padding-right: 20px; 739 | } 740 | 741 | .markdown-body code { 742 | background-color: rgba(27,31,35,.05); 743 | border-radius: 3px; 744 | font-size: 85%; 745 | margin: 0; 746 | padding: .2em .4em; 747 | } 748 | 749 | .markdown-body pre { 750 | word-wrap: normal; 751 | } 752 | 753 | .markdown-body pre>code { 754 | background: transparent; 755 | border: 0; 756 | font-size: 100%; 757 | margin: 0; 758 | padding: 0; 759 | white-space: pre; 760 | word-break: normal; 761 | } 762 | 763 | .markdown-body .highlight { 764 | margin-bottom: 16px; 765 | } 766 | 767 | .markdown-body .highlight pre { 768 | margin-bottom: 0; 769 | word-break: normal; 770 | } 771 | 772 | .markdown-body .highlight pre, 773 | .markdown-body pre { 774 | background-color: #f6f8fa; 775 | border-radius: 3px; 776 | font-size: 85%; 777 | line-height: 1.45; 778 | overflow: auto; 779 | padding: 16px; 780 | } 781 | 782 | .markdown-body pre code { 783 | background-color: transparent; 784 | border: 0; 785 | display: inline; 786 | line-height: inherit; 787 | margin: 0; 788 | max-width: auto; 789 | overflow: visible; 790 | padding: 0; 791 | word-wrap: normal; 792 | } 793 | 794 | .markdown-body .commit-tease-sha { 795 | color: #444d56; 796 | display: inline-block; 797 | font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace; 798 | font-size: 90%; 799 | } 800 | 801 | .markdown-body .blob-wrapper { 802 | border-bottom-left-radius: 3px; 803 | border-bottom-right-radius: 3px; 804 | overflow-x: auto; 805 | overflow-y: hidden; 806 | } 807 | 808 | .markdown-body .blob-wrapper-embedded { 809 | max-height: 240px; 810 | overflow-y: auto; 811 | } 812 | 813 | .markdown-body .blob-num { 814 | -moz-user-select: none; 815 | -ms-user-select: none; 816 | -webkit-user-select: none; 817 | color: rgba(27,31,35,.3); 818 | cursor: pointer; 819 | font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace; 820 | font-size: 12px; 821 | line-height: 20px; 822 | min-width: 50px; 823 | padding-left: 10px; 824 | padding-right: 10px; 825 | text-align: right; 826 | user-select: none; 827 | vertical-align: top; 828 | white-space: nowrap; 829 | width: 1%; 830 | } 831 | 832 | .markdown-body .blob-num:hover { 833 | color: rgba(27,31,35,.6); 834 | } 835 | 836 | .markdown-body .blob-num:before { 837 | content: attr(data-line-number); 838 | } 839 | 840 | .markdown-body .blob-code { 841 | line-height: 20px; 842 | padding-left: 10px; 843 | padding-right: 10px; 844 | position: relative; 845 | vertical-align: top; 846 | } 847 | 848 | .markdown-body .blob-code-inner { 849 | color: #24292e; 850 | font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace; 851 | font-size: 12px; 852 | overflow: visible; 853 | white-space: pre; 854 | word-wrap: normal; 855 | } 856 | 857 | .markdown-body .pl-token.active, 858 | .markdown-body .pl-token:hover { 859 | background: #ffea7f; 860 | cursor: pointer; 861 | } 862 | 863 | .markdown-body kbd { 864 | background-color: #fafbfc; 865 | border: 1px solid #d1d5da; 866 | border-bottom-color: #c6cbd1; 867 | border-radius: 3px; 868 | box-shadow: inset 0 -1px 0 #c6cbd1; 869 | color: #444d56; 870 | display: inline-block; 871 | font: 11px SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace; 872 | line-height: 10px; 873 | padding: 3px 5px; 874 | vertical-align: middle; 875 | } 876 | 877 | .markdown-body :checked+.radio-label { 878 | border-color: #0366d6; 879 | position: relative; 880 | z-index: 1; 881 | } 882 | 883 | .markdown-body .tab-size[data-tab-size="1"] { 884 | -moz-tab-size: 1; 885 | tab-size: 1; 886 | } 887 | 888 | .markdown-body .tab-size[data-tab-size="2"] { 889 | -moz-tab-size: 2; 890 | tab-size: 2; 891 | } 892 | 893 | .markdown-body .tab-size[data-tab-size="3"] { 894 | -moz-tab-size: 3; 895 | tab-size: 3; 896 | } 897 | 898 | .markdown-body .tab-size[data-tab-size="4"] { 899 | -moz-tab-size: 4; 900 | tab-size: 4; 901 | } 902 | 903 | .markdown-body .tab-size[data-tab-size="5"] { 904 | -moz-tab-size: 5; 905 | tab-size: 5; 906 | } 907 | 908 | .markdown-body .tab-size[data-tab-size="6"] { 909 | -moz-tab-size: 6; 910 | tab-size: 6; 911 | } 912 | 913 | .markdown-body .tab-size[data-tab-size="7"] { 914 | -moz-tab-size: 7; 915 | tab-size: 7; 916 | } 917 | 918 | .markdown-body .tab-size[data-tab-size="8"] { 919 | -moz-tab-size: 8; 920 | tab-size: 8; 921 | } 922 | 923 | .markdown-body .tab-size[data-tab-size="9"] { 924 | -moz-tab-size: 9; 925 | tab-size: 9; 926 | } 927 | 928 | .markdown-body .tab-size[data-tab-size="10"] { 929 | -moz-tab-size: 10; 930 | tab-size: 10; 931 | } 932 | 933 | .markdown-body .tab-size[data-tab-size="11"] { 934 | -moz-tab-size: 11; 935 | tab-size: 11; 936 | } 937 | 938 | .markdown-body .tab-size[data-tab-size="12"] { 939 | -moz-tab-size: 12; 940 | tab-size: 12; 941 | } 942 | 943 | .markdown-body .task-list-item { 944 | list-style-type: none; 945 | } 946 | 947 | .markdown-body .task-list-item+.task-list-item { 948 | margin-top: 3px; 949 | } 950 | 951 | .markdown-body .task-list-item input { 952 | margin: 0 .2em .25em -1.6em; 953 | vertical-align: middle; 954 | } 955 | 956 | .markdown-body hr { 957 | border-bottom-color: #eee; 958 | } 959 | 960 | .markdown-body .pl-0 { 961 | padding-left: 0!important; 962 | } 963 | 964 | .markdown-body .pl-1 { 965 | padding-left: 4px!important; 966 | } 967 | 968 | .markdown-body .pl-2 { 969 | padding-left: 8px!important; 970 | } 971 | 972 | .markdown-body .pl-3 { 973 | padding-left: 16px!important; 974 | } 975 | 976 | .markdown-body .pl-4 { 977 | padding-left: 24px!important; 978 | } 979 | 980 | .markdown-body .pl-5 { 981 | padding-left: 32px!important; 982 | } 983 | 984 | .markdown-body .pl-6 { 985 | padding-left: 40px!important; 986 | } 987 | 988 | .markdown-body .pl-7 { 989 | padding-left: 48px!important; 990 | } 991 | 992 | .markdown-body .pl-8 { 993 | padding-left: 64px!important; 994 | } 995 | 996 | .markdown-body .pl-9 { 997 | padding-left: 80px!important; 998 | } 999 | 1000 | .markdown-body .pl-10 { 1001 | padding-left: 96px!important; 1002 | } 1003 | 1004 | .markdown-body .pl-11 { 1005 | padding-left: 112px!important; 1006 | } 1007 | 1008 | .markdown-body .pl-12 { 1009 | padding-left: 128px!important; 1010 | } 1011 | -------------------------------------------------------------------------------- /md_github.php: -------------------------------------------------------------------------------- 1 | "", 15 | 'token' => "", 16 | ), $atts 17 | ) 18 | ); 19 | return array($url, $token); 20 | } 21 | 22 | function MDGH_get_api_response($url, $token, $method) { 23 | 24 | $url_list = explode('/', $url); 25 | $owner = $url_list[3]; 26 | $repo = $url_list[4]; 27 | $branch = $url_list[6]; 28 | $path = implode("/", array_slice($url_list, 7)); 29 | 30 | $context_params = array( 31 | 'http' => array( 32 | 'method' => 'GET', 33 | 'user_agent' => 'GIS-OPS.com', 34 | 'timeout' => 1, 35 | 'header' => "Accept: application/vnd.github.VERSION.html+json\r\n". 36 | "Authorization: token ".$token."\r\n" 37 | ) 38 | ); 39 | 40 | if ($method == 'file') { 41 | //if we want to get the markdown file via md_github shortcode 42 | $request_url = 'https://api.github.com/repos/'.$owner.'/'.$repo.'/contents/'.$path.'?ref='.$branch; 43 | $res = file_get_contents($request_url, FALSE, stream_context_create($context_params)); 44 | 45 | return $res; 46 | } else { 47 | //if we want to get the checkout html via checkout_github shortcode 48 | $request_url = 'https://api.github.com/repos/'.$owner.'/'.$repo.'/commits?path='.$path; 49 | $res = file_get_contents($request_url, FALSE, stream_context_create($context_params)); 50 | 51 | $json = json_decode($res, true); 52 | return $json; 53 | } 54 | } 55 | 56 | function MDGH_get_github_checkout($json, $url) { 57 | 58 | $datetime = $json['commit']['committer']['date']; 59 | 60 | $max_datetime = strtotime($datetime); 61 | $max_datetime_f = date('d/m/Y H:i:s', $max_datetime); 62 | 63 | $checkout_label = '
64 |
65 | 69 |
70 |
'; 71 | 72 | return $checkout_label; 73 | } 74 | 75 | function MDGH_get_commit_history($json, $url) { 76 | $url_list = explode('/', $url); 77 | $owner = $url_list[3]; 78 | $repo = $url_list[4]; 79 | $branch = $url_list[6]; 80 | $path = implode("/", array_slice($url_list, 7)); 81 | 82 | $url_history = 'https://github.com/'.$owner.'/'.$repo.'/commits/'.'/'.$branch.'/'.$path; 83 | $html_string = '

Post history - Last 5 commits

'; 84 | 85 | $max_posts = 5; 86 | $i = 0; 87 | foreach ($json as $item) { 88 | if($i == $max_posts) break; 89 | $html_string .= '

'; 90 | $html_string .= ''.date('d/m/Y H:i:s', strtotime($item['commit']['committer']['date'])).' - '.$item["commit"]["message"]; 91 | $html_string .= ' ('.$item['commit']['committer']['name'].')'; 92 | $html_string .= '

'; 93 | $i++; 94 | } 95 | $html_string .= '
'; 96 | 97 | return $html_string; 98 | } 99 | 100 | function MDGH_md_github_handler($atts) { 101 | list($url, $token) = MDGH_atts_extract($atts); 102 | //get raw markdown from file URL 103 | $res = MDGH_get_api_response($url, $token, 'file'); 104 | //send back text to replace shortcode in post 105 | return $res; 106 | } 107 | 108 | function MDGH_md_dashedbox_github($atts) { 109 | list($url, $token) = MDGH_atts_extract($atts); 110 | //get checkout lable from file URL 111 | $checkout = MDGH_md_github_checkout($atts); 112 | //get raw markdown from file URL 113 | $markdown = MDGH_get_api_response($url, $token, 'file'); 114 | //generate frame with border, checkout label and markdown content 115 | $md_dashedbox = ' 116 |
117 | '.$checkout.' 118 | '.$markdown.' 119 |
'; 120 | //send back text to replace shortcode in post 121 | return $md_dashedbox; 122 | } 123 | 124 | function MDGH_md_github_checkout($atts) { 125 | list($url, $token) = MDGH_atts_extract($atts); 126 | // query commit endpoint for latest update time 127 | $json = MDGH_get_api_response($url, $token, 'checkout')[0]; 128 | $last_update_htnl = MDGH_get_github_checkout($json, $url); 129 | 130 | return $last_update_htnl; 131 | } 132 | 133 | function MDHG_md_github_history($atts) { 134 | list($url, $token) = MDGH_atts_extract($atts); 135 | // query commit endpoint for latest update time 136 | $json = MDGH_get_api_response($url, $token, 'checkout'); 137 | $history_html = MDGH_get_commit_history($json, $url); 138 | return $history_html; 139 | } 140 | 141 | function MDGH_md_github_enqueue_style() { 142 | wp_enqueue_style( 'md_github', plugins_url( 'css/md-github.css', __FILE__ )); 143 | } 144 | add_action( 'wp_enqueue_scripts', 'MDGH_md_github_enqueue_style' ); 145 | add_shortcode('checkout_github', "MDGH_md_github_checkout"); 146 | add_shortcode("md_github", "MDGH_md_github_handler"); 147 | add_shortcode('history_github', "MDHG_md_github_history"); 148 | add_shortcode("md_dashedbox_github", "MDGH_md_dashedbox_github"); 149 | 150 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Markdown Github === 2 | Contributors: Nils Nolde 3 | Tags: github,markdown 4 | Requires at least: 4.0 5 | Tested up to: 5.0.2 6 | Requires PHP: 5.6 7 | Stable tag: 1.1.0 8 | License: GPLv2 9 | License URI: https://github.com/gis-ops/md-github-wordpress/blob/master/LICENSE 10 | 11 | A plugin to inject markdown files directly into a post from Github. 12 | 13 | 14 | == Description == 15 | WordPress Plugin to use Github as collaboration and version control platform for Markdown documents. 16 | 17 | Advantages: 18 | 19 | - Easy to update by external users via pull requests, minimizes the chance of stale tutorials 20 | - Write Markdown in your favorite editor and just push to your repo to update your blog 21 | 22 | It features 3 shortcodes: 23 | 24 | 1. `[md_github token=YourToken url=Github URL]`: Pulls raw HTML from the `https://api.github.com/repos/` endpoint and styles it with Github markdown CSS 25 | 2. `[checkout_github token=YourToken url=Github URL]`: Displays a formatted link to the repo with the date of the latest update 26 | 3. `[history_github token=YourToken url=Github URL]`: Displays a commit history of the last 5 commits. 27 | 28 | Github API is queried on every new load of the page, so that changes in the repository will immediately be reflected on your blog. Private authentication tokens help increasing the API limit to 5000 requests per hour (enough even for Digital Ocean blogs) and accessing private repositories. 29 | 30 | Idea and most of the code is based on Andy Challis' WP plugin to display Jupyter notebooks https://github.com/ghandic/nbconvert. The CSS is taken from https://github.com/sindresorhus/github-markdown-css. 31 | 32 | ## Usage 33 | 34 | All shortcodes take `token` and `url` as attribute. `token` is your private personal access token, which you can generate [here](https://github.com/settings/developers). `url` is the full URL to your document on Github. E.g. 35 | 36 | `[md_github token=1d6ef5ba426648ef7d2273aca2fc80787 url=https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_PluginBasics.md]` 37 | 38 | `[checkout_github token=1d6ef5ba426648ef7d2273aca2fc80787 url=https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_PluginBasics.md]` 39 | 40 | `[history_github token=1d6ef5ba426648ef7d2273aca2fc80787 url=https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_PluginBasics.md]` 41 | 42 | ## Demo 43 | 44 | Check it out on of our blogs: 45 | 46 | https://gis-ops.com/react-redux-leaflet-turfjs-building-a-density-based-clustering-dbscan-app-with-the-almighty-here-maps-places-api/ 47 | 48 | ## Support 49 | 50 | Add issues at . 51 | 52 | == Installation == 53 | 1. Install WP Pusher (https://wppusher.com) via ZIP and activate 54 | 2. Install from Github via WP Pusher from gis-ops/md-github-wordpress 55 | 3. Activate and add shortcode to your posts. 56 | 57 | Or directly from WordPress plugin repository. 58 | 59 | Or install as ZIP from https://github.com/gis-ops/md-github-wordpress/archive/master.zip 60 | 61 | == Changelog == 62 | = v1.1.0 = 63 | * Add shortcode to display commit history 64 | 65 | = v1.0.0 = 66 | * First version 67 | --------------------------------------------------------------------------------