2

Is there an off-the-shelf solution for highlighting the [markdown| ... |] blocks in Elm code?

At the moment I'm using haskell-mode to edit Elm files, and have two-mode-mode hooked up to switch to markdown-mode when I enter an appropriate block with

(require 'two-mode-mode)
(setq default-mode (list "Haskell" 'haskell-mode)
      second-modes (list (list "Markdown" "\[markdown|" "|\]" 'markdown-mode)))

Ideally, there would be a solution that just highlighted everything at once in the same buffer, keeping the appropriate regions in markdown-mode, but wasn't as complicated to set up as this seems to be.

elemakil
  • 3,681
  • 28
  • 53
Inaimathi
  • 13,853
  • 9
  • 49
  • 93
  • You're probably not willing to switch editors, but I wrote tmLanguage files for Sublime Text [here](https://github.com/deadfoxygrandpa/Elm.tmLanguage) that do what you want – deadfoxygrandpa Jun 28 '13 at 15:06
  • @deadfoxygrandpa - I wouldn't mind trying it, but I can't see a license anywhere on [that site](http://www.sublimetext.com/). How is Sublime's source released? – Inaimathi Jun 28 '13 at 15:17
  • It's a closed source commercial program with an unlimited length, unrestricted trial version – deadfoxygrandpa Jun 28 '13 at 23:43
  • @deadfoxygrandpa - That settles that then. No, I'm not willing to switch from a GPL-licensed editor to a non-Free one. – Inaimathi Jun 29 '13 at 12:20
  • Fair enough, I figured as much once you asked about the source. – deadfoxygrandpa Jun 29 '13 at 16:56
  • The Emacs Wiki has a Markdown solution, which should be easy enough to just convert the relevant portion over to haskell-mode for the font-lock highlighting that you seek. http://www.emacswiki.org/emacs/MarkdownMode – lawlist Aug 26 '13 at 04:36

1 Answers1

1

You can import deadfoxygrandpa's Elm.tmLanguage into Ace, the open-source web-based editor as described here.

thSoft
  • 21,755
  • 5
  • 88
  • 103