shiffman / icm.shiffman.net

Site for hosting ICM videos
4 stars 3 forks source link

Multiple file support for inline code #5

Closed scottgarner closed 11 years ago

scottgarner commented 11 years ago

Allow linking to a folder of files on GitHub to be displayed as tabs instead of just a single file.

scottgarner commented 11 years ago

I've got a new approach that makes it easier to embed individual files. You just link to a Github page as normal and add a special data attribute. The code will auto-discover the API link, embed the file and highlight it.

https://github.com/shiffman/icm.shiffman.net/blob/gh-pages/_posts/2013-07-26-3.1.html

This should be much nicer than my initial approach, which required an obscure API link.

As for multiple files, are there any ICM examples up with multiple classes? I see that some of the 8.x lessons cover classes, but the chapter numbers don't seem to map directly to the repository.

shiffman commented 11 years ago

The chapter 8 examples introduce objects, but they are so simple I left everything in one tab. We could separate them just to try it out. . . ? I haven't gotten to updating chapter 9 yet (will happen this week) but there is one there.

https://github.com/shiffman/LearningProcessing/tree/master/chp9/example_9_9

scottgarner commented 11 years ago

No problem, I just noticed that in the video for 8.3 you had a Bubble class in its own tab, but I couldn't find the matching code. I'll just use 9.9 as a test for now.

shiffman commented 11 years ago

Yes, this is one of the strange things about these videos. The code I'm using doesn't actually follow the Learning Processing examples. It's conceptually close but I was improvising along the way. What I'd like to do is have a repo and post code that matches. . but this is just one of those "time" things along with annotations.

scottgarner commented 11 years ago

Definitely understood. Having a repository with the actual code in the videos probably precludes having useful annotations, then. Either way, I can get the underlying framework in place for multiple files so it's ready to roll.

scottgarner commented 11 years ago

I've got initial support working for this that should handle most simple cases:

http://icm.shiffman.net/8.3/

We can open a new issue if we decide more features are needed.