Right now, bitbucket can only display files with pretty specific (and custom) suffixes. It would be great if it could at least attempt a little to try to find out the file format by looking at its contents.
AFAICS Pygments have no support for syntax coloring of markup files, so that shouldn't collide. I have been working on a [[https://bitbucket.org/mgorny/pymodeline/|modeline parser module]] for Python which could serve the purpose well. I will be happy to adjust the code to fit your needs.
The use is quite straightforward:
ml = pymodeline.ModelineParser() opts = ml.parse_buffer(f.read()) syn = opts.get('filetype', None) or opts.get('syntax', None)