问题
I want to display large chunk of LESS file in my page. I want it to look as nice as possible so that users who see it will read it easily.
stackoverflow let me display it (for example) like this:
header {
color: red;
div.myClass {
color:blue;
}
}
but is there a plugin to display it nicer? I mean: div will be displayed in blue and class will be displayed in red, variables will be bold etc...
Is there some sort of javascript or jQuery library that does it?
thanks, Alon
回答1:
StackOverflow uses Prettify to do it's syntax highlighting.
It should work for what you want.
回答2:
SyntaxHighlighter is another really popular one. It's also available as a plugin on many platforms and supports a lot of languages.
http://alexgorbatchev.com/SyntaxHighlighter/
回答3:
Take a look at https://highlightjs.org/. This provides a variety of themes to highlight code written in almost every language.
来源:https://stackoverflow.com/questions/9320112/is-there-a-plugin-to-display-html-code-inside-my-web-page