Render in the main editor view

Hi,

I have been playing with a package for myself designed to promote comments in code by using markdown syntax.

https://atom.io/packages/flip

Whilst this is ok, I would like to change the comments in the main view to the rendered markdown comment.

Can anyone provide pointers, preferably in Javascript to how to do this?

Thanks

Nick