Search code examples
javascripteditorsmartysyntax-highlightingcodemirror

In-browser JavaScript code editor with syntax highlighting support for Smarty template tags?


I have searched high and low on the Interwebs, and found some really awesome JS code editors with syntax highlighting and indentation and more... but none seem to have support for Smarty template tags yet.

A new Smarty mode for CodeMirror would be the best, but I'll use a different editor if I need to.

I did find this blog post... but it is VERY simple, and I would like to still support mixed HTML/CSS/JS highlighting, like the PHP mode for CodeMirror.

I just thought I would check with the SO hive mind before embarking on rolling my own CodeMirror mode. If I do make a new mode (and get anywhere with it) I'll post it here.

Thanks!


Solution

  • This may help. I wrote a Smarty mode for CodeMirror2 this weekend. See: http://www.benjaminkeen.com/misc/CodeMirror2/mode/smarty/

    I've also forked the CodeMirror project with my change here: https://github.com/benkeen/CodeMirror2

    All the best -

    Ben

    [EDIT: this is now part of the main script. I'll be shortly adding a Smarty/HTML/CSS/JS mode].