From c2699d06c34640b2bf8ba8b6202ad4ff93703e7f Mon Sep 17 00:00:00 2001 From: Baraa Al-Masri Date: Mon, 30 Sep 2024 12:24:00 +0300 Subject: [PATCH] Add templ support (#1122) * Add support for templ * Remove file extension `tpl` (conflict with Pan) * Add quotes and important_syntax * Update readme * Add test for templ --- README.md | 1 + languages.json | 8 ++++++++ tests/data/templ.templ | 24 ++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 tests/data/templ.templ diff --git a/README.md b/README.md index 768a28bce..008f8780c 100644 --- a/README.md +++ b/README.md @@ -539,6 +539,7 @@ SystemVerilog Slint Tact Tcl +Templ Tex Text Thrift diff --git a/languages.json b/languages.json index e6d475a4d..2282aa624 100644 --- a/languages.json +++ b/languages.json @@ -1699,6 +1699,14 @@ "quotes": [["\\\"", "\\\""], ["'", "'"]], "extensions": ["tera"] }, + "Templ": { + "name": "Templ", + "line_comment": ["//"], + "multi_line_comments": [[""], ["/*", "*/"]], + "quotes": [["\\\"", "\\\""], ["'", "'"], ["`", "`"]], + "important_syntax": ["templ", "script", "css"], + "extensions": ["templ", "tmpl"] + }, "Tex": { "name": "TeX", "line_comment": ["%"], diff --git a/tests/data/templ.templ b/tests/data/templ.templ new file mode 100644 index 000000000..326d22670 --- /dev/null +++ b/tests/data/templ.templ @@ -0,0 +1,24 @@ +// 24 lines, 13 code, 8 comments, 3 blanks +package test + +templ Foo() { +
+ + +
+} + +/* + some css class. +*/ +css button() { + padding: 7px; + border-radius: 5px; +} + +// doSomething does something +script doSomething() { + alert("something") +}