shiffman / icm.shiffman.net

Site for hosting ICM videos
4 stars 3 forks source link

Cosmetic treatment for inline code #4

Closed scottgarner closed 11 years ago

scottgarner commented 11 years ago

Syntax highlighting, line numbers, copy to clipboard button?

shiffman commented 11 years ago

would embedding a gist somehow be a good option?

scottgarner commented 11 years ago

Hmm. It's potentially easier, though you lose all of the benefits of storing everything in a single repository. I guess the tricky part would be tying it into Popcorn and the current annotation system, but it might worth looking at.

shiffman commented 11 years ago

I was thinking that there might be many places in the videos where I am referencing a short code snippet and just being able to write a quick gist and link to it from the annotations could be useful. Then again, I think it'll be easier to know what is actually useful once I start building out the actual annotation content more.

scottgarner commented 11 years ago

For now I've added support for google-code-prettify, which does basic syntax highlighting on any C-like language.

Duplicating Processing's highlighting exactly would require building a language extension, so I'll leave that for another issue if that's something we want.

I don't have line-numbering on because I didn't see the use of it unless specific lines were referred to in the video.

Finally, I didn't add any copy-to-clipboard function at this time because there doesn't seem to be a "correct" way to do it. A lot of sites rely on a hidden Flash shim and I'd rather avoid that. I'll be on the lookout for an elegant solution on other sites.

shiffman commented 11 years ago

this is a great start. we can revisit later, agreed a copy-to-clipboard function would be useful.