MondoKode-Zoomer was created for blogs that have a narrow reading column but will
be embedding code using the wp_syntax plugin. A narrow column is a pleasure to read
and there is a reason for this.
“That’s why newspapers have narrow columns: It makes them faster to read.”
However, it is a nuissance to have a narrow width constraint when presenting kode. I’ve caught myself
reformatting kode on numerous occasions in hope of eliminating the horizontal scrollbar.
With this plugin you can spend more time sharing kode and less time formatting it for a skinny column.
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.
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.
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>