wp的code显示插件WP-Syntax的使用说明和more

星期一, 2008-11-17 | Author: liyz | wordpress | 4,139 views

自己装的是wp-syntax.0.8版本,现贴出使用,供自己方便查找

先展示一个<.!--more--.>

Wrap code blocks with <.pre lang="LANGUAGE" line="1" .> and `<./pre.>

where `LANGUAGE` is a [GeSHi](http://qbnz.com/highlighter/) supported language
syntax. See below for a full list of supported languages. The `line`
attribute is optional.

**Example 1: PHP, no line numbers**

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

**Example 2: Java, with line numbers**

1
2
3
4
5
    public class Hello {
      public static void main(String[] args) {
        System.out.println("Hello World!");
      }
    }

**Example 3: Ruby, with line numbers starting at 18**

18
19
20
21
22
    class Example
      def example(arg1)
        return "Hello: " + arg1.to_s
      end
    end

== Supported Languages ==

The following languages are supported in the `lang` attribute:

abap, actionscript, actionscript3, ada, apache, applescript, asm, **asp**,
autoit, **bash**, blitzbasic, bnf, **c**, c_mac, caddcl, cadlisp, cfdg, cfm,
cpp-qt, **cpp**, **csharp**, **css**, d, delphi, diff, div, dos, dot, eiffel,
fortran, freebasic, genero, gettext, glsl, gml, groovy, haskell,
**html4strict**, idl, ini, inno, io, **java**, **java5**, **javascript**,
kixtart, latex, lisp, lotusformulas, lotusscript, lua, m68k, matlab, mirc,
mpasm, mxml, **mysql**, nsis, **objc**, ocaml-brief, ocaml, oobas, **oracle8**,
pascal, per, **perl**, php-brief, **php**, plsql, **python**, qbasic, **rails**,
reg, robots, **ruby**, sas, scala, scheme, sdlbasic, smalltalk, smarty, **sql**,
tcl, text, thinbasic, tsql, **vb**, **vbnet**, verilog, vhdl, visualfoxpro,
winbatch, **xml**, xpp, z80

(Bold languages just highlight the more popular ones.)

文章作者: liyz

本文地址: https://www.pomelolee.com/121.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

相关文章

文章分类

Links

Meta