The google-code-prettify project makes it possible to apply syntax highlighting to code examples in web pages. These notes are based on the Getting Started guide and README.
- Include the
run_prettify.js
script in your page. - Put your code example inside one of the supported elements and give the element the class
prettyprint
. The script supports thecode
,pre
, andxmp
elements.- The
xmp
element is deprecated. - If you are trying to show an HTML example in
pre
orcode
elements it will need to be HTML encoded.
HTML won’t render code block - In order to display
{{...}}
in pages containing AngularJS, you will need to use theng-non-bindable
directive on the element containing your code example.
How do I escape curly braces for display on page when using AngularJS?
ngNonBindable
- The