Open
Description
I would like for coderay to be able to detect the input format by looking at the contents of the file. This would be particularly helpful in conjunction with #110: Add support for input from STDIN; since coderay can't use the file extension in that case.
I have two ideas for how to support this initially:
- Detect a unified diff style input, for the example of piping a diff to coderay:
diff -U1 foo.txt bar.txt | coderay
- Add support for Emacs mode hints. So coderay could understand that this means it should treat the input as C:
/* -*- mode: c -*- */