Author

TheDesignJunkie.com is the blog of Cole Hicks. Cole is a web designer, consultant, and computer book author covering topics related to graphic design, the web, and web 2.0 technology.

Newsletter

    Weekly newsletter packed full of the latest web design tips, tutorials. It's free to subscribe and you can opt-out at any time.

Include Code Samples in Your Posts | Code Markup, a WordPress Plugin

16 November 2007 - 0:26

Writing code or script tutorials online can be a tedious task. The biggest problem is that to get the code to display property I’ve generally had to edit code brackets, quotes, dashes and other characters. Thankfully with WordPress there is an easier solution. Just use a plugin. There are several options available but the one that I’ve found most useful is called Code Markup and it was built by Bennett McElwee.

Visit his site to download the Code Markup plugin.

As his site states the reason this is useful is:

The plugin allows you to quickly copy and paste code into your blog, and add HTML markup to it to emphasise certain parts of it. Normally this is not possible without a lot of fiddly manual editing.

In the spirit of openness Bernette goes one step further. If you don’t feel that this plugin is exactly what you need he even suggests a few alternatives.

  • Preserve Code Formatting has a slightly more robust untexturizer (it correctly handles a triple dash, for example), but doesn’t allow any markup at all in code blocks.
  • Code Viewer displays code from an external file, so it’s not so good for tiny code snippets. However, it does allow readers to download the code, and it also adds line numbers. But again, no manual markup allowed.
  • Unfancy quote plugin uses the sledgehammer technique to avoid WordPress’s fancification of text: it disables it completely.

Of all the options available however, I prefer Code Markup. It is flexible and once you get the hang of the features you’ll find yourself creating and using code snips all over the place.

No Comments | Tags: WordPress

Add a Comment

*
To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
Click to hear an audio file of the anti-spam word