From ca1a4a31706d0c03673fe4c414c645ed826b21c6 Mon Sep 17 00:00:00 2001 From: shu Date: Wed, 19 Aug 2026 15:56:06 +0800 Subject: 精简 Wiki 构建与运行方式 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将浏览器端工具整理为 utilities 插件,移除 Docker、Org GTD 和 files API,并补充单文件构建及 Node.js 运行入口。 --- plugins/utilities/highlight-caddyfile.tid | 65 +++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 plugins/utilities/highlight-caddyfile.tid (limited to 'plugins/utilities/highlight-caddyfile.tid') diff --git a/plugins/utilities/highlight-caddyfile.tid b/plugins/utilities/highlight-caddyfile.tid new file mode 100644 index 0000000..8427c3f --- /dev/null +++ b/plugins/utilities/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: /[{}]/ + } + ] + }; +}); -- cgit v1.2.3