=== WP-Syntax === Contributors: rmm5t Donate link: http://www.mcgearygroup.com/wp-syntax/ Tags: syntax highlighting, syntax, highlight, code Requires at least: 2.0 Tested up to: 2.1.2 Stable tag: 0.3 WP-Syntax provides clean syntax highlighting for embedding source code within pages or posts. == Description == WP-Syntax provides clean syntax highlighting using [geshi](http://qbnz.com/highlighter/) -- supporting a wide range of popular languages. This plugin was originally written for use with [EmacsBlog](http://www.emacsblog.org). It supports highlighting with or without line numbers and maintains formatting while copying snippets of code from the browser. == Installation == 1. Upload wp-syntax.zip to your Wordpress plugins directory, usually `wp-content/plugins/` and unzip the file. It will create a `wp-content/plugins/wp-syntax/` directory. 1. Activate the plugin through the 'Plugins' menu in WordPress. == Frequently Asked Questions == = Why is the plugin generating strange output? = Try editing code snippets without the visual editor. To turn off the visual editor for all your edits, uncheck the visual editor checkbox in your profile. == Screenshots == 1. PHP, no line numbers. 2. Java, with line numbers. 3. Ruby, with line numbers starting at 18. == Usage == Wrap code blocks with `
` and `
` where `LANGUAGE` is a geshi supported language syntax. The `line` attribute is optional. **Example 1: PHP, no line numbers**
    
**Example 2: Java, with line numbers**
    public class Hello {
      public static void main(String[] args) {
        System.out.println("Hello World!");
      }
    }
    
**Example 2: Ruby, with line numbers starting at 18**
    class Example
      def example(arg1)
        return "Hello: " + arg1.to_s
      end
    end
    
== Styling == WP-Syntax uses default geshi colors by default. It also uses inline styling to make sure that code highlights still work in RSS feeds. To spruce up your code snippets to look more like the screenshots, try adding this CSS to your stylesheet template: .wp_syntax { color: #100; background-color: #f9f9f9; border: 1px solid silver; margin: 0 0 1.5em 0; overflow: auto; } /* IE FIX */ .wp_syntax { overflow-x: auto; overflow-y: hidden; padding-bottom: expression(this.scrollWidth > this.offsetWidth ? 15 : 0); } .wp_syntax table { border-collapse: collapse; } .wp_syntax div, .wp_syntax td { vertical-align: top; padding: 2px 4px; } .wp_syntax .line_numbers { text-align: right; background-color: #def; color: gray; overflow: visible; }