Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
zh-cn:wiki:syntax [2012/04/16 19:01] – [代码块] haobugzh-cn:wiki:syntax [2012/04/16 19:18] – [可下载的代码块] haobug
Line 348: Line 348:
   </file>   </file>
  
-==== Syntax Highlighting ====+==== 语法高亮 ====
  
-[[wiki:DokuWiki]] can highlight sourcecode, which makes it easier to read. It uses the [[http://qbnz.com/highlighter/|GeSHi]] Generic Syntax Highlighter -- so any language supported by GeSHi is supported. The syntax is the same like in the code and file blocks in the previous section, but this time the name of the used language is inserted inside the tag. Eg. ''<nowiki><code java></nowiki>'' or ''<nowiki><file java></nowiki>''.+[[wiki:DokuWiki]] 可以高亮源代码,使其更容易阅读。它使用[[http://qbnz.com/highlighter/|GeSHi]] 通用语法高亮器 -- 因此支持任何GeSHi所支持的语言。语法和前面章节中代码与文件块的很像,只是现在把所用语言的名称写到标签里面。例如''<nowiki><code java></nowiki>'' 或者 ''<nowiki><file java></nowiki>''
  
 <code java> <code java>
 /** /**
- The HelloWorldApp class implements an application that + * HelloWorldApp 类实现一个向到标准输出显示 "Hello World!"的程序。 
- * simply displays "Hello World!" to the standard output.+
  */  */
 class HelloWorldApp { class HelloWorldApp {
     public static void main(String[] args) {     public static void main(String[] args) {
-        System.out.println("Hello World!"); //Display the string.+        System.out.println("Hello World!"); //显示字符串。
     }     }
 } }
 </code> </code>
  
-The following language strings are currently recognized: //4cs, abap, actionscript-french, actionscript, actionscript3, ada, apache, applescript, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, ecmascript, eiffel, email, erlang, fo, fortran, freebasic, fsharp, gambas, genero, genie, gdb, glsl, gml, gnuplot, groovy, gettext, gwbasic, haskell, hicest, hq9plus, html, icon, idl, ini, inno, intercal, io, j, java5, java, javascript, jquery, kixtart, klonec, klonecpp, latex, lisp, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, modula2, modula3, mmix, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, ocaml-brief, ocaml, oobas, oracle8, oracle11, oxygene, oz, pascal, pcre, perl, perl6, per, pf, php-brief, php, pike, pic16, pixelbender, plsql, postgresql, povray, powerbuilder, powershell, progress, prolog, properties, providex, purebasic, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, vala, vbnet, vb, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, winbatch, whois, xbasic, xml, xorg_conf, xpp, z80//+下列字符串为当前可以识别语言://4cs, abap, actionscript-french, actionscript, actionscript3, ada, apache, applescript, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, ecmascript, eiffel, email, erlang, fo, fortran, freebasic, fsharp, gambas, genero, genie, gdb, glsl, gml, gnuplot, groovy, gettext, gwbasic, haskell, hicest, hq9plus, html, icon, idl, ini, inno, intercal, io, j, java5, java, javascript, jquery, kixtart, klonec, klonecpp, latex, lisp, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, modula2, modula3, mmix, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, ocaml-brief, ocaml, oobas, oracle8, oracle11, oxygene, oz, pascal, pcre, perl, perl6, per, pf, php-brief, php, pike, pic16, pixelbender, plsql, postgresql, povray, powerbuilder, powershell, progress, prolog, properties, providex, purebasic, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, vala, vbnet, vb, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, winbatch, whois, xbasic, xml, xorg_conf, xpp, z80//
  
-==== Downloadable Code Blocks ====+==== 可下载的代码块 ====
  
-When you use the ''%%<code>%%'' or ''%%<file>%%'' syntax as above, you might want to make the shown code available for download as well. You can to this by specifying a file name after language code like this:+当你使用上面的''%%<code>%%'' 或者 ''%%<file>%%'' 的时候,你可能想让显示的代码也可以被下载。您可以通过在语言代码后面指定一个文件名来实现这:
  
 <code> <code>
Line 380: Line 379:
 </file> </file>
  
-If you don't want any highlighting but want a downloadable file, specify a dash (''-''as the language code: ''%%<code - myfile.foo>%%''+如果您不想要任何高亮,但想要一个可下载的文件,指定破折号(''-''作为语言代码:''%%<code - myfile.foo>%%''
- +
 ===== Embedding HTML and PHP ===== ===== Embedding HTML and PHP =====