Plugin Directory

Changeset 1129669


Ignore:
Timestamp:
04/07/2015 03:31:33 PM (11 years ago)
Author:
DobsonDev
Message:

Tagging Version 1.1.1

Location:
dobsondev-shortcodes
Files:
3 edited
7 copied

Legend:

Unmodified
Added
Removed
  • dobsondev-shortcodes/tags/1.1.1/changelog.txt

    r1127926 r1129669  
     1= 1.1.1 =
     2
     3New Features
     4
     5* Added shortcode for displaying GitHub repository file contents.
     6
     7Bug Fixes
     8
     9* Changed some documentation errors.
     10
    111= 1.1.0 =
    212
  • dobsondev-shortcodes/tags/1.1.1/dobsondev-shortcodes.php

    r1127926 r1129669  
    44 * Plugin URI: http://dobsondev.com/portfolio/dobsondev-shortcodes/
    55 * Description: A collection of helpful shortcodes.
    6  * Version: 1.1.0
     6 * Version: 1.1.1
    77 * Author: Alex Dobson
    88 * Author URI: http://dobsondev.com/
     
    104104    ));
    105105    $response = curl_exec($curl);
     106    // var_dump($response);
    106107    $response_array = json_decode($response);
     108    // var_dump($response_array);
    107109    $parsedown = new Parsedown();
    108110    echo $parsedown->text(base64_decode($response_array->content));
     
    110112}
    111113add_shortcode('embedGitHubReadme', 'dobsondev_shrtcode_create_github_readme');
     114
     115
     116/* Adds a shortcode for displaying GitHub README onto a page */
     117function 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}
     146add_shortcode('embedGitHubContent', 'dobsondev_shrtcode_create_github_file_contents');
    112147
    113148
  • dobsondev-shortcodes/tags/1.1.1/readme.txt

    r1127930 r1129669  
    44License: GPLv2
    55License 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 slideshow
     6Tags: 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
    77Requires at least: 2.5
    88Tested up to: 4.1.1
    9 Stable tag: 1.1.0
     9Stable tag: 1.1.1
    1010
    1111Add a collection of helpful shortcodes to your site.
     
    1919* Embed PDFs - Embeds PDFs into pages rather than separate links.
    2020* 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.
    2223* Embed [Twitch Stream](http://twitch.tv/) - Embeds a Twitch Stream into the page.
    2324* Embed [Twitch Stream](http://twitch.tv/) Chat - Embeds the chat from a Twitch Stream into the page.
     
    4950[embedGitHubReadme owner="Owner_of_Repo" repo="Repo_Name"]
    5051
    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.
     52This 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.
    5253
    5354The 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
     60This 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.
    5461
    5562**Embed Twitch Stream**
     
    140147== Changelog ==
    141148
     149= - 1.1.1 - =
     150
     151New Features
     152
     153* Added shortcode for displaying GitHub repository file contents.
     154
     155Bug Fixes
     156
     157* Changed some documentation errors.
     158
    142159= - 1.1.0 - =
    143160
    144 The Markdown Parser used for the GitHub Repository Readme shortcode is [Parsedown](http://parsedown.org/).
     161The Markdown Parser used for the GitHub repository Readme shortcode is [Parsedown](http://parsedown.org/).
    145162
    146163New Features
    147164
    148 * Added shortcode for displaying GitHub Repository README.md files
     165* Added shortcode for displaying GitHub repository README.md files
    149166
    150167Bug Fixes
  • dobsondev-shortcodes/trunk/changelog.txt

    r1127926 r1129669  
     1= 1.1.1 =
     2
     3New Features
     4
     5* Added shortcode for displaying GitHub repository file contents.
     6
     7Bug Fixes
     8
     9* Changed some documentation errors.
     10
    111= 1.1.0 =
    212
  • dobsondev-shortcodes/trunk/dobsondev-shortcodes.php

    r1127926 r1129669  
    44 * Plugin URI: http://dobsondev.com/portfolio/dobsondev-shortcodes/
    55 * Description: A collection of helpful shortcodes.
    6  * Version: 1.1.0
     6 * Version: 1.1.1
    77 * Author: Alex Dobson
    88 * Author URI: http://dobsondev.com/
     
    104104    ));
    105105    $response = curl_exec($curl);
     106    // var_dump($response);
    106107    $response_array = json_decode($response);
     108    // var_dump($response_array);
    107109    $parsedown = new Parsedown();
    108110    echo $parsedown->text(base64_decode($response_array->content));
     
    110112}
    111113add_shortcode('embedGitHubReadme', 'dobsondev_shrtcode_create_github_readme');
     114
     115
     116/* Adds a shortcode for displaying GitHub README onto a page */
     117function 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}
     146add_shortcode('embedGitHubContent', 'dobsondev_shrtcode_create_github_file_contents');
    112147
    113148
  • dobsondev-shortcodes/trunk/readme.txt

    r1127930 r1129669  
    44License: GPLv2
    55License 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 slideshow
     6Tags: 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
    77Requires at least: 2.5
    88Tested up to: 4.1.1
    9 Stable tag: 1.1.0
     9Stable tag: 1.1.1
    1010
    1111Add a collection of helpful shortcodes to your site.
     
    1919* Embed PDFs - Embeds PDFs into pages rather than separate links.
    2020* 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.
    2223* Embed [Twitch Stream](http://twitch.tv/) - Embeds a Twitch Stream into the page.
    2324* Embed [Twitch Stream](http://twitch.tv/) Chat - Embeds the chat from a Twitch Stream into the page.
     
    4950[embedGitHubReadme owner="Owner_of_Repo" repo="Repo_Name"]
    5051
    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.
     52This 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.
    5253
    5354The 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
     60This 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.
    5461
    5562**Embed Twitch Stream**
     
    140147== Changelog ==
    141148
     149= - 1.1.1 - =
     150
     151New Features
     152
     153* Added shortcode for displaying GitHub repository file contents.
     154
     155Bug Fixes
     156
     157* Changed some documentation errors.
     158
    142159= - 1.1.0 - =
    143160
    144 The Markdown Parser used for the GitHub Repository Readme shortcode is [Parsedown](http://parsedown.org/).
     161The Markdown Parser used for the GitHub repository Readme shortcode is [Parsedown](http://parsedown.org/).
    145162
    146163New Features
    147164
    148 * Added shortcode for displaying GitHub Repository README.md files
     165* Added shortcode for displaying GitHub repository README.md files
    149166
    150167Bug Fixes
Note: See TracChangeset for help on using the changeset viewer.