Wordpress Plugin: Pastie Comments

I’ve decided to simply use Pastie for my code posting and syntax highlighting purposes here. Pastie offers a <script> tag that allows you to easily embed your highlighted code on any page.

Unfortunately, we’re nerds and we often respond to one another in code, but the <script> tag has been disabled within the comments section for obvious reasons. What are we to do?

Release a Wordpress plugin that creates a new xHTML tag for use within Wordpress comment forms, of course! You are now free to respond to posts on this blog in code by simply going to Pastie and saving your snippet. Make note of the ID for that snippet (it’s in the URL), then use the following syntax in the comment form: <pastie:12345 />

Of course, you would replace 12345 with the actual Pastie ID.

Download Pastie Comments (602 bytes)

I hope to make this process a bit easier in the future (probably by just floating an AJAX-loaded modal iframe of Pastie) but for now I think this process will work.

What next?

One response to “Wordpress Plugin: Pastie Comments”

Quite clever!

Leave a comment

If you like, you can format your comment using these HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

You can even comment with a code snippet from Pastie by using: <pastie:##### /> - replacing the #'s with the Pastie ID of the snippet.