博主的代码格式化 SyntaxHighlighter 抛出错误

发布于 2024-12-10 08:43:10 字数 318 浏览 0 评论 0原文

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

I'm using SyntaxHighlighter for blogger to format the code snippet I use in my blog. I followed steps given in a blog (http://concise-software.blogspot.com/2010/03/enabling-syntaxhighlighter-in-blogger.html) but then it throws error on page load of my blogger post saying "Can't find brush for : CSS"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

错爱 2024-12-17 08:43:10

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

格式化 Blogger 上的博客代码段

Got solution from another thread on stackoverflow

Formatting code snippets for blogging on Blogger

依 靠 2024-12-17 08:43:10

对于其他正在寻找此问题解决方案的人 - 确保您在 中引用 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 博客添加语法突出显示。

For others looking for a solution to this problem - Make sure you're referencing the shBrushCss.js library from within your <head></head> tag like so:

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

Also, you can checkout this answer's source at http://oneqonea.blogspot.com/2012/04/how-do-i-add-syntax-highlighting-to-my.html

It's a really easy to follow blog that I wrote that covers adding syntax highlighting to your Blogger Blog from top to bottom in a few easy steps (with screenshots).

伤感在游骋 2024-12-17 08:43:10

如果您经营博主博客,则可以按照下面说明的以下步骤来集成 SyntaxHighlighter。

我已经很好地解释了: 如何向 Blogger 添加语法荧光笔

If you run a blogger blog, you can follow the following steps explained bellow to integrate the SyntaxHighlighter.

I've nicely explained: How to Add Syntax Highlighter to Blogger

心凉 2024-12-17 08:43:10

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

<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>

您可以在此处查看示例。

I wrote in the end of template head section this:

<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>

Next i wrote in my articles:

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

You can example here see.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文