Menu

#532 patch: mustache template mode

None
closed-accepted
5
2014-10-27
2014-08-19
No

The attached patch will give jEdit a mode file for the Mustache template language, with the CanJS [1] flavor. Mustache [2] was inspired by ctemplate, and is a logic-less template language. For specifics of the original Mustache language, view the "official" README [3]. (You may want to save the raw HTML file and view it locally in your browser.)

However, many web developers find at least some form of template logic (for example, iteration) extremely convenient, so CanJS [4] has implemented a version with some logic control. Consequently, this flavor of mustache assumes HTML as the default rendering when not in a Mustache SPAN or SEQ.

As regards item 1: it does indeed validate on my machine against jEdit's XML plugin.

As regards item 3: I'm not sure exactly what you'd like for this mode file. I'm happy to provide a sample document and image of it rendering on my machine. Please ask for specifically what you'd like.

[1] http://canjs.com/guides/Mustache.html

[2] http://mustache.github.io/

[3] https://github.com/mustache/mustache.github.com/blob/master/docs/files/README_md.html

[4] http://canjs.com/

1 Attachments

Discussion

  • Alan Ezust

    Alan Ezust - 2014-10-27

    When I open this with the XML plugin, I get the following errors:
    /home/ezust/workspace/jedit/trunk/modes/mustache.xml
    7:Attribute "HASH_CHAR" must be declared for element type "SPAN".
    17:Attribute "HASH_CHAR" must be declared for element type "SPAN".
    25:Attribute "HASH_CHAR" must be declared for element type "SPAN".
    35:Attribute "HASH_CHAR" must be declared for element type "SPAN".

     
  • Kevin Hunter Kesling

    That would be my mistake. I had assumed my copy of the XML plugin was not only installed but also enabled. Bad assumption, apparently. Fixed with this new version.

     
  • Alan Ezust

    Alan Ezust - 2014-10-27
    • assigned_to: Alan Ezust
    • Group: -->
     
  • Alan Ezust

    Alan Ezust - 2014-10-27

    Committed 23707

     
  • Alan Ezust

    Alan Ezust - 2014-10-27
    • status: open --> closed-accepted
     

Log in to post a comment.

MongoDB Logo MongoDB