Changeset 1129669
- Timestamp:
- 04/07/2015 03:31:33 PM (11 years ago)
- Location:
- dobsondev-shortcodes
- Files:
-
- 3 edited
- 7 copied
-
tags/1.1.1 (copied) (copied from dobsondev-shortcodes/trunk)
-
tags/1.1.1/changelog.txt (copied) (copied from dobsondev-shortcodes/trunk/changelog.txt) (1 diff)
-
tags/1.1.1/dobsondev-shortcodes.css (copied) (copied from dobsondev-shortcodes/trunk/dobsondev-shortcodes.css)
-
tags/1.1.1/dobsondev-shortcodes.js (copied) (copied from dobsondev-shortcodes/trunk/dobsondev-shortcodes.js)
-
tags/1.1.1/dobsondev-shortcodes.php (copied) (copied from dobsondev-shortcodes/trunk/dobsondev-shortcodes.php) (3 diffs)
-
tags/1.1.1/libs (copied) (copied from dobsondev-shortcodes/trunk/libs)
-
tags/1.1.1/readme.txt (copied) (copied from dobsondev-shortcodes/trunk/readme.txt) (4 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/dobsondev-shortcodes.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dobsondev-shortcodes/tags/1.1.1/changelog.txt
r1127926 r1129669 1 = 1.1.1 = 2 3 New Features 4 5 * Added shortcode for displaying GitHub repository file contents. 6 7 Bug Fixes 8 9 * Changed some documentation errors. 10 1 11 = 1.1.0 = 2 12 -
dobsondev-shortcodes/tags/1.1.1/dobsondev-shortcodes.php
r1127926 r1129669 4 4 * Plugin URI: http://dobsondev.com/portfolio/dobsondev-shortcodes/ 5 5 * Description: A collection of helpful shortcodes. 6 * Version: 1.1. 06 * Version: 1.1.1 7 7 * Author: Alex Dobson 8 8 * Author URI: http://dobsondev.com/ … … 104 104 )); 105 105 $response = curl_exec($curl); 106 // var_dump($response); 106 107 $response_array = json_decode($response); 108 // var_dump($response_array); 107 109 $parsedown = new Parsedown(); 108 110 echo $parsedown->text(base64_decode($response_array->content)); … … 110 112 } 111 113 add_shortcode('embedGitHubReadme', 'dobsondev_shrtcode_create_github_readme'); 114 115 116 /* Adds a shortcode for displaying GitHub README onto a page */ 117 function dobsondev_shrtcode_create_github_file_contents($atts) { 118 extract(shortcode_atts(array( 119 'owner' => "NULL", 120 'repo' => "NULL", 121 'path' => "NULL", 122 'markdown' => "no", 123 ), $atts)); 124 if ($owner == "NULL" || $repo == "NULL" || $path == "NULL") { 125 return '<p> Please Enter a Owner, Repo and Path for the embedGitHubReadme ShortCode. </p>'; 126 } else { 127 $curl = curl_init(); 128 curl_setopt_array($curl, array( 129 CURLOPT_RETURNTRANSFER => 1, 130 CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/contents/' . $path, 131 CURLOPT_USERAGENT => $repo, 132 CURLOPT_HEADER => false 133 )); 134 $response = curl_exec($curl); 135 // var_dump($response); 136 $response_array = json_decode($response); 137 // var_dump($response_array); 138 if (strcasecmp($markdown, "yes") == 0) { 139 $parsedown = new Parsedown(); 140 echo $parsedown->text(base64_decode($response_array->content)); 141 } else { 142 echo base64_decode($response_array->content); 143 } 144 } 145 } 146 add_shortcode('embedGitHubContent', 'dobsondev_shrtcode_create_github_file_contents'); 112 147 113 148 -
dobsondev-shortcodes/tags/1.1.1/readme.txt
r1127930 r1129669 4 4 License: GPLv2 5 5 License URI: http://www.gnu.org/licenses/gpl.html 6 Tags: dobsondev, shortcodes, pdf, portable document format, github gists, github, gists, github readme, github project readme, github repo readme, twitch streams, twitch, twitch tv, twitch chat, YouTube video, YouTube, inline code, code snippets, code block, programming, code examples, button, buttons, css button, css buttons, button shortcode, buttons shortcodes, user interaction, user interaction messages, info message, information message, success message, warning message, error message, related posts, related posts shortcode, jquery, jquery related posts, related posts slideshow6 Tags: dobsondev, shortcodes, pdf, portable document format, github gists, github, gists, github readme, github project readme, github repo readme, github file contents, twitch streams, twitch, twitch tv, twitch chat, YouTube video, YouTube, inline code, code snippets, code block, programming, code examples, button, buttons, css button, css buttons, button shortcode, buttons shortcodes, user interaction, user interaction messages, info message, information message, success message, warning message, error message, related posts, related posts shortcode, jquery, jquery related posts, related posts slideshow 7 7 Requires at least: 2.5 8 8 Tested up to: 4.1.1 9 Stable tag: 1.1. 09 Stable tag: 1.1.1 10 10 11 11 Add a collection of helpful shortcodes to your site. … … 19 19 * Embed PDFs - Embeds PDFs into pages rather than separate links. 20 20 * Embed [GitHub Gists](http://gist.github.com/) - Easily add GitHub gists to your site or blog. 21 * Embed [GitHub Repo Readme](http://github.com/) - Easily add the content from your GitHub Repo README.md file. 21 * Embed [GitHub Repo Readme](http://github.com/) - Easily add the content from your GitHub repository README.md file. 22 * Embed [GitHub Repo File Contents](http://github.com/) - Easily add the content from a file from any GitHub repository. 22 23 * Embed [Twitch Stream](http://twitch.tv/) - Embeds a Twitch Stream into the page. 23 24 * Embed [Twitch Stream](http://twitch.tv/) Chat - Embeds the chat from a Twitch Stream into the page. … … 49 50 [embedGitHubReadme owner="Owner_of_Repo" repo="Repo_Name"] 50 51 51 This shortcode will display the contents of your GitHub Repository's README file. The markdown will displayed as HTML output onto the page. This shortcode uses GitHub API calls to ensure that as you update you README file the output from this shortcode will also update.52 This shortcode will display the contents of any GitHub repository's README file. The markdown will displayed as HTML output onto the page. This shortcode uses GitHub API calls to ensure that as you update you README file the output from this shortcode will also update. 52 53 53 54 The style will match that of your default page style, but if you want to change the style just wrap the shortcode inside of a div and then edit as much as the style as you want. 55 56 **Embed GitHub Repo File Contents** 57 58 [embedGitHubContent owner="Owner_of_Repo" repo="Repo_Name" path="Path_to_File" markdown="Yes/No"] 59 60 This shortcode will display the contents of a file from any GitHub repository. You must include the Owner of the repository, the repository name and the path to the file. Optionally, if the file is a markdown file you can put markdown="yes" and the plugin will output the markdown as HTML onto the page. If you give the shortcode a path to a folder rather than to a file it will output an array of the folders contents. 54 61 55 62 **Embed Twitch Stream** … … 140 147 == Changelog == 141 148 149 = - 1.1.1 - = 150 151 New Features 152 153 * Added shortcode for displaying GitHub repository file contents. 154 155 Bug Fixes 156 157 * Changed some documentation errors. 158 142 159 = - 1.1.0 - = 143 160 144 The Markdown Parser used for the GitHub Repository Readme shortcode is [Parsedown](http://parsedown.org/).161 The Markdown Parser used for the GitHub repository Readme shortcode is [Parsedown](http://parsedown.org/). 145 162 146 163 New Features 147 164 148 * Added shortcode for displaying GitHub Repository README.md files165 * Added shortcode for displaying GitHub repository README.md files 149 166 150 167 Bug Fixes -
dobsondev-shortcodes/trunk/changelog.txt
r1127926 r1129669 1 = 1.1.1 = 2 3 New Features 4 5 * Added shortcode for displaying GitHub repository file contents. 6 7 Bug Fixes 8 9 * Changed some documentation errors. 10 1 11 = 1.1.0 = 2 12 -
dobsondev-shortcodes/trunk/dobsondev-shortcodes.php
r1127926 r1129669 4 4 * Plugin URI: http://dobsondev.com/portfolio/dobsondev-shortcodes/ 5 5 * Description: A collection of helpful shortcodes. 6 * Version: 1.1. 06 * Version: 1.1.1 7 7 * Author: Alex Dobson 8 8 * Author URI: http://dobsondev.com/ … … 104 104 )); 105 105 $response = curl_exec($curl); 106 // var_dump($response); 106 107 $response_array = json_decode($response); 108 // var_dump($response_array); 107 109 $parsedown = new Parsedown(); 108 110 echo $parsedown->text(base64_decode($response_array->content)); … … 110 112 } 111 113 add_shortcode('embedGitHubReadme', 'dobsondev_shrtcode_create_github_readme'); 114 115 116 /* Adds a shortcode for displaying GitHub README onto a page */ 117 function dobsondev_shrtcode_create_github_file_contents($atts) { 118 extract(shortcode_atts(array( 119 'owner' => "NULL", 120 'repo' => "NULL", 121 'path' => "NULL", 122 'markdown' => "no", 123 ), $atts)); 124 if ($owner == "NULL" || $repo == "NULL" || $path == "NULL") { 125 return '<p> Please Enter a Owner, Repo and Path for the embedGitHubReadme ShortCode. </p>'; 126 } else { 127 $curl = curl_init(); 128 curl_setopt_array($curl, array( 129 CURLOPT_RETURNTRANSFER => 1, 130 CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/contents/' . $path, 131 CURLOPT_USERAGENT => $repo, 132 CURLOPT_HEADER => false 133 )); 134 $response = curl_exec($curl); 135 // var_dump($response); 136 $response_array = json_decode($response); 137 // var_dump($response_array); 138 if (strcasecmp($markdown, "yes") == 0) { 139 $parsedown = new Parsedown(); 140 echo $parsedown->text(base64_decode($response_array->content)); 141 } else { 142 echo base64_decode($response_array->content); 143 } 144 } 145 } 146 add_shortcode('embedGitHubContent', 'dobsondev_shrtcode_create_github_file_contents'); 112 147 113 148 -
dobsondev-shortcodes/trunk/readme.txt
r1127930 r1129669 4 4 License: GPLv2 5 5 License URI: http://www.gnu.org/licenses/gpl.html 6 Tags: dobsondev, shortcodes, pdf, portable document format, github gists, github, gists, github readme, github project readme, github repo readme, twitch streams, twitch, twitch tv, twitch chat, YouTube video, YouTube, inline code, code snippets, code block, programming, code examples, button, buttons, css button, css buttons, button shortcode, buttons shortcodes, user interaction, user interaction messages, info message, information message, success message, warning message, error message, related posts, related posts shortcode, jquery, jquery related posts, related posts slideshow6 Tags: dobsondev, shortcodes, pdf, portable document format, github gists, github, gists, github readme, github project readme, github repo readme, github file contents, twitch streams, twitch, twitch tv, twitch chat, YouTube video, YouTube, inline code, code snippets, code block, programming, code examples, button, buttons, css button, css buttons, button shortcode, buttons shortcodes, user interaction, user interaction messages, info message, information message, success message, warning message, error message, related posts, related posts shortcode, jquery, jquery related posts, related posts slideshow 7 7 Requires at least: 2.5 8 8 Tested up to: 4.1.1 9 Stable tag: 1.1. 09 Stable tag: 1.1.1 10 10 11 11 Add a collection of helpful shortcodes to your site. … … 19 19 * Embed PDFs - Embeds PDFs into pages rather than separate links. 20 20 * Embed [GitHub Gists](http://gist.github.com/) - Easily add GitHub gists to your site or blog. 21 * Embed [GitHub Repo Readme](http://github.com/) - Easily add the content from your GitHub Repo README.md file. 21 * Embed [GitHub Repo Readme](http://github.com/) - Easily add the content from your GitHub repository README.md file. 22 * Embed [GitHub Repo File Contents](http://github.com/) - Easily add the content from a file from any GitHub repository. 22 23 * Embed [Twitch Stream](http://twitch.tv/) - Embeds a Twitch Stream into the page. 23 24 * Embed [Twitch Stream](http://twitch.tv/) Chat - Embeds the chat from a Twitch Stream into the page. … … 49 50 [embedGitHubReadme owner="Owner_of_Repo" repo="Repo_Name"] 50 51 51 This shortcode will display the contents of your GitHub Repository's README file. The markdown will displayed as HTML output onto the page. This shortcode uses GitHub API calls to ensure that as you update you README file the output from this shortcode will also update.52 This shortcode will display the contents of any GitHub repository's README file. The markdown will displayed as HTML output onto the page. This shortcode uses GitHub API calls to ensure that as you update you README file the output from this shortcode will also update. 52 53 53 54 The style will match that of your default page style, but if you want to change the style just wrap the shortcode inside of a div and then edit as much as the style as you want. 55 56 **Embed GitHub Repo File Contents** 57 58 [embedGitHubContent owner="Owner_of_Repo" repo="Repo_Name" path="Path_to_File" markdown="Yes/No"] 59 60 This shortcode will display the contents of a file from any GitHub repository. You must include the Owner of the repository, the repository name and the path to the file. Optionally, if the file is a markdown file you can put markdown="yes" and the plugin will output the markdown as HTML onto the page. If you give the shortcode a path to a folder rather than to a file it will output an array of the folders contents. 54 61 55 62 **Embed Twitch Stream** … … 140 147 == Changelog == 141 148 149 = - 1.1.1 - = 150 151 New Features 152 153 * Added shortcode for displaying GitHub repository file contents. 154 155 Bug Fixes 156 157 * Changed some documentation errors. 158 142 159 = - 1.1.0 - = 143 160 144 The Markdown Parser used for the GitHub Repository Readme shortcode is [Parsedown](http://parsedown.org/).161 The Markdown Parser used for the GitHub repository Readme shortcode is [Parsedown](http://parsedown.org/). 145 162 146 163 New Features 147 164 148 * Added shortcode for displaying GitHub Repository README.md files165 * Added shortcode for displaying GitHub repository README.md files 149 166 150 167 Bug Fixes
Note: See TracChangeset
for help on using the changeset viewer.