开发者

What are good jQuery plugins to highlight code and XML content? [closed]

开发者 https://www.devze.com 2022-12-21 22:46 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. 开发者_如何学编程

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Improve this question

I have a couple of web-pages where I write out some code c#, and some XML. I'd like to find a way to highlight the syntax of the different content to make it easier to read - very much like here on Stackoverflow?

I already use a bit of jQuery so something that plugs into that would be a nice fit.


Hm, I don't see where jQuery fits in there too well (because it is for DOM modification, not based on the textual content of the DOM).

Still, you might want to take a look at the very cool google-code-prettify. As far as I know, it is also used here at StackOverflow and it works like a charm for many languages. I use it myself and it's really easy to integrate.


You might want to look into Alex Gorbatchev's SyntaxHighlighter. It's one of the nicest formatters out there, and supports tons of syntaxes if you ever decide to format code in a new language.


  • highlight.js supports 118 languages and 54 styles out of the box. It is BSD-licensed.
  • Google's Javascript code prettifier also supports XML, License: Apache 2.0
  • Alex Gorbatchev's SyntaxHighlighter
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号