forked from wet-boew/wet-boew
-
Notifications
You must be signed in to change notification settings - Fork 0
Prettify
pjackson28 edited this page Sep 2, 2013
·
4 revisions
Syntax highlighting of source code snippets in an html page using google-code-prettify.
Project lead: Paul Jackson (@pjackson28)
- Apply class="wet-boew-prettify" to an element on the page to load the component (once per page).
- Apply class="prettyprint" to a pre or code element to apply syntax highlighting. Alternatively use class="wet-boew-prettify all-pre" to apply syntax highlighting to all pre elements on the page.
- Apply class="linenums" to a pre or code element to add line numbers. Alternatively use class="wet-boew-prettify linenums" to all applicable pre elements. Specify the starting number by adding linenums:# before linenums.
- Add extra language support by using class="wet-boew-prettify lang-*" (e.g., class="wet-boew-prettify lang-css") and applying class="lang-*" to each applicable pre or code element.
Prettify is dependent upon google-code-prettify(Apache License 2.0).
The code for Prettify is located in several places within the source folder of WET:
- js/workers/prettify.js - contains the JavaScript code for prettify
- js/sass/includes/_prettify.scss - contains the CSS for prettify
- js/dependencies/prettify.js - main script file for google-code-prettify
There are no known issues at this point in time.