#942 Add support for Mustache templates in LexHTML

Won't_Implement
open
Neil Hodgson
Scintilla (356)
3
2012-06-04
2012-06-04
B_Lizzard
No

This patch adds (basic) support for Mustache templates in LexHTML. Mustache is a template language with wide language support, which is mainly used for websites.

http://mustache.github.com/

The template language itself is very thin, containing no logic, and does not embed or depend upon another language (unline Django or Mako), so this patch mainly adds hooks for syntax highlighting (which I've worked on for Geany, I'm not quite sure how SciTE works in that respect). The only thing I could conceivably add is automatic tag closing for sections and inverted sections, but I'll need some more time (or help) for that.

Feel free to berate me about the code quality and/or any missing features.

Thank you.

Related

Feature Requests: #425

Discussion

  • B_Lizzard
    B_Lizzard
    2012-06-04

    Mustache support in LexHTML

     
  • Neil Hodgson
    Neil Hodgson
    2012-06-04

    There are an enormous number of templating languages and they can not all have their own distinct set of lexical states, since Scintilla is limited to 256 states in total.

    Before the HTML lexer can grow beyond 7 bit lexical values (128 lexical states) I want someone to come up with a plan on how to make different templating and scripting languages coexist.

    Rejected until some progress is made on a plan for this lexer.

     
  • Neil Hodgson
    Neil Hodgson
    2012-06-04

    • assigned_to: nobody --> nyamatongwe
    • priority: 5 --> 3
    • milestone: --> Won't_Implement
     
  • B_Lizzard
    B_Lizzard
    2012-06-04

    Well, expressing such simple rules in code is overkill as it is, in my opinion. There should be simpler ways of specifying simple syntax highlighting rules via delimiters and whatnot. You can already specify custom single-line and multi-line comment delimiters (at least in Geany, not sure if this is a Scintilla feature), why not other stuff?

    It makes me cringe to think that I need to write a 100+ line patch that basically says "If # comes after {{, paint that a tag".

    Thanks.