This plugin is essentially an integration of two plugins with some modifications.
I also included the latest version of Google Prettify to the plugin (Jan-8-2009)
USAGE
- Enclose any code inside a
<code>
block.
- Use
<code markup="..." lang="...">
to specify appearance of code.
Include any HTML markup you like in the code, for example to add emphasis to certain sections.
Separate <code>
blocks should be nested within a <pre>
block to preserve whitespace.
-
If you want to fine-tune how Code Markup treats your code, use the markup and lang attributes on the code tag to specify how Code Markup should handle it.
-
<code>
or <code markup="default">
allows common HTML tags to be rendered, and displays everything else exactly as written.
<code markup="none">
displays content exactly as written - no markup is rendered.
<code markup="all">
renders content as HTML - all markup is rendered.
<code markup="em strong a">
treats <em>
, <strong>
and <a>
tags as HTML markup - everything else is displayed exactly as written. You can put whatever tags you like in the markup attribute, separated by spaces. As a special case, you can include the comment tag - this means that HTML comments <!-- like this -->
will be rendered as normal HTML comments (i.e. not displayed).
<code lang="html">
or <code lang="xhtml">
displays content exactly as written, the same as <code markup="none">
.
- The markup attribute overrides the lang attribute.
- Separate
<code>
blocks should be nested within a <pre>
block to preserve whitespace.
This section describes how to install the plugin and get it working.
- Upload the
code_block_enabler/
folder to the /wp-content/plugins/
directory
- Activate the plugin through the 'Plugins' menu in WordPress
- Write posts/pages while using the
<code>
block
- Go to the Options page and click Writing. Make sure "WordPress should correct invalidly nested XHTML automatically" is NOT checked. (Otherwise it may do funny things to your code listings.)
- Go to the Users page and click Your Profile. Make sure "Use the visual rich editor when writing" is NOT checked. (The visual rich editor does not like Code Block Enabler.)