3

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

PeeHaa
  • 71,436
  • 58
  • 190
  • 262
Alon
  • 7,618
  • 18
  • 61
  • 99

3 Answers3

3

StackOverflow uses Prettify to do it's syntax highlighting.

It should work for what you want.

Brandon
  • 68,708
  • 30
  • 194
  • 223
0

Take a look at https://highlightjs.org/. This provides a variety of themes to highlight code written in almost every language.

rkrishnan
  • 776
  • 1
  • 9
  • 21
  • Whoever down-voted this, it'd have been nice if you could leave a comment explaining why this is not a good answer. – rkrishnan Feb 12 '16 at 17:56
0

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/

Ian Hoar
  • 1,174
  • 1
  • 19
  • 40