为 Blogger 上的博客格式化代码片段 [英] Formatting code snippets for blogging on Blogger
问题描述
我的博客托管在 Blogger 上,我经常在 C
/C#
/Java
/XML
等等,但我发现片段被破坏"了.
My blog is hosted on Blogger and I frequently post code snippets in C
/ C#
/ Java
/ XML
etc. but I find the snippet gets "mangled".
是否有任何网站可以用来预先解析代码段并整理格式,将 XML "<
" 转换为 "<
"等等
Are there any web sites that I could use to parse the snippet beforehand and sort out the formatting, convert XML "<
" to "<
" etc.
关于 SO 的这个领域有很多问题,但我找不到任何直接解决这个问题的问题.
There are a numbers of questions around this area on SO but I couldn't find any that address this question directly.
对于 @Rich 答案,网站声明 要显示在您的网站上格式化代码,您需要获取此 CSS 样式表,并在页面的
<head>
部分添加对它的引用".这就是问题所在 - 您无法在 Blogger AFAIK 上执行此操作.
For @Rich answer, site states "To display the formatted code on your site, you need to get this CSS stylesheet, and add a reference to it in the
<head>
section of your page". That's the problem - you can't do this on Blogger AFAIK.
推荐答案
我创建了一篇博文,解释了如何使用 syntaxhighlighter 2.0
I've created a blog post entry which explains how to add code syntax highlighting to blogger using the syntaxhighlighter 2.0
这是我的博文:
http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html
我希望它对你们有帮助.我对它的功能印象深刻.
I hope it helps you guys.. I'm quite impressed with what it can do.
以上链接停止工作.尝试使用 http://hilite.me/
Above Links stopped working. Try using http://hilite.me/
这篇关于为 Blogger 上的博客格式化代码片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!