Add

Tuesday, July 14, 2015

Syntax Highlighter Part 2 , Different Themes


If you haven't read part 2, go here

instead of the pretty print css, use the following css

https://www.dropbox.com/s/2iq1disou9mg2w7/desert.css?dl=0

I have just copied the above css and create a css file. For more themes visit this, themes gallery.
https://code.google.com/p/google-code-prettify/source/browse/trunk/styles/desert.css

lets see an example which is a ruby code
class test
        def test
                return "test"
        end
end

code for above syntax highlighter is below
<pre class="prettyprint">class test
        def test
                return "test"
        end
end
</pre>
<script>prettyPrint()</script>


It is pretty straightforward.

2. Adding Line Numbers
class test
        def test
                return "test"
        end
end

No comments:

Post a Comment

Hi, be precise in the comment. Don't move away from the problems.