WP Gist For GitHub Gist in WordPress

When it comes to embedding source code into posts, I’ve been a fan of the SyntaxHighlighter plugin by Alex Mills for a long time – I’ve used it on every programming blog that I’ve maintained for as long as I can remember.

But ever since GitHub rolled out Gists, I’ve been using those to store frequently used functions, examples of code for posts or other articles, and snippets for which I’d like to have others come in introduce their changes, and/or their comments.

Straight from the Gist homepage:

Gist is a simple way to share snippets and pastes with others. All gists are Git repositories, so they are automatically versioned, forkable and usable from Git.

Easy enough, right?

Perhaps one of the cooler things about gists is that they can be embedded in WordPress posts; however, I’ve had mixed success with the native support in doing that.

But Michael Novotny’s WP Gist plugin makes it really easy to embed nice-looking, gist-specific code into a WordPress post.

Get The Gist in WordPress

WP Gist Homepage

From the website:

Features

  • Add GitHub Gist embeds to WordPress posts and pages with a shortcode.
  • Support for displaying a specific file within a Gist that has multiple files.
  • Adjusted styles to make GitHub Gist embeds look good with nearly any theme.

In short, WP Gist makes it really easy to embed GitHub Gists into your site (and do so without breaking any styles), but one of the things that I love the most about the plugin is that it allows you to include only a specific file from a gist.

For example, I used this feature in a recent post when talking about the WordPress Theme Customizer. Specifically, the Gist is made up of three different files each of which I needed to include at different times.

But WP Gist made it that much easier to draft the post.

Download WP Gist

For usage instructions, how to install the plugin, or even to contribute to it, you can check out the GitHub project page; otherwise, download the plugin.

7 Comments

I’m personally a fan of oEmbed Gist:
http://firegoby.jp/wp/oembed-gist

You simply paste a gist URL into your post and it automatically generates the embed.

This and GitPress Repo provide all of the Github functionality you could ask for:
https://github.com/bradthomas127/gitpress-repo

Gitpress actually embeds a repo in your post…not too shabby!

Clif

You may also like to give GistPress a try, since it has additional useful features: https://github.com/bradyvercher/gistpress

Hi Tom, maybe you will check a other solution for this requirement.
My plugin on github create also content for feeds, for non javascript page.

Trackbacks and Pingbacks

[…] I mentioned yesterday, I’ve recently started using WP Gist more than SyntaxHighlighter, but I’ve had to […]

Leave a Reply

Name and email address are required. Your email address will not be published.

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>