安装好coolcode

  1. package com.davidflanagan.examples.basics;
  2.  
  3. /**
  4. * This program prints out all its command-line arguments.
  5. **/
  6. public class Echo {
  7. public static void main(String[] args) {
  8. int i = 0;
  9.  
  10. // Initialize the loop variable
  11. while(i < args.length) {
  12.  
  13. // Loop until the end of array
  14. System.out.print(args[i] + " ");
  15.  
  16. // Print each argument out
  17. i++;
  18.  
  19. // Increment the loop variable
  20. }
  21. System.out.println();
  22.  
  23. // Terminate the line
  24. }
  25. }


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

相关帖子:
  • No Related Posts
  • micas Jun 29th 2007 05:15 pm IT Knowledge Sharing No Comments yet Trackback URI Comments RSS

    Leave a Reply

    You must be logged in to post a comment.