diff options
| author | shu <nvcsadjkojf@outlook.com> | 2026-07-26 22:42:45 +0800 |
|---|---|---|
| committer | shu <nvcsadjkojf@outlook.com> | 2026-07-26 22:42:45 +0800 |
| commit | 338cc101f127e4841689c1f81227ee033e57ad28 (patch) | |
| tree | 490cfc2ca29dc28e116a979f5c19b0851c3ea32e /tiddlers/plugin-highlight-caddyfile.tid | |
| parent | 1888ff59743d83bd7776b0f16ef0bc20d68e3e10 (diff) | |
Add task board and organize local plugins
Diffstat (limited to 'tiddlers/plugin-highlight-caddyfile.tid')
| -rw-r--r-- | tiddlers/plugin-highlight-caddyfile.tid | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/tiddlers/plugin-highlight-caddyfile.tid b/tiddlers/plugin-highlight-caddyfile.tid new file mode 100644 index 0000000..8427c3f --- /dev/null +++ b/tiddlers/plugin-highlight-caddyfile.tid @@ -0,0 +1,65 @@ +tiddlers/highlight-caddyfile.tid +title: $:/plugins/local/highlight-languages/caddyfile.js +type: application/javascript +module-type: highlight + +/*\ +title: $:/plugins/local/highlight-languages/caddyfile.js +type: application/javascript +module-type: highlight + +Caddyfile language definition for highlight.js. +\*/ +"use strict"; + +hljs.registerLanguage("caddyfile",function(hljs) { + return { + name: "Caddyfile", + aliases: ["caddy"], + case_insensitive: true, + contains: [ + { + className: "comment", + begin: /#/, + end: /$/ + }, + { + className: "section", + begin: /^\s*(?=[^#\n{]*(?:[.:,]|\blocalhost\b))(?:https?:\/\/)?[^\s#{}]+(?:\s*,\s*[^\s#{}]+)*(?=\s*\{?\s*$)/, + relevance: 10 + }, + { + className: "keyword", + begin: /^\s*[A-Za-z_][A-Za-z0-9_-]*(?=\s|$)/, + relevance: 1 + }, + { + className: "meta", + match: /@[A-Za-z0-9_-]+/ + }, + { + className: "variable", + match: /\{\$?[A-Za-z_][A-Za-z0-9_.\-[\]*]*\}/ + }, + { + className: "title", + match: /\([A-Za-z_][A-Za-z0-9_-]*\)/ + }, + hljs.QUOTE_STRING_MODE, + hljs.APOS_STRING_MODE, + { + className: "literal", + match: /\b(?:true|false|on|off)\b/ + }, + { + className: "number", + match: /\b\d+(?:\.\d+)?(?:ns|us|ms|s|m|h|d|kb|mb|gb|tb)?\b/i, + relevance: 0 + }, + { + className: "punctuation", + match: /[{}]/ + } + ] + }; +}); |
