We had a naive implementation for Gist oneboxes, however it failed miserably due to dynamic loading:
In particular this:
To resolve this issue:
- It must take care of truncating huge files
- It must take care of displaying gists with multiple files
Syntax highlighting is to be handled by our pre-existing syntax highlighting engine, all the onebox is to do is to decorate divs with the guessed syntax.
I thought of possibly using therubyracer to evaluate the gist js, but it inserts stylesheets. Additionally there is a possibly iframe approach but it will be both slower (and impact rendering) and more fragile.