2010年10月22日

測試一下 syntax highlight

以後應該會要貼很多 code ....
試試看

int main()
{
    printf("Hello, world!");
    return 0;
}

順便記一下改了什麼好了
首先是用了這個 syntax highlighter
根據 blogger 的建議所以下面這段是放在 body 的結尾:
<!-- 
    bear modified
    for syntax highlight 
    reference http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html
  -->
  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/>
  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/>
  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'/>
  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'/>
  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/>
  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/>
  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/>
  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/>
  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/>
  <link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
  <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeRDark.css' rel='stylesheet' type='text/css'/>
  <script type='text/javascript'>
    SyntaxHighlighter.config.bloggerMode = true;
    SyntaxHighlighter.all();
  </script>

再來就是我不喜歡太亮所以改了一下 css:
.post h3 a {color: #cccccc;}
.post h3 a:visited {color: #cccccc;}
.entry-content {color: #cccccc;}
.entry-content a {color: #ccffff; font-style: italic;}
.entry-content a:visited {color: #cccccc; font-style: italic;}
.entry-content a:hover {color: #ccffff; text-decoration: none; border-bottom: 1px dotted #0099cc; cursor: help;}