{"id":207670,"date":"2011-08-23T08:00:00","date_gmt":"2011-08-23T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/wp-github-gist\/"},"modified":"2021-10-13T20:18:00","modified_gmt":"2021-10-13T20:18:00","slug":"wp-github-gist","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/wp-github-gist\/","title":{"rendered":"WP Github Gist"},"content":{"rendered":"<p>WP Github Gist WordPress Plugin, provides the ability to embed gist and files from Github in your blog posts or pages. Even though Github doesn\u2019t provide a way to embed files, this Plugin still works by using the gist-it service.<\/p>\n<h3>Features<\/h3>\n<h4>Embed Gist<\/h4>\n<p>To embed a gist you have to use the following shortcode<\/p>\n<pre><code>[gist id = \"{GIST_ID}\" file = \"{GIST_FILE}\" width = \"{WIDTH}\" height = \"{HEIGHT}\"]\n<\/code><\/pre>\n<p>The following are the different attributes that you can use in the shortcode<\/p>\n<ul>\n<li><code>id<\/code> \u2013 Id of your gist.<\/li>\n<li><code>file<\/code> \u2013 File inside gist that you want to display. If there is only one file in the gist, then you can ignore this.<\/li>\n<li><code>width<\/code> \u2013 Width of the code wrapper. Default is <code>100%<\/code>.<\/li>\n<li><code>height<\/code> \u2013 Height of the code wrapper. Default is <code>100%<\/code>.<\/li>\n<\/ul>\n<p>eg: <code>[gist id = \"12345\" file = \"myfile\" width = \"100%\" height = \"100%\"]<\/code><\/p>\n<h4>Embed Github files<\/h4>\n<p>To embed a github file you have to use the following shortcode<\/p>\n<pre><code>[github file = \"{GITHUB_FILE}\" start_line = \"{START_LINE}\" end_line = \"{END_LINE}\"]\n<\/code><\/pre>\n<ul>\n<li><code>{GITHUB_FILE}<\/code> \u2013 full path to your github file. eg: If you want to embed https:\/\/github.com\/sudar\/MissileLauncher\/blob\/master\/MissileLauncher.cpp then <code>{GITHUB_FILE}<\/code> would be \/sudar\/MissileLauncher\/blob\/master\/MissileLauncher.cpp<\/li>\n<li><code>{START_LINE}<\/code> \u2013 If you want to embed only part of the file, then you can specify the starting line number (optional)<\/li>\n<li><code>{END_LINE}<\/code> \u2013 If you want to embed only part of the file, then you can specify the ending line number (optional)<\/li>\n<\/ul>\n<p>eg: <code>[github file = \"\/sudar\/MissileLauncher\/blob\/master\/MissileLauncher.cpp\"]<\/code><\/p>\n<p>if you want to embed only part of the file, then you can specify the start and end line as well<\/p>\n<pre><code>[github file = \"\/sudar\/MissileLauncher\/blob\/master\/MissileLauncher.cpp\" start_line = \"10\" end_line = \"20\"]\n<\/code><\/pre>\n<h3>Changing Gist-it server<\/h3>\n<p>By default, this Plugin uses my own <a href=\"http:\/\/gist-it.sudarmuthu.com\" rel=\"nofollow ugc\">gist-it server<\/a> which is hosted on a free Google App Engine account. If you expect significant amount of traffic to your blog, then do consider using your own gist-it server. You can follow the <a href=\"http:\/\/sudarmuthu.com\/wordpress\/wp-github-gist\/changing-gist-it-server\" rel=\"nofollow ugc\">instructions to deploy your own gist-it server<\/a> and then go to the settings page to change the url.<\/p>\n<h3>Translation<\/h3>\n<p>The pot file is available with the Plugin. If you are willing to do translation for the Plugin, use the pot file to create the .po files for your language and let me know. I will add it to the Plugin after giving credit to you.<\/p>\n<h3>Support<\/h3>\n<p>Support for the Plugin is available from the <a href=\"http:\/\/sudarmuthu.com\/wordpress\/wp-github-gist\" rel=\"nofollow ugc\">Plugin\u2019s home page<\/a>. If you have any questions or suggestions, do leave a comment there or contact me in <a href=\"http:\/\/twitter.com\/sudarmuthu\" rel=\"nofollow ugc\">twitter<\/a>.<\/p>\n<h3>Readme Generator<\/h3>\n<p>This Readme file was generated using <a href='http:\/\/sudarmuthu.com\/wordpress\/wp-readme' rel=\"nofollow ugc\">wp-readme<\/a>, which generates readme files for WordPress Plugins.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Embed files and gist from Github in your blog posts or pages.<\/p>\n","protected":false},"author":65,"featured_media":228505,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"WP Github Gist - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"Embed files and gist from Github in your blog posts or pages."},"footnotes":""},"categories":[1],"tags":[849,5289,5290],"class_list":["post-207670","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-embed","tag-gist","tag-github"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/207670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=207670"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/207670\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/228505"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=207670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=207670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=207670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}