From da27b5105f4cbaec59bd5b6b3796c07fc1c4155c Mon Sep 17 00:00:00 2001 From: Mark Harrison Date: Tue, 1 Sep 2020 10:12:43 +0100 Subject: [PATCH] Added Mustache templates as a separate type (modelled on Latte) (#4915) * Update languages.yml * Create csvrow.mustache * Rename samples/csvrow.mustache to samples/Mustache/csvrow.mustache * Added sample file * Create pupilinfoblock.mustache * Create showallusers.mustache * Updated Vendor README with Mustache Co-authored-by: Colin Seymour --- lib/linguist/languages.yml | 11 ++++++++++- samples/Mustache/csvrow.mustache | 1 + samples/Mustache/deleteuser.mustache | 20 ++++++++++++++++++++ samples/Mustache/pupilinfoblock.mustache | 8 ++++++++ samples/Mustache/showallusers.mustache | 8 ++++++++ vendor/README.md | 1 + 6 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 samples/Mustache/csvrow.mustache create mode 100644 samples/Mustache/deleteuser.mustache create mode 100644 samples/Mustache/pupilinfoblock.mustache create mode 100644 samples/Mustache/showallusers.mustache diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 489a556600..c42bafcfa0 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2036,7 +2036,6 @@ HTML+Django: extensions: - ".jinja" - ".jinja2" - - ".mustache" - ".njk" aliases: - django @@ -3386,6 +3385,16 @@ Muse: aliases: - amusewiki - emacs muse +Mustache: + type: markup + group: HTML + extensions: + - ".mustache" + tm_scope: text.html.smarty + ace_mode: smarty + codemirror_mode: smarty + codemirror_mime_type: text/x-smarty + language_id: 638334590 Myghty: type: programming extensions: diff --git a/samples/Mustache/csvrow.mustache b/samples/Mustache/csvrow.mustache new file mode 100644 index 0000000000..278fcfaea4 --- /dev/null +++ b/samples/Mustache/csvrow.mustache @@ -0,0 +1 @@ +{{knownas}} {{familyname}},{{groupdisplay}},{{homelocationdisplay}},{{currentlocationdisplay}},{{statuschangetime}},{{setbydisplay}},{{confirmedtime}},{{confirmedby}},{{pupilid}} diff --git a/samples/Mustache/deleteuser.mustache b/samples/Mustache/deleteuser.mustache new file mode 100644 index 0000000000..045e892b8a --- /dev/null +++ b/samples/Mustache/deleteuser.mustache @@ -0,0 +1,20 @@ +

Delete user: {{usernamedisplay}}

+{{#error}}
{{.}}
{{/error}} +{{#info}}
{{.}}
{{/info}} +

Permanently delete {{usernamedisplay}}

+
+ + + + {{#eplocation}}{{/eplocation}} + {{#eppupilgroup}}{{/eppupilgroup}} +
+ +
+ + Cancel +
+
diff --git a/samples/Mustache/pupilinfoblock.mustache b/samples/Mustache/pupilinfoblock.mustache new file mode 100644 index 0000000000..f252c1c24e --- /dev/null +++ b/samples/Mustache/pupilinfoblock.mustache @@ -0,0 +1,8 @@ +
+

Logged in as {{familyname}}, {{knownas}}

+ +

{{YourCurrentLocation}}: {{PrettyCurrentLocation}}

+

{{YourHomeLocation}}: {{PrettyHomeLocation}}

+

Change password

+

Log out

+
diff --git a/samples/Mustache/showallusers.mustache b/samples/Mustache/showallusers.mustache new file mode 100644 index 0000000000..f252c1c24e --- /dev/null +++ b/samples/Mustache/showallusers.mustache @@ -0,0 +1,8 @@ +
+

Logged in as {{familyname}}, {{knownas}}

+ +

{{YourCurrentLocation}}: {{PrettyCurrentLocation}}

+

{{YourHomeLocation}}: {{PrettyHomeLocation}}

+

Change password

+

Log out

+
diff --git a/vendor/README.md b/vendor/README.md index e8085e8005..0007c7c0bc 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -270,6 +270,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting - **MoonScript:** [leafo/moonscript-tmbundle](https://github.com/leafo/moonscript-tmbundle) - **Motorola 68K Assembly:** [zerkman/language-m68k](https://github.com/zerkman/language-m68k) - **Muse:** [Alhadis/language-emacs-lisp](https://github.com/Alhadis/language-emacs-lisp) +- **Mustache:** [textmate/php-smarty.tmbundle](https://github.com/textmate/php-smarty.tmbundle) - **NASL:** [tenable/sublimetext-nasl](https://github.com/tenable/sublimetext-nasl) - **NCL:** [rpavlick/language-ncl](https://github.com/rpavlick/language-ncl) - **NEON:** [Alhadis/language-etc](https://github.com/Alhadis/language-etc)