Code Markup: WordPress plugin

Wednesday, 8 June 2005

Code Markup is a WordPress plugin that makes it easy to include program code samples in your posts. You can even include HTML markup in the code sample; Code Markup magically knows which characters should be displayed as code and which should be rendered as HTML.

For example, with Code Markup you can write:

<pre>
<code>
for (int i = 0; i < top; ++i) {
   vector<int> <span style="color:red">judy</span> = mary();
</code>
</pre>

And it will be displayed as

for (int i = 0; i < top; ++i) {
   vector<int> judy = mary();

with “judy” in red, just as you would expect. The <span> tag is rendered as normal HTML , but the <int> and i < top are displayed exactly as typed. This is very useful for times when you want to highlight a particular piece of code in your listing.

Code markup also prevents WordPress from turning your quotes into curly quotes, decrements (--) into dashes (–), and so on.

For details, many examples, download and so on, see the main Code Markup WordPress plugin page.

Tags:

One comment

You can leave a comment, or trackback from your own site.

Leave a comment