Commits

Miki Tebeka  committed aef89c5

CSS and keywords

  • Participants
  • Parent commits 48bf981

Comments (0)

Files changed (1)

File highlighter.py

 
 class Highlighter:
     @expose
-    def index(self):
+    def index(self, **kw):
         return open("index.html").read()
 
     @expose
         if not code:
             return ""
 
-        lang = kw.get("lang", "")
+        lang = kw.get("lang", "").lower()
         if not lang:
             lexer = guess_lexer(code)
         else:
         formatter = HtmlFormatter(linenos=linenos, cssclass="source")
         return highlight(code, lexer, formatter)
 
+    @expose
+    def css(self, **kw):
+        return HtmlFormatter().get_style_defs()
+
 if __name__ == "__main__":
     quickstart(Highlighter())