github/gollum — pull request #585 by dekimsey (2012-11-15 21:46:43+00:00)
Title: Modified gitcode to allow syntax highlighting of arbitrary files

The current functionality of the gitcode/embed logic is unclear. It behaves differently for local files vs. raw.github.com files. For reference: https://github.com/github/gollum#github-syntax-highlighting

* **Good:** A user can embed raw.github.com file contents with syntax highlighting.
* **Unclear:** A user can embed the html source of a local *rendered* wiki-page.
* **Fail:** Crashes when attempting to embed a local non-wiki file such as `foo.py`.
* **Fail:** Crashes when a wiki-page is referred to with an extension.
* **Fail:** Crashes on URIs that do not exist in the repository.

So, a user *cannot* embed a file stored in the local repository, even though that is what the raw.github.com functionality does. Is the intended use case for the local rendered wiki-page functionality to demo a template? Since it is rendered into HTML, it doesn't work in that case.

I propose that we remove the *unclear* and *fail* behaviors listed above. Instead provide the following:
* A user can embed a file stored in the local repository with syntax highlighting in a wiki page.
* Invalid references replaced with `

File not found: #{uri}

`.

**Note:** This commit currently allows a user to specify a wiki page for embedding, it will include the page's source with the syntax highlighting. My feelings on this behavior are mixed.

Look in `test/test_markup.rb` for the deviations from current behavior.