DefinitelyTyped / definitelytyped.github.io

Website content for definitelytyped.org
http://definitelytyped.org
MIT License
240 stars 96 forks source link

Fix highlighter #3

Open Bartvds opened 10 years ago

Bartvds commented 10 years ago

I'm working on a highlight.js TypeScript highlighter:

http://highlightjs.org/

http://highlightjs.readthedocs.org/en/latest/

Hacked it from the JavaScript and ActionScript highlighters but it is complicated.

It is semi-borken now (it bails on complex code.. weird) but we'll fix it.

johnnyreilly commented 10 years ago

Is it enough to use Googles prettyprint? I use that for code samples in my blog and its pretty good. Can provide more details if interested?

Bartvds commented 10 years ago

Does it do typescript? I tried few JS highlighters but they all miss a lot of stuff (some even crash / bail on generics)

johnnyreilly commented 10 years ago

I don't think it explicitly supports TS but it seems to work well enough anyway. You can find it here:

https://code.google.com/p/google-code-prettify/

I use the CDN to serve in on my blog

I've never known it crash / bail...