如何在博客上设置语法高亮显示器

Ani*_*nil 64 blogger syntax-highlighting syntaxhighlighter

如何在博客新界面上设置语法荧光笔.我尝试了很多选项,但直到没有工作.请给出任何建议.

Mah*_*iya 130

1. 首先,把你的博客模板的备份
2. 之后打开你的博客模板(在编辑HTML模式)复制所有的CSS 在这个环节上给予</b:skin>标签
3 粘贴前followig代码</head>标签

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCSharp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCss.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushDelphi.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJava.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJScript.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPhp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPython.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushRuby.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushSql.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushVb.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushXml.js' type='text/javascript'></script>
Run Code Online (Sandbox Code Playgroud)

4.</body>标记之前粘贴以下代码.

<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>
Run Code Online (Sandbox Code Playgroud)

5. 保存Blogger模板.
6. 现在语法高亮可以使用,您可以将它与<pre></pre>标签一起使用.

<pre name="code">
...Your html-escaped code goes here...
</pre>

<pre name="code" class="php">
    echo "I like PHP";
</pre>
Run Code Online (Sandbox Code Playgroud)

7. 你可以逃脱你的代码在这里.
8. 以下<class>属性支持的语言列表.

  • 谈到第3步,如果你输入任何链接(假设在浏览器中点击此URL http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js),那么它给出的错误消息404.这是一个错误.在此服务器上找不到请求的URL /svn/trunk/Scripts/shCore.js.我们知道的就这些.任何人都知道这件事. (3认同)
  • 链接不再起作用. (3认同)
  • Google代码即将关闭.所以这可能不再适用了 (2认同)
  • 第一个链接现在已经死了 (2认同)

Joh*_*rck 23

结帐http://oneqonea.blogspot.com/2012/04/how-do-i-add-syntax-highlighting-to-my.html

这是一个非常简单的"Blogger的SyntaxHighlighter"教程,带有截图和一切.

你应该在几分钟内启动并运行.

此外,本教程围绕您所指的"新界面"构建.

希望这可以帮助.快乐的编码.