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.jsscript 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, andxmpelements.- The
xmpelement is deprecated. - If you are trying to show an HTML example in
preorcodeelements 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-bindabledirective on the element containing your code example.
How do I escape curly braces for display on page when using AngularJS?
ngNonBindable
- The