测试CoolCode插件

分类: WordPress相关 | 736 次点击 | 发表评论
由 Apex 发表于

今天在家里将coolcode插件装上了,测试了一下,效果那是相当的好。可惜一点:作者为了能够支持从页面上复制的代码粘贴到Word中,同时保持颜色信息,就将颜色硬编码到后台PHP文件中了。但是这并不是我想要的,因为我的页面主体是深色调的,导致直接使用他的颜色会非常刺眼。所以我做了一些修改,把PHP中的硬编码又去掉了,然后重新配色,以符合我的Blog的色彩搭配。

看看效果:

  1. // This is one-line comment.
  2. /*
  3.   And this is multi-line
  4.   comments for read.
  5. */
  6. #include <iostream>    // Use STL. (BUG: inline comment not work.)
  7. #include <string>
  8.  
  9. int main(void)
  10. {
  11.     string strInfo("Hello CoolCode!");
  12.     int i = 0;
  13.  
  14.     if(0 == i)
  15.     {
  16.         cout << strInfo << endl;
  17.         return 0;
  18.     }
  19.     else
  20.     {
  21.         cout << "ERROR: Some bad thing happened." << endl;
  22.         return -1;
  23.     }
  24. }

可以看出,绝大部分代码的色彩已经可以很好的显示了,这就已经足够了。CoolCode插件真是太棒了,赞一个~~~

这样,我就可以继续Lua编程之旅了。

PS.双击左侧的代码行数列,可以隐藏代码行数显示,试试看~~

敬请留言:

您可以使用下列XHTML标签:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>