SyntaxHighlighter (原名:dp.SyntaxHighlighter)是一套在浏览器上对各种代码进行语法着色的独立 JavaScript 库。格式化效果如下所示:
<title>SyntaxHighlighter Build Test Page</title>
<script type="text/javascript" src="sh/shCore.js"></script>
<link rel="stylesheet" type="text/css" href="sh/shCore.css">
<link rel="stylesheet" type="text/css" href="sh/shThemeDefault.css">
<script type="text/javascript">
SyntaxHighlighter.config.clipboardSwf = 'sh/clipboard.swf';
SyntaxHighlighter.all();
</script>
<h1>SyntaxHihglighter Test</h1>
<p>This is a test file to insure that everything is working well.</p>
<div id="highlighter_903387" class="syntaxhighlighter "><div class="bar "><div class="toolbar"><a href="#viewSource" title="view source" style="width: 16px; height: 16px" class="item viewSource">view source</a><div class="item copyToClipboard"><embed width="16" height="16" id="highlighter_903387_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowScriptAccess="always" wmode="transparent" flashVars="highlighterId=highlighter_903387" menu="false" src="sh/scripts/clipboard.swf"></div><a href="#printSource" title="print" style="width: 16px; height: 16px" class="item printSource">print</a><a href="#about" title="?" style="width: 16px; height: 16px" class="item about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="plain">function test() : String </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="plain">{ </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces"> </code><code class="keyword">return</code> <code class="plain">10; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="plain">} </code></td></tr></tbody></table></div></div></div><p>
附件借助syntaxhighlighter提供对c/c++,java,c#,javascript,html等语言的支持,提供多种风格供选择。</p><p> </p><p>
SyntaxHighlighter (原名:dp.SyntaxHighlighter)是一套在浏览器上对各种代码进行语法着色的独立 JavaScript 库。格式化效果如下所示:
<title>SyntaxHighlighter Build Test Page</title>
<script type="text/javascript" src="sh/shCore.js"></script>
<link rel="stylesheet" type="text/css" href="sh/shCore.css">
<link rel="stylesheet" type="text/css" href="sh/shThemeDefault.css">
<script type="text/javascript">
SyntaxHighlighter.config.clipboardSwf = 'sh/clipboard.swf';
SyntaxHighlighter.all();
</script>
<h1>SyntaxHihglighter Test</h1>
<p>This is a test file to insure that everything is working well.</p>
<div id="highlighter_903387" class="syntaxhighlighter "><div class="bar "><div class="toolbar"><a href="#viewSource" title="view source" style="width: 16px; height: 16px" class="item viewSource">view source</a><div class="item copyToClipboard"><embed width="16" height="16" id="highlighter_903387_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowScriptAccess="always" wmode="transparent" flashVars="highlighterId=highlighter_903387" menu="false" src="sh/scripts/clipboard.swf"></div><a href="#printSource" title="print" style="width: 16px; height: 16px" class="item printSource">print</a><a href="#about" title="?" style="width: 16px; height: 16px" class="item about">?</a></div></div><div class="lines"><div class="line alt1"><table><tbody><tr><td class="number"><code>1</code></td><td class="content"><code class="plain">function test() : String </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>2</code></td><td class="content"><code class="plain">{ </code></td></tr></tbody></table></div><div class="line alt1"><table><tbody><tr><td class="number"><code>3</code></td><td class="content"><code class="spaces"> </code><code class="keyword">return</code> <code class="plain">10; </code></td></tr></tbody></table></div><div class="line alt2"><table><tbody><tr><td class="number"><code>4</code></td><td class="content"><code class="plain">} </code></td></tr></tbody></table></div></div></div><p>
附件借助syntaxhighlighter提供对c/c++,java,c#,javascript,html等语言的支持,提供多种风格供选择。</p><p> </p><p>
</p> |