Miki Tebeka avatar Miki Tebeka committed 69cad80

Not needed

Comments (0)

Files changed (2)

     <script src="jquery.js"></script>
-        function on_code(obj, html) {
-            obj.html(
-        }
         function get_options(cls) {
             var options = {};
             var parts = cls.split(" ");
 from pygments.lexers import get_lexer_by_name, guess_lexer
 from pygments.formatters import HtmlFormatter
 class Highlighter:
     def index(self, **kw):
-        return open("index.html").read()
+        with open("index.html") as fo:
+            return fo.read()
     def highlight(self, **kw):
     def css(self, **kw):
         return HtmlFormatter().get_style_defs()
+    @expose
+    def demo(self, **kw):
+        with open("demo.html") as fo:
+            return fo.read()
 if __name__ == "__main__":
-    quickstart(Highlighter())
+    from os.path import dirname, join, abspath
+    root = dirname(abspath(__file__))
+    config = {
+        "/jquery.js" : {
+            "tools.staticfile.on": 1,
+            "tools.staticfile.filename": join(root, "jquery.js"),
+        }
+    }
+    quickstart(Highlighter(), config=config)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.