summaryrefslogtreecommitdiffhomepage
path: root/vhosts/blog/nuldoc-src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-04-29 13:01:44 +0900
committernsfisis <nsfisis@gmail.com>2024-04-29 13:01:57 +0900
commitb082f01c144df6c9d4da358ffc054c69b4b4405c (patch)
tree45effdae08520e8402b607d09435a7ca3b02c8bc /vhosts/blog/nuldoc-src
parent9954c86c34b5096697453ee072a4dcc34aeb7401 (diff)
downloadnsfisis.dev-b082f01c144df6c9d4da358ffc054c69b4b4405c.tar.gz
nsfisis.dev-b082f01c144df6c9d4da358ffc054c69b4b4405c.tar.zst
nsfisis.dev-b082f01c144df6c9d4da358ffc054c69b4b4405c.zip
feat(blog/content): new post /posts/2024-04-29/zsh-file-completion-for-composer-custom-commands/
Diffstat (limited to 'vhosts/blog/nuldoc-src')
-rw-r--r--vhosts/blog/nuldoc-src/config.ts2
-rw-r--r--vhosts/blog/nuldoc-src/ndoc/to_html.ts7
-rw-r--r--vhosts/blog/nuldoc-src/types/highlight-js.d.ts5
3 files changed, 13 insertions, 1 deletions
diff --git a/vhosts/blog/nuldoc-src/config.ts b/vhosts/blog/nuldoc-src/config.ts
index a4f582e7..00fc686a 100644
--- a/vhosts/blog/nuldoc-src/config.ts
+++ b/vhosts/blog/nuldoc-src/config.ts
@@ -16,6 +16,7 @@ export const config = {
siteCopyrightYear: 2021,
tagLabels: {
"ci-cd": "CI/CD",
+ "composer": "Composer",
"conference": "カンファレンス",
"cpp": "C++",
"cpp17": "C++ 17",
@@ -42,6 +43,7 @@ export const config = {
"wireguard": "WireGuard",
"ya8": "Ya8",
"yapc": "YAPC",
+ "zsh": "Zsh",
},
},
};
diff --git a/vhosts/blog/nuldoc-src/ndoc/to_html.ts b/vhosts/blog/nuldoc-src/ndoc/to_html.ts
index dc39919b..926a0455 100644
--- a/vhosts/blog/nuldoc-src/ndoc/to_html.ts
+++ b/vhosts/blog/nuldoc-src/ndoc/to_html.ts
@@ -222,7 +222,12 @@ function highlightPrograms(doc: Document) {
const sourceCode = sourceCodeNode.content;
if (!hljs.getLanguage(language)) {
- return;
+ if (language === "zsh") {
+ // highlight.js does not have a language definition for zsh.
+ hljs.registerAliases("zsh", { languageName: "bash" });
+ } else {
+ return;
+ }
}
const highlighted =
diff --git a/vhosts/blog/nuldoc-src/types/highlight-js.d.ts b/vhosts/blog/nuldoc-src/types/highlight-js.d.ts
index d7bd0b50..67007b53 100644
--- a/vhosts/blog/nuldoc-src/types/highlight-js.d.ts
+++ b/vhosts/blog/nuldoc-src/types/highlight-js.d.ts
@@ -1,4 +1,9 @@
declare module "highlight.js" {
+ function registerAliases(
+ aliases: string | string[],
+ language: { languageName: string },
+ ): void;
+
function getLanguage(
name: string,
): string | undefined;