mirror of https://github.com/XAMPPRocky/tokei
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
This commit is contained in:
parent
167af762d1
commit
c2699d06c3
|
|
@ -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": ["%"],
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
// 24 lines, 13 code, 8 comments, 3 blanks
|
||||
package test
|
||||
|
||||
templ Foo() {
|
||||
<div id="bar">
|
||||
<!--
|
||||
HTML comments are also allowed.
|
||||
-->
|
||||
<button class={ button() } onClick={ doSomething() }>Baz</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
/*
|
||||
some css class.
|
||||
*/
|
||||
css button() {
|
||||
padding: 7px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
// doSomething does something
|
||||
script doSomething() {
|
||||
alert("something")
|
||||
}
|
||||
Loading…
Reference in New Issue