1. Bitbucket
  2. Public Issue Tracker
  3. master
  4. Issues


Issue #4456 closed

Please support obtaining the file markup format from vim modelines (BB-5100)

Michał Górny
created an issue

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:



import pymodeline

ml = pymodeline.ModelineParser() opts = ml.parse_buffer(f.read()) syn = opts.get('filetype', None) or opts.get('syntax', None)


Comments (5)

  1. Log in to comment