安装好coolcode
- package com.davidflanagan.examples.basics;
- /**
- * This program prints out all its command-line arguments.
- **/
- public class Echo {
- public static void main(String[] args) {
- int i = 0;
- // Initialize the loop variable
- while(i < args.length) {
- // Loop until the end of array
- System.out.print(args[i] + " ");
- // Print each argument out
- i++;
- // Increment the loop variable
- }
- System.out.println();
- // Terminate the line
- }
- }
从http://www.coolcode.cn地址download下来。
coolcode></coolcode>
代码
如果要加亮具体的语言,可以用 lang 属性来指定:
<coolcode lang=”程序设计语言”></coolcode>
代码
如果不需要行号,可以使用 linenum 属性来指定:
<coolcode linenum=”off” lang=”程序设计语言”></coolcode>
代码
如果希望可以直接以文件下载代码,可以使用 download 属性来指定:
下载: example.txt
<coolcode download=”文件名.扩展名” lang=”程序设计语言”></coolcode>
代码
这三个属性可以组合使用,互不影响。
目前支持的程序设计语言有:
actionscript
cpp
css
diff
dtd
html
java
javascript
mysql
perl
php
python
ruby
sql
xml