格式化Blogger上的博客代码片段 [英] Formatting code snippets for blogging on Blogger

查看:148
本文介绍了格式化Blogger上的博客代码片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的博客托管在Blogger上,我经常在 C / C# / <$ c $中发布代码片段c> Java / XML 等等,但是我发现这个代码片断mangled。

<是否有任何网站可以用来事先分​​析代码片段并对格式进行排序,将XML< 转换为& amp ; lt; etc。



这个地区有很多问题,但是我找不到这个问题直接。

编辑: <头> 页面部分。这就是问题 - 你不能在Blogger AFAIK上做这个。

使用 syntaxhighlighter 2.0添加代码语法突出显示给博客

这是我的博客文章:
$ b

http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html



我希望它能帮助你们..我对它能做什么印象深刻。


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

Are there any web sites that I could use to parse the snippet beforehand and sort out the formatting, convert XML "<" to "&lt;" etc.

There are a numbers of questions around this area on SO but I couldn't find any that address this question directly.

Edit: 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.

解决方案

I've created a blog post entry which explains how to add code syntax highlighting to blogger using the syntaxhighlighter 2.0

Here's my blog post:

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.

这篇关于格式化Blogger上的博客代码片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆