Source

highlight / demo.html

<html>
    <head>
        <title>Test</title>
    </head>
    <body>
        <h3>Testing</h3>
        <pre class="highlight lang=python">
        #!/usr/bin/env python
        '''Run Google Query'''

        import webbrowser

        WEB_URL = "http://www.google.com/search?esrch=BetaShortcuts&amp;q=%s"
        IMAGE_URL = "http://images.google.com/images?q=%s"

        def google(query, url=WEB_URL):
            if isinstance(query, (tuple, list)):
                query = "+".join((item.strip() for item in query if item))

            url = url % query
            webbrowser.open(url)

        def main(argv=None):
            if argv is None:
                import sys
                argv = sys.argv

            from optparse import OptionParser

            parser = OptionParser("usage: %prog QUERY [QUERY2 ...]")
            parser.add_option("-i", "--images", help="search images",
                dest="images", action="store_true", default=0)

            opts, args = parser.parse_args(argv[1:])
            if len(args) &lt; 1:
                parser.error("wrong number of arguments") # Will exit

            url = IMAGE_URL if opts.images else WEB_URL
            google(args, url)

        if __name__ == "__main__":
            main()
        </pre>

        <p>
            Some random text here ...
        </p>
    </body>
    <script src="http://localhost:8080/highlight.js"></script>
</html>