Integrate Google Prettify in HTML Page

0 replies
Howdy Worriers,

Google prettify if one the best syntax highlighter ever. Its very light weight and easy to integrate with your website. Google Prettify also provides set of skins that you can use for code highlighting. So, All about to include script into your web page and than use snippet directly.

Here is how to add `js` script and use "<pre>" tag with "prettyprint" class to looks your code awesome.

PHP Code:
<!DOCTYPE html>
<
html>
<
head>
    <
title>Google Prettify</title>
    <
script src="js/https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
</head>
<body>
    <pre class="prettyprint">
        # Your code snippet
        &?php
        /**
        * Test Class for Google Prettify
        */
        class ClassName extends AnotherClass
        {
            
            function __construct(argument)
            {
                # code...
            }
        }
        ?&gt;
    </pre>
</body>
</html> 
That's It

I have has well described integration technique and features of Google Prettify in my blog (www.sgeek.org).

Integrate google prettify in Html page

Do let me know if i have missed something or any queries.
#google #html #integrate #page #prettify #sgeek

Trending Topics