用于博客的代码格式化SyntaxHighlighter会引发错误

时间:2011-10-15 10:11:28

标签: syntax-highlighting blogger

我正在使用SyntaxHighlighter for blogger来格式化我在博客中使用的代码片段。我按照博客中给出的步骤(http://concise-software.blogspot.com/2010/03/enabling-syntaxhighlighter-in-blogger.html)但是然后它在我的博客帖子的页面加载时抛出错误,说“找不到刷子:CSS”

4 个答案:

答案 0 :(得分:2)

从stackoverflow上的另一个线程获得解决方案

  

Formatting code snippets for blogging on Blogger

答案 1 :(得分:0)

对于寻找此问题解决方案的其他人 - 请确保您在< head>< / head>中引用shBrushCss.js库。像这样的标签:

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/>

此外,您可以在http://oneqonea.blogspot.com/2012/04/how-do-i-add-syntax-highlighting-to-my.html

查看此答案的来源

这是一个非常容易理解的博客,我写的内容包括通过几个简单的步骤(截图)从上到下为Blogger博客添加语法突出显示。

答案 2 :(得分:0)

如果你经营一个博客博客,你可以按照以下步骤说明集成SyntaxHighlighter。

我很好地解释了:How to Add Syntax Highlighter to Blogger

答案 3 :(得分:0)

我在模板主管部分的末尾写道:

<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/shThemeDefault.css' rel='stylesheet' type='text/css'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js'/> 
<script> 
    SyntaxHighlighter.config.bloggerMode = true;
    SyntaxHighlighter.config.clipboardSwf = "http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf";
    SyntaxHighlighter.all();
</script>

接下来我在我的文章中写道:

<pre class="brush:bash">
ls -al | grep .jpg
</pre>

你可以举例说明here