Class: Guider::Prettify
- Inherits:
-
Object
- Object
- Guider::Prettify
- Defined in:
- lib/guider/prettify.rb
Overview
Generates <script> tag for syntax-highlighting code blocks.
Class Method Summary collapse
Class Method Details
.to_html ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/guider/prettify.rb', line 4 def self.to_html <<-EOHTML <script type="text/javascript"> (function(){ var pres = document.getElementsByTagName("pre"); for (var len=pres.length, i=0; i < len; i++) { var code = pres[i].getElementsByTagName("code")[0]; if (code) code.className = "prettyprint"; } prettyPrint(); })(); </script> EOHTML end |