Posts Tagged ‘Syntax’

When displaying code in a web-page, highlighting its syntax accordingly helps so much in easily reading it.

There are various syntax highlighters around (see 11 Syntax Highlighters To Beautify Code Presentation) and Lea Verou has released a lovely new one, named Prism, that is built with modern web standards in mind.

Prism Syntax Highlighter

Prism is lightweight (1.5KB minified & gzipped), can be integrated so easily (just insert a CSS and JS file) and works fast. It is already used to beautify lots of code in Dabblet (an interactive CSS playground) so its pretty stable.

New languages can be added and the functionality can be improved with the plug-in architecture and the look/feel can be completely styled via CSS.

  • Tags:
  • Filed under: Extras, MIT License, Tools
  • There are several code syntax highlighters and most of them handle the job well.

    For a very lightweight solution, Rainbow is a fresh one which is only 1.4kb and can be extended with ease.

    It is only needed to use the JS module for the language to be highlighted for keeping things small.

    Also, the colors and fonts used can be completely customized with CSS theming support.

    Rainbox Syntax Highlighter