Plugin Directory

MondoKode-Zoomer

MondoKode-Zoomer provides an overlay window for kode formatted with the [wp_syntax](http://wordpress.org/extend/plugins/wp-syntax/) plugin.

Download Version 0.1

Basic Usage

Add a zoom attribute to a pre block that wp_syntax formats. Valid values for the attribute are "yes" and "no".

 <pre lang="LANGUAGE" zoom="yes"> 

The attribute is not required. When it is not present zoom is not enabled.

Wp-syntax Changes

To allow wp_syntax and MondoKode-zoomer to play nicely you need to use the version of wp-syntax.php provided with this plugin. The changes to the file are listed here, do a diff comparison with the original to see the changes in detail.

  1. zoom is added as a supported attribute in $allowedposttags and $allowedtags.
  2. The regular expression in the wp_syntax_before_filter function has been modified to allow the zoom attributed.
  3. In the wp_syntax_highlight function some logic was added to add the wp_syntax_zoom css class to a div block if zoom was enabled.

Usage

Use regular wp-syntax formatting commands but add the zoom attribute if you want the kode to zoom. It's that simple.

Example 1: Enabling zoom

<pre lang="php" zoom="yes">
<div id="foo">
<?php
  function foo() {
    echo "Hello World!\\n";
  }
?>
</div>
</pre>

Example 2: Explicitly disabling zoom

<pre lang="java" zoom="no" >
public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}
</pre>

Example 3: Zoom is implicity disabled because the attribute does not exist

<pre lang="ruby" line="18">
class Example
  def example(arg1)
    return "Hello: " + arg1.to_s
  end
end
</pre>

Requires: 2.8 or higher
Compatible up to: 2.8
Last Updated: 2009-7-6 Downloads: 109

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(0 ratings)

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

Log in to vote.