DilithiumMatrix
DilithiumMatrix

Reputation: 18627

enable markdown syntax highlighting in code comments/docs

There are great in-code documentation standards for python, for example:

Which use some nice, simple ReStructured / Markdown like syntax. Is there a way to have emacs render ReST / Md inside the comments of python code? I.e. the major-mode would still be python.el, and normal python syntax would work; but inside a comment block ('''...''' ) it would be rendered as some sort of markdown.

Upvotes: 0

Views: 482

Answers (1)

homeless
homeless

Reputation: 336

You should be able to achieve this by using the polymode package (https://github.com/vspinu/polymode). It allows you to have multiple major modes in one buffer. Have a look at the screenshot examples.

There are other packages too which can enable multiple major modes in one file: http://www.emacswiki.org/emacs/MultipleModes

Upvotes: 1

Related Questions