From 7a0a00e15c91c6676d7d70a76370921fc9448d53 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Wed, 6 Mar 2024 13:00:22 +0100 Subject: [PATCH] add support for fenced divs --- website/nix/pdefs.nix | 331 ++++++++---- website/package-lock.json | 507 ++++-------------- website/package.json | 3 +- website/src/app/f/[...path]/page.tsx | 59 +- website/src/components/filter.tsx | 2 +- .../markdownPreview/MarkdownPreview.tsx | 11 +- website/src/plugins.ts | 63 +++ website/src/styles/globals.css | 141 ++++- website/src/utils.ts | 35 +- 9 files changed, 592 insertions(+), 560 deletions(-) create mode 100644 website/src/plugins.ts diff --git a/website/nix/pdefs.nix b/website/nix/pdefs.nix index 6e3def4..e398b94 100644 --- a/website/nix/pdefs.nix +++ b/website/nix/pdefs.nix @@ -1712,16 +1712,16 @@ treeInfo = { }; version = "13.5.6"; }; - "14.0.3" = { + "14.1.2" = { fetchInfo = { - narHash = "sha256-ek4Om3Y3BOkIV3SWNCIyObHTfreim7liNDDEfJuLf3E="; + narHash = "sha256-fQmIkH+++s+UMnU0kMzinBkPAidFAZQ5E03B6wCDMXg="; type = "tarball"; - url = "https://registry.npmjs.org/@next/env/-/env-14.0.3.tgz"; + url = "https://registry.npmjs.org/@next/env/-/env-14.1.2.tgz"; }; ident = "@next/env"; ltype = "file"; treeInfo = { }; - version = "14.0.3"; + version = "14.1.2"; }; }; "@next/eslint-plugin-next" = { @@ -1773,11 +1773,11 @@ }; }; "@next/swc-darwin-arm64" = { - "14.0.3" = { + "14.1.2" = { fetchInfo = { - narHash = "sha256-Sr4QnFjmaWO+V74I9w8xJJSgxjMbcrhjBXzih3dKUng="; + narHash = "sha256-mnItYbLOOvrpPuLHuSwKsZyeYaOmGSMRl7hSK1T4mqw="; type = "tarball"; - url = "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.3.tgz"; + url = "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.2.tgz"; }; ident = "@next/swc-darwin-arm64"; ltype = "file"; @@ -1790,15 +1790,15 @@ ]; }; treeInfo = { }; - version = "14.0.3"; + version = "14.1.2"; }; }; "@next/swc-darwin-x64" = { - "14.0.3" = { + "14.1.2" = { fetchInfo = { - narHash = "sha256-xjHt9wejiXRPxYP+GxGXYrxF3QmZ16eRbcrMTleMq6o="; + narHash = "sha256-2JoouS2KHkfdIF5DoZfnGo56Iv1lqDzt8sjDyaoOWY8="; type = "tarball"; - url = "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.3.tgz"; + url = "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.2.tgz"; }; ident = "@next/swc-darwin-x64"; ltype = "file"; @@ -1811,15 +1811,15 @@ ]; }; treeInfo = { }; - version = "14.0.3"; + version = "14.1.2"; }; }; "@next/swc-linux-arm64-gnu" = { - "14.0.3" = { + "14.1.2" = { fetchInfo = { - narHash = "sha256-tOhQcwJwsmdOeOxo4mXzGd5puh0w9GY0AH+PkPZ3aqw="; + narHash = "sha256-WOWlJ37NAwtGVJFF67kzMEwDe4ABhJZBfw0d+6oh6T8="; type = "tarball"; - url = "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.3.tgz"; + url = "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.2.tgz"; }; ident = "@next/swc-linux-arm64-gnu"; ltype = "file"; @@ -1832,15 +1832,15 @@ ]; }; treeInfo = { }; - version = "14.0.3"; + version = "14.1.2"; }; }; "@next/swc-linux-arm64-musl" = { - "14.0.3" = { + "14.1.2" = { fetchInfo = { - narHash = "sha256-y25pXcg+OnSEyj7D517ZNGlq3luHqjRqIhZ093+kGwU="; + narHash = "sha256-Z082DIeUVN5InCyMErEpvVx9vjxs7PPmqNmmQJc3uXE="; type = "tarball"; - url = "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.3.tgz"; + url = "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.2.tgz"; }; ident = "@next/swc-linux-arm64-musl"; ltype = "file"; @@ -1853,15 +1853,15 @@ ]; }; treeInfo = { }; - version = "14.0.3"; + version = "14.1.2"; }; }; "@next/swc-linux-x64-gnu" = { - "14.0.3" = { + "14.1.2" = { fetchInfo = { - narHash = "sha256-dUTPPjzGKPN7Z/KVjaIc3rDN4FZ+oY1BUPGpX2AACWo="; + narHash = "sha256-/2HUy3pD34yB1bp/mfUjNQ3rVVt9r3+ywRFc0Mp4XP0="; type = "tarball"; - url = "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.3.tgz"; + url = "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.2.tgz"; }; ident = "@next/swc-linux-x64-gnu"; ltype = "file"; @@ -1874,15 +1874,15 @@ ]; }; treeInfo = { }; - version = "14.0.3"; + version = "14.1.2"; }; }; "@next/swc-linux-x64-musl" = { - "14.0.3" = { + "14.1.2" = { fetchInfo = { - narHash = "sha256-BkgsaiTrIsjCDp3RoTpB6nhUoZoZMH/LcoGZ50OTPDs="; + narHash = "sha256-mpfrE7lE2bvHIb1jiI/SdcPppE4iFvYbj7j1Q78uXcA="; type = "tarball"; - url = "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.3.tgz"; + url = "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.2.tgz"; }; ident = "@next/swc-linux-x64-musl"; ltype = "file"; @@ -1895,15 +1895,15 @@ ]; }; treeInfo = { }; - version = "14.0.3"; + version = "14.1.2"; }; }; "@next/swc-win32-arm64-msvc" = { - "14.0.3" = { + "14.1.2" = { fetchInfo = { - narHash = "sha256-drbw0ZbEfkx6RpoPMLe3u5dqk5u6qnMG1FBVAkYATY8="; + narHash = "sha256-/USec636PYHmU+41fIk1YIiOJXFK6bmYQyzVfhb9ADA="; type = "tarball"; - url = "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.3.tgz"; + url = "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.2.tgz"; }; ident = "@next/swc-win32-arm64-msvc"; ltype = "file"; @@ -1916,15 +1916,15 @@ ]; }; treeInfo = { }; - version = "14.0.3"; + version = "14.1.2"; }; }; "@next/swc-win32-ia32-msvc" = { - "14.0.3" = { + "14.1.2" = { fetchInfo = { - narHash = "sha256-Hd6yfuK8Ugej5GJ5eMdSa4IvWSOd/abGoF2kHCK/S+M="; + narHash = "sha256-PJduNAZhWhgsaVHsjMmRgnTCm9F7NpaOuwYTdaA5f2E="; type = "tarball"; - url = "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.3.tgz"; + url = "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.2.tgz"; }; ident = "@next/swc-win32-ia32-msvc"; ltype = "file"; @@ -1937,15 +1937,15 @@ ]; }; treeInfo = { }; - version = "14.0.3"; + version = "14.1.2"; }; }; "@next/swc-win32-x64-msvc" = { - "14.0.3" = { + "14.1.2" = { fetchInfo = { - narHash = "sha256-S+4Q8vZ5E3a5U0k8YvJvJN71k+VUy11TVgWW7SY2u6I="; + narHash = "sha256-ratBlxIPkRBcUhPs+CywPgI8SE/gAohUuH7cbOCTfaQ="; type = "tarball"; - url = "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.3.tgz"; + url = "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.2.tgz"; }; ident = "@next/swc-win32-x64-msvc"; ltype = "file"; @@ -1958,7 +1958,7 @@ ]; }; treeInfo = { }; - version = "14.0.3"; + version = "14.1.2"; }; }; "@nodelib/fs.scandir" = { @@ -4105,7 +4105,7 @@ depInfo = { caniuse-lite = { descriptor = "^1.0.30001565"; - pin = "1.0.30001566"; + pin = "1.0.30001594"; runtime = true; }; electron-to-chromium = { @@ -4219,16 +4219,16 @@ }; }; caniuse-lite = { - "1.0.30001566" = { + "1.0.30001594" = { fetchInfo = { - narHash = "sha256-bDfkT255+HIToCugIDcT9Ht0uCUGI2PkYuMv7TrTnNc="; + narHash = "sha256-aOQfum52lC+Us1bxbr8FG73YdELL62WUMJfyfzRO7dA="; type = "tarball"; - url = "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001566.tgz"; + url = "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001594.tgz"; }; ident = "caniuse-lite"; ltype = "file"; treeInfo = { }; - version = "1.0.30001566"; + version = "1.0.30001594"; }; }; ccount = { @@ -9773,6 +9773,60 @@ version = "5.1.2"; }; }; + mdast-util-directive = { + "3.0.0" = { + depInfo = { + "@types/mdast" = { + descriptor = "^4.0.0"; + pin = "4.0.1"; + runtime = true; + }; + "@types/unist" = { + descriptor = "^3.0.0"; + pin = "3.0.0"; + runtime = true; + }; + devlop = { + descriptor = "^1.0.0"; + pin = "1.1.0"; + runtime = true; + }; + mdast-util-from-markdown = { + descriptor = "^2.0.0"; + pin = "2.0.0"; + runtime = true; + }; + mdast-util-to-markdown = { + descriptor = "^2.0.0"; + pin = "2.1.0"; + runtime = true; + }; + parse-entities = { + descriptor = "^4.0.0"; + pin = "4.0.1"; + runtime = true; + }; + stringify-entities = { + descriptor = "^4.0.0"; + pin = "4.0.3"; + runtime = true; + }; + unist-util-visit-parents = { + descriptor = "^6.0.0"; + pin = "6.0.1"; + runtime = true; + }; + }; + fetchInfo = { + narHash = "sha256-QHyKFbhNMiK7VjpvReW4uQA0NBiO+OFxpbwr77Lx+Ws="; + type = "tarball"; + url = "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.0.0.tgz"; + }; + ident = "mdast-util-directive"; + ltype = "file"; + version = "3.0.0"; + }; + }; mdast-util-find-and-replace = { "3.0.1" = { depInfo = { @@ -11371,6 +11425,55 @@ version = "2.0.0"; }; }; + micromark-extension-directive = { + "3.0.0" = { + depInfo = { + devlop = { + descriptor = "^1.0.0"; + pin = "1.1.0"; + runtime = true; + }; + micromark-factory-space = { + descriptor = "^2.0.0"; + pin = "2.0.0"; + runtime = true; + }; + micromark-factory-whitespace = { + descriptor = "^2.0.0"; + pin = "2.0.0"; + runtime = true; + }; + micromark-util-character = { + descriptor = "^2.0.0"; + pin = "2.0.1"; + runtime = true; + }; + micromark-util-symbol = { + descriptor = "^2.0.0"; + pin = "2.0.0"; + runtime = true; + }; + micromark-util-types = { + descriptor = "^2.0.0"; + pin = "2.0.0"; + runtime = true; + }; + parse-entities = { + descriptor = "^4.0.0"; + pin = "4.0.1"; + runtime = true; + }; + }; + fetchInfo = { + narHash = "sha256-aJPDjit55h/Z2LIvmDxuqaoPLAhI+BlHPgAT0lwPsMs="; + type = "tarball"; + url = "https://registry.npmjs.org/micromark-extension-directive/-/micromark-extension-directive-3.0.0.tgz"; + }; + ident = "micromark-extension-directive"; + ltype = "file"; + version = "3.0.0"; + }; + }; micromark-extension-frontmatter = { "2.0.0" = { depInfo = { @@ -13438,7 +13541,7 @@ }; }; next = { - "14.0.3" = { + "14.1.2" = { binInfo = { binPairs = { next = "dist/bin/next"; @@ -13446,62 +13549,62 @@ }; depInfo = { "@next/env" = { - descriptor = "14.0.3"; - pin = "14.0.3"; + descriptor = "14.1.2"; + pin = "14.1.2"; runtime = true; }; "@next/swc-darwin-arm64" = { - descriptor = "14.0.3"; + descriptor = "14.1.2"; optional = true; - pin = "14.0.3"; + pin = "14.1.2"; runtime = true; }; "@next/swc-darwin-x64" = { - descriptor = "14.0.3"; + descriptor = "14.1.2"; optional = true; - pin = "14.0.3"; + pin = "14.1.2"; runtime = true; }; "@next/swc-linux-arm64-gnu" = { - descriptor = "14.0.3"; + descriptor = "14.1.2"; optional = true; - pin = "14.0.3"; + pin = "14.1.2"; runtime = true; }; "@next/swc-linux-arm64-musl" = { - descriptor = "14.0.3"; + descriptor = "14.1.2"; optional = true; - pin = "14.0.3"; + pin = "14.1.2"; runtime = true; }; "@next/swc-linux-x64-gnu" = { - descriptor = "14.0.3"; + descriptor = "14.1.2"; optional = true; - pin = "14.0.3"; + pin = "14.1.2"; runtime = true; }; "@next/swc-linux-x64-musl" = { - descriptor = "14.0.3"; + descriptor = "14.1.2"; optional = true; - pin = "14.0.3"; + pin = "14.1.2"; runtime = true; }; "@next/swc-win32-arm64-msvc" = { - descriptor = "14.0.3"; + descriptor = "14.1.2"; optional = true; - pin = "14.0.3"; + pin = "14.1.2"; runtime = true; }; "@next/swc-win32-ia32-msvc" = { - descriptor = "14.0.3"; + descriptor = "14.1.2"; optional = true; - pin = "14.0.3"; + pin = "14.1.2"; runtime = true; }; "@next/swc-win32-x64-msvc" = { - descriptor = "14.0.3"; + descriptor = "14.1.2"; optional = true; - pin = "14.0.3"; + pin = "14.1.2"; runtime = true; }; "@swc/helpers" = { @@ -13515,8 +13618,13 @@ runtime = true; }; caniuse-lite = { - descriptor = "^1.0.30001406"; - pin = "1.0.30001566"; + descriptor = "^1.0.30001579"; + pin = "1.0.30001594"; + runtime = true; + }; + graceful-fs = { + descriptor = "^4.2.11"; + pin = "4.2.11"; runtime = true; }; postcss = { @@ -13529,16 +13637,11 @@ pin = "5.1.1"; runtime = true; }; - watchpack = { - descriptor = "2.4.0"; - pin = "2.4.0"; - runtime = true; - }; }; fetchInfo = { - narHash = "sha256-RkR/xWxox5r0fScsjEboCN2xuNxpzOmImGwm7C4cZHs="; + narHash = "sha256-qA5qMEkMkD4i5HxhURCt5E1OYQTb9LCmEwjyiycHZaA="; type = "tarball"; - url = "https://registry.npmjs.org/next/-/next-14.0.3.tgz"; + url = "https://registry.npmjs.org/next/-/next-14.1.2.tgz"; }; ident = "next"; ltype = "file"; @@ -13558,7 +13661,7 @@ optional = true; }; }; - version = "14.0.3"; + version = "14.1.2"; }; }; next-mdx-remote = { @@ -13786,8 +13889,8 @@ runtime = true; }; next = { - descriptor = "^14.0.3"; - pin = "14.0.3"; + descriptor = "^14.1.2"; + pin = "14.1.2"; runtime = true; }; next-mdx-remote = { @@ -13880,6 +13983,11 @@ pin = "2.0.0"; runtime = true; }; + remark-directive = { + descriptor = "^3.0.0"; + pin = "3.0.0"; + runtime = true; + }; remark-frontmatter = { descriptor = "^5.0.0"; pin = "5.0.0"; @@ -14333,7 +14441,7 @@ key = "react-is/18.2.0"; }; "node_modules/@next/env" = { - key = "@next/env/14.0.3"; + key = "@next/env/14.1.2"; }; "node_modules/@next/eslint-plugin-next" = { dev = true; @@ -14350,39 +14458,39 @@ key = "source-map/0.7.4"; }; "node_modules/@next/swc-darwin-arm64" = { - key = "@next/swc-darwin-arm64/14.0.3"; + key = "@next/swc-darwin-arm64/14.1.2"; optional = true; }; "node_modules/@next/swc-darwin-x64" = { - key = "@next/swc-darwin-x64/14.0.3"; + key = "@next/swc-darwin-x64/14.1.2"; optional = true; }; "node_modules/@next/swc-linux-arm64-gnu" = { - key = "@next/swc-linux-arm64-gnu/14.0.3"; + key = "@next/swc-linux-arm64-gnu/14.1.2"; optional = true; }; "node_modules/@next/swc-linux-arm64-musl" = { - key = "@next/swc-linux-arm64-musl/14.0.3"; + key = "@next/swc-linux-arm64-musl/14.1.2"; optional = true; }; "node_modules/@next/swc-linux-x64-gnu" = { - key = "@next/swc-linux-x64-gnu/14.0.3"; + key = "@next/swc-linux-x64-gnu/14.1.2"; optional = true; }; "node_modules/@next/swc-linux-x64-musl" = { - key = "@next/swc-linux-x64-musl/14.0.3"; + key = "@next/swc-linux-x64-musl/14.1.2"; optional = true; }; "node_modules/@next/swc-win32-arm64-msvc" = { - key = "@next/swc-win32-arm64-msvc/14.0.3"; + key = "@next/swc-win32-arm64-msvc/14.1.2"; optional = true; }; "node_modules/@next/swc-win32-ia32-msvc" = { - key = "@next/swc-win32-ia32-msvc/14.0.3"; + key = "@next/swc-win32-ia32-msvc/14.1.2"; optional = true; }; "node_modules/@next/swc-win32-x64-msvc" = { - key = "@next/swc-win32-x64-msvc/14.0.3"; + key = "@next/swc-win32-x64-msvc/14.1.2"; optional = true; }; "node_modules/@nodelib/fs.scandir" = { @@ -14731,7 +14839,7 @@ key = "callsites/3.1.0"; }; "node_modules/caniuse-lite" = { - key = "caniuse-lite/1.0.30001566"; + key = "caniuse-lite/1.0.30001594"; }; "node_modules/ccount" = { key = "ccount/2.0.1"; @@ -15506,6 +15614,9 @@ "node_modules/mdast-util-definitions/node_modules/unist-util-visit-parents" = { key = "unist-util-visit-parents/5.1.3"; }; + "node_modules/mdast-util-directive" = { + key = "mdast-util-directive/3.0.0"; + }; "node_modules/mdast-util-find-and-replace" = { key = "mdast-util-find-and-replace/3.0.1"; }; @@ -15962,6 +16073,9 @@ "node_modules/micromark-extension-definition-list" = { key = "micromark-extension-definition-list/2.0.0"; }; + "node_modules/micromark-extension-directive" = { + key = "micromark-extension-directive/3.0.0"; + }; "node_modules/micromark-extension-frontmatter" = { key = "micromark-extension-frontmatter/2.0.0"; }; @@ -16235,7 +16349,7 @@ key = "neo-async/2.6.2"; }; "node_modules/next" = { - key = "next/14.0.3"; + key = "next/14.1.2"; }; "node_modules/next-mdx-remote" = { key = "next-mdx-remote/4.4.1"; @@ -16451,6 +16565,9 @@ "node_modules/remark-definition-list" = { key = "remark-definition-list/2.0.0"; }; + "node_modules/remark-directive" = { + key = "remark-directive/3.0.0"; + }; "node_modules/remark-frontmatter" = { key = "remark-frontmatter/5.0.0"; }; @@ -18273,6 +18390,40 @@ version = "2.0.0"; }; }; + remark-directive = { + "3.0.0" = { + depInfo = { + "@types/mdast" = { + descriptor = "^4.0.0"; + pin = "4.0.1"; + runtime = true; + }; + mdast-util-directive = { + descriptor = "^3.0.0"; + pin = "3.0.0"; + runtime = true; + }; + micromark-extension-directive = { + descriptor = "^3.0.0"; + pin = "3.0.0"; + runtime = true; + }; + unified = { + descriptor = "^11.0.0"; + pin = "11.0.4"; + runtime = true; + }; + }; + fetchInfo = { + narHash = "sha256-+9d2J4GqkN7Jxq/GXgr6xPGcUlmGDj6JKyRcXwkIA7M="; + type = "tarball"; + url = "https://registry.npmjs.org/remark-directive/-/remark-directive-3.0.0.tgz"; + }; + ident = "remark-directive"; + ltype = "file"; + version = "3.0.0"; + }; + }; remark-frontmatter = { "5.0.0" = { depInfo = { diff --git a/website/package-lock.json b/website/package-lock.json index 3c914d9..a1e4cc4 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -25,7 +25,7 @@ "hast-util-to-string": "^3.0.0", "highlight.js": "^11.7.0", "minisearch": "^6.3.0", - "next": "^14.0.3", + "next": "^14.1.2", "next-mdx-remote": "^4.4.1", "next-sitemap": "^4.2.3", "notistack": "^3.0.0", @@ -45,7 +45,6 @@ "rehype-stringify": "^10.0.0", "remark-definition-list": "^2.0.0", "remark-directive": "^3.0.0", - "remark-fenced-divs": "^2.0.1", "remark-frontmatter": "^5.0.0", "remark-gfm": "^4.0.0", "remark-heading-id": "^1.0.1", @@ -1962,9 +1961,9 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" }, "node_modules/@next/env": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.3.tgz", - "integrity": "sha512-7xRqh9nMvP5xrW4/+L0jgRRX+HoNRGnfJpD+5Wq6/13j3dsdzxO3BCXn7D3hMqsDb+vjZnJq+vI7+EtgrYZTeA==" + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.1.2.tgz", + "integrity": "sha512-U0iEG+JF86j6qyu330sfPgsMmDVH8vWVmzZadl+an5EU3o5HqdNytOpM+HsFpl58PmhGBTKx3UmM9c+eoLK0mA==" }, "node_modules/@next/eslint-plugin-next": { "version": "14.0.3", @@ -2024,9 +2023,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.3.tgz", - "integrity": "sha512-64JbSvi3nbbcEtyitNn2LEDS/hcleAFpHdykpcnrstITFlzFgB/bW0ER5/SJJwUPj+ZPY+z3e+1jAfcczRLVGw==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.2.tgz", + "integrity": "sha512-E4/clgk0ZrYMo9eMRwP/4IO/cvXF1yEYSnGcdGfH+NYTR8bNFy76TSlc1Vb2rK3oaQY4BVHRpx8f/sMN/D5gNw==", "cpu": [ "arm64" ], @@ -2039,9 +2038,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.3.tgz", - "integrity": "sha512-RkTf+KbAD0SgYdVn1XzqE/+sIxYGB7NLMZRn9I4Z24afrhUpVJx6L8hsRnIwxz3ERE2NFURNliPjJ2QNfnWicQ==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.2.tgz", + "integrity": "sha512-j8mEOI+ZM0tU9B/L/OGa6F7d9FXYMkog5OWWuhTWzz3iZ91UKIGGpD/ojTNKuejainDMgbqOBTNnLg0jZywM/g==", "cpu": [ "x64" ], @@ -2054,9 +2053,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.3.tgz", - "integrity": "sha512-3tBWGgz7M9RKLO6sPWC6c4pAw4geujSwQ7q7Si4d6bo0l6cLs4tmO+lnSwFp1Tm3lxwfMk0SgkJT7EdwYSJvcg==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.2.tgz", + "integrity": "sha512-qpRrd5hl6BFTWiFLgHtJmqqQGRMs+ol0MN9pEp0SYoLs3j8OTErPiDMhbKWjMWHGdc2E3kg4RRBV3cSTZiePiQ==", "cpu": [ "arm64" ], @@ -2069,9 +2068,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.3.tgz", - "integrity": "sha512-v0v8Kb8j8T23jvVUWZeA2D8+izWspeyeDGNaT2/mTHWp7+37fiNfL8bmBWiOmeumXkacM/AB0XOUQvEbncSnHA==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.2.tgz", + "integrity": "sha512-HAhvVXAv+wnbj0wztT0YnpgJVoHtw1Mv4Y1R/JJcg5yXSU8FsP2uEGUwjQaqPoD76YSZjuKl32YbJlmPgQbLFw==", "cpu": [ "arm64" ], @@ -2084,9 +2083,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.3.tgz", - "integrity": "sha512-VM1aE1tJKLBwMGtyBR21yy+STfl0MapMQnNrXkxeyLs0GFv/kZqXS5Jw/TQ3TSUnbv0QPDf/X8sDXuMtSgG6eg==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.2.tgz", + "integrity": "sha512-PCWC312woXLWOXiedi1E+fEw6B/ECP1fMiK1nSoGS2E43o56Z8kq4WeJLbJoufFQGVj5ZOKU3jIVyV//3CI4wQ==", "cpu": [ "x64" ], @@ -2099,9 +2098,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.3.tgz", - "integrity": "sha512-64EnmKy18MYFL5CzLaSuUn561hbO1Gk16jM/KHznYP3iCIfF9e3yULtHaMy0D8zbHfxset9LTOv6cuYKJgcOxg==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.2.tgz", + "integrity": "sha512-KQSKzdWPNrYZjeTPCsepEpagOzU8Nf3Zzu53X1cLsSY6QlOIkYcSgEihRjsMKyeQW4aSvc+nN5pIpC2pLWNSMA==", "cpu": [ "x64" ], @@ -2114,9 +2113,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.3.tgz", - "integrity": "sha512-WRDp8QrmsL1bbGtsh5GqQ/KWulmrnMBgbnb+59qNTW1kVi1nG/2ndZLkcbs2GX7NpFLlToLRMWSQXmPzQm4tog==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.2.tgz", + "integrity": "sha512-3b0PouKd09Ulm2T1tjaRnwQj9+UwSsMO680d/sD4XAlm29KkNmVLAEIwWTfb3L+E11Qyw+jdcN3HtbDCg5+vYA==", "cpu": [ "arm64" ], @@ -2129,9 +2128,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.3.tgz", - "integrity": "sha512-EKffQeqCrj+t6qFFhIFTRoqb2QwX1mU7iTOvMyLbYw3QtqTw9sMwjykyiMlZlrfm2a4fA84+/aeW+PMg1MjuTg==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.2.tgz", + "integrity": "sha512-CC1gaJY4h+wg6d5r2biggGM6nCFXh/6WEim2VOQI0WrA6easCQi2P2hzWyrU6moQ0g1GOiWzesGc6nn0a92Kgg==", "cpu": [ "ia32" ], @@ -2144,9 +2143,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.3.tgz", - "integrity": "sha512-ERhKPSJ1vQrPiwrs15Pjz/rvDHZmkmvbf/BjPN/UCOI++ODftT0GtasDPi0j+y6PPJi5HsXw+dpRaXUaw4vjuQ==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.2.tgz", + "integrity": "sha512-pfASwanOd+yP3D80O63DuQffrBySZPuB7wRN0IGSRq/0rDm9p/MvvnLzzgP2kSiLOUklOrFYVax7P6AEzjGykQ==", "cpu": [ "x64" ], @@ -3277,9 +3276,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001566", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001566.tgz", - "integrity": "sha512-ggIhCsTxmITBAMmK8yZjEhCO5/47jKXPu6Dha/wuCS4JePVL+3uiDEBuhu2aIoT+bqTOR8L76Ip1ARL9xYsEJA==", + "version": "1.0.30001594", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001594.tgz", + "integrity": "sha512-VblSX6nYqyJVs8DKFMldE2IVCJjZ225LW00ydtUWwh5hk9IfkTOffO6r8gJNsH0qqqeAF8KrbMYA2VEwTlGW5g==", "funding": [ { "type": "opencollective", @@ -4577,7 +4576,8 @@ "node_modules/glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "peer": true }, "node_modules/globals": { "version": "13.22.0", @@ -10113,17 +10113,17 @@ "peer": true }, "node_modules/next": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/next/-/next-14.0.3.tgz", - "integrity": "sha512-AbYdRNfImBr3XGtvnwOxq8ekVCwbFTv/UJoLwmaX89nk9i051AEY4/HAWzU0YpaTDw8IofUpmuIlvzWF13jxIw==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/next/-/next-14.1.2.tgz", + "integrity": "sha512-p4RfNmopqkzRP1uUyBJnHii+qMg71f2udWhTTZopBB8b3T5QXNzn7yO+LCYHPWZG2kAvEn4l4neyJHqkXvo2wg==", "dependencies": { - "@next/env": "14.0.3", + "@next/env": "14.1.2", "@swc/helpers": "0.5.2", "busboy": "1.6.0", - "caniuse-lite": "^1.0.30001406", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", "postcss": "8.4.31", - "styled-jsx": "5.1.1", - "watchpack": "2.4.0" + "styled-jsx": "5.1.1" }, "bin": { "next": "dist/bin/next" @@ -10132,15 +10132,15 @@ "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "14.0.3", - "@next/swc-darwin-x64": "14.0.3", - "@next/swc-linux-arm64-gnu": "14.0.3", - "@next/swc-linux-arm64-musl": "14.0.3", - "@next/swc-linux-x64-gnu": "14.0.3", - "@next/swc-linux-x64-musl": "14.0.3", - "@next/swc-win32-arm64-msvc": "14.0.3", - "@next/swc-win32-ia32-msvc": "14.0.3", - "@next/swc-win32-x64-msvc": "14.0.3" + "@next/swc-darwin-arm64": "14.1.2", + "@next/swc-darwin-x64": "14.1.2", + "@next/swc-linux-arm64-gnu": "14.1.2", + "@next/swc-linux-arm64-musl": "14.1.2", + "@next/swc-linux-x64-gnu": "14.1.2", + "@next/swc-linux-x64-musl": "14.1.2", + "@next/swc-win32-arm64-msvc": "14.1.2", + "@next/swc-win32-ia32-msvc": "14.1.2", + "@next/swc-win32-x64-msvc": "14.1.2" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", @@ -11009,171 +11009,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-fenced-divs": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/remark-fenced-divs/-/remark-fenced-divs-2.0.1.tgz", - "integrity": "sha512-tfD1AZunfERi0XAyaRXArfAmyorb+wvZAZb+9XeT0dY88ZucvWG6paBvg4VJTaLK5NBJeAzjR43+2fhmELIdcw==", - "dependencies": { - "micromark": "~2.10.0", - "parse-entities": "^2.0.0", - "repeat-string": "^1.0.0", - "stringify-entities": "^3.1.0", - "unist-util-visit-parents": "^3.1.1" - } - }, - "node_modules/remark-fenced-divs/node_modules/@types/unist": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", - "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" - }, - "node_modules/remark-fenced-divs/node_modules/character-entities": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", - "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark-fenced-divs/node_modules/character-entities-html4": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.4.tgz", - "integrity": "sha512-HRcDxZuZqMx3/a+qrzxdBKBPUpxWEq9xw2OPZ3a/174ihfrQKVsFhqtthBInFy1zZ9GgZyFXOatNujm8M+El3g==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark-fenced-divs/node_modules/character-entities-legacy": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", - "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark-fenced-divs/node_modules/character-reference-invalid": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", - "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark-fenced-divs/node_modules/is-alphabetical": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", - "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark-fenced-divs/node_modules/is-alphanumerical": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", - "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", - "dependencies": { - "is-alphabetical": "^1.0.0", - "is-decimal": "^1.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark-fenced-divs/node_modules/is-decimal": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", - "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark-fenced-divs/node_modules/is-hexadecimal": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", - "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark-fenced-divs/node_modules/micromark": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.10.1.tgz", - "integrity": "sha512-fUuVF8sC1X7wsCS29SYQ2ZfIZYbTymp0EYr6sab3idFjigFFjGa5UwoniPlV9tAgntjuapW1t9U+S0yDYeGKHQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "debug": "^4.0.0", - "parse-entities": "^2.0.0" - } - }, - "node_modules/remark-fenced-divs/node_modules/parse-entities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", - "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", - "dependencies": { - "character-entities": "^1.0.0", - "character-entities-legacy": "^1.0.0", - "character-reference-invalid": "^1.0.0", - "is-alphanumerical": "^1.0.0", - "is-decimal": "^1.0.0", - "is-hexadecimal": "^1.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark-fenced-divs/node_modules/stringify-entities": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.1.0.tgz", - "integrity": "sha512-3FP+jGMmMV/ffZs86MoghGqAoqXAdxLrJP4GUdrDN1aIScYih5tuIO3eF4To5AJZ79KDZ8Fpdy7QJnK8SsL1Vg==", - "dependencies": { - "character-entities-html4": "^1.0.0", - "character-entities-legacy": "^1.0.0", - "xtend": "^4.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark-fenced-divs/node_modules/unist-util-is": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", - "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-fenced-divs/node_modules/unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/remark-frontmatter": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/remark-frontmatter/-/remark-frontmatter-5.0.0.tgz", @@ -11311,14 +11146,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", - "engines": { - "node": ">=0.10" - } - }, "node_modules/resolve": { "version": "1.22.6", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", @@ -12399,6 +12226,7 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "peer": true, "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -12590,14 +12418,6 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" - } - }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -13869,9 +13689,9 @@ } }, "@next/env": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.3.tgz", - "integrity": "sha512-7xRqh9nMvP5xrW4/+L0jgRRX+HoNRGnfJpD+5Wq6/13j3dsdzxO3BCXn7D3hMqsDb+vjZnJq+vI7+EtgrYZTeA==" + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.1.2.tgz", + "integrity": "sha512-U0iEG+JF86j6qyu330sfPgsMmDVH8vWVmzZadl+an5EU3o5HqdNytOpM+HsFpl58PmhGBTKx3UmM9c+eoLK0mA==" }, "@next/eslint-plugin-next": { "version": "14.0.3", @@ -13914,57 +13734,57 @@ } }, "@next/swc-darwin-arm64": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.3.tgz", - "integrity": "sha512-64JbSvi3nbbcEtyitNn2LEDS/hcleAFpHdykpcnrstITFlzFgB/bW0ER5/SJJwUPj+ZPY+z3e+1jAfcczRLVGw==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.2.tgz", + "integrity": "sha512-E4/clgk0ZrYMo9eMRwP/4IO/cvXF1yEYSnGcdGfH+NYTR8bNFy76TSlc1Vb2rK3oaQY4BVHRpx8f/sMN/D5gNw==", "optional": true }, "@next/swc-darwin-x64": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.3.tgz", - "integrity": "sha512-RkTf+KbAD0SgYdVn1XzqE/+sIxYGB7NLMZRn9I4Z24afrhUpVJx6L8hsRnIwxz3ERE2NFURNliPjJ2QNfnWicQ==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.2.tgz", + "integrity": "sha512-j8mEOI+ZM0tU9B/L/OGa6F7d9FXYMkog5OWWuhTWzz3iZ91UKIGGpD/ojTNKuejainDMgbqOBTNnLg0jZywM/g==", "optional": true }, "@next/swc-linux-arm64-gnu": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.3.tgz", - "integrity": "sha512-3tBWGgz7M9RKLO6sPWC6c4pAw4geujSwQ7q7Si4d6bo0l6cLs4tmO+lnSwFp1Tm3lxwfMk0SgkJT7EdwYSJvcg==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.2.tgz", + "integrity": "sha512-qpRrd5hl6BFTWiFLgHtJmqqQGRMs+ol0MN9pEp0SYoLs3j8OTErPiDMhbKWjMWHGdc2E3kg4RRBV3cSTZiePiQ==", "optional": true }, "@next/swc-linux-arm64-musl": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.3.tgz", - "integrity": "sha512-v0v8Kb8j8T23jvVUWZeA2D8+izWspeyeDGNaT2/mTHWp7+37fiNfL8bmBWiOmeumXkacM/AB0XOUQvEbncSnHA==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.2.tgz", + "integrity": "sha512-HAhvVXAv+wnbj0wztT0YnpgJVoHtw1Mv4Y1R/JJcg5yXSU8FsP2uEGUwjQaqPoD76YSZjuKl32YbJlmPgQbLFw==", "optional": true }, "@next/swc-linux-x64-gnu": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.3.tgz", - "integrity": "sha512-VM1aE1tJKLBwMGtyBR21yy+STfl0MapMQnNrXkxeyLs0GFv/kZqXS5Jw/TQ3TSUnbv0QPDf/X8sDXuMtSgG6eg==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.2.tgz", + "integrity": "sha512-PCWC312woXLWOXiedi1E+fEw6B/ECP1fMiK1nSoGS2E43o56Z8kq4WeJLbJoufFQGVj5ZOKU3jIVyV//3CI4wQ==", "optional": true }, "@next/swc-linux-x64-musl": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.3.tgz", - "integrity": "sha512-64EnmKy18MYFL5CzLaSuUn561hbO1Gk16jM/KHznYP3iCIfF9e3yULtHaMy0D8zbHfxset9LTOv6cuYKJgcOxg==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.2.tgz", + "integrity": "sha512-KQSKzdWPNrYZjeTPCsepEpagOzU8Nf3Zzu53X1cLsSY6QlOIkYcSgEihRjsMKyeQW4aSvc+nN5pIpC2pLWNSMA==", "optional": true }, "@next/swc-win32-arm64-msvc": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.3.tgz", - "integrity": "sha512-WRDp8QrmsL1bbGtsh5GqQ/KWulmrnMBgbnb+59qNTW1kVi1nG/2ndZLkcbs2GX7NpFLlToLRMWSQXmPzQm4tog==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.2.tgz", + "integrity": "sha512-3b0PouKd09Ulm2T1tjaRnwQj9+UwSsMO680d/sD4XAlm29KkNmVLAEIwWTfb3L+E11Qyw+jdcN3HtbDCg5+vYA==", "optional": true }, "@next/swc-win32-ia32-msvc": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.3.tgz", - "integrity": "sha512-EKffQeqCrj+t6qFFhIFTRoqb2QwX1mU7iTOvMyLbYw3QtqTw9sMwjykyiMlZlrfm2a4fA84+/aeW+PMg1MjuTg==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.2.tgz", + "integrity": "sha512-CC1gaJY4h+wg6d5r2biggGM6nCFXh/6WEim2VOQI0WrA6easCQi2P2hzWyrU6moQ0g1GOiWzesGc6nn0a92Kgg==", "optional": true }, "@next/swc-win32-x64-msvc": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.3.tgz", - "integrity": "sha512-ERhKPSJ1vQrPiwrs15Pjz/rvDHZmkmvbf/BjPN/UCOI++ODftT0GtasDPi0j+y6PPJi5HsXw+dpRaXUaw4vjuQ==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.2.tgz", + "integrity": "sha512-pfASwanOd+yP3D80O63DuQffrBySZPuB7wRN0IGSRq/0rDm9p/MvvnLzzgP2kSiLOUklOrFYVax7P6AEzjGykQ==", "optional": true }, "@nodelib/fs.scandir": { @@ -14826,9 +14646,9 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "caniuse-lite": { - "version": "1.0.30001566", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001566.tgz", - "integrity": "sha512-ggIhCsTxmITBAMmK8yZjEhCO5/47jKXPu6Dha/wuCS4JePVL+3uiDEBuhu2aIoT+bqTOR8L76Ip1ARL9xYsEJA==" + "version": "1.0.30001594", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001594.tgz", + "integrity": "sha512-VblSX6nYqyJVs8DKFMldE2IVCJjZ225LW00ydtUWwh5hk9IfkTOffO6r8gJNsH0qqqeAF8KrbMYA2VEwTlGW5g==" }, "ccount": { "version": "2.0.1", @@ -15800,7 +15620,8 @@ "glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "peer": true }, "globals": { "version": "13.22.0", @@ -19225,26 +19046,26 @@ "peer": true }, "next": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/next/-/next-14.0.3.tgz", - "integrity": "sha512-AbYdRNfImBr3XGtvnwOxq8ekVCwbFTv/UJoLwmaX89nk9i051AEY4/HAWzU0YpaTDw8IofUpmuIlvzWF13jxIw==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/next/-/next-14.1.2.tgz", + "integrity": "sha512-p4RfNmopqkzRP1uUyBJnHii+qMg71f2udWhTTZopBB8b3T5QXNzn7yO+LCYHPWZG2kAvEn4l4neyJHqkXvo2wg==", "requires": { - "@next/env": "14.0.3", - "@next/swc-darwin-arm64": "14.0.3", - "@next/swc-darwin-x64": "14.0.3", - "@next/swc-linux-arm64-gnu": "14.0.3", - "@next/swc-linux-arm64-musl": "14.0.3", - "@next/swc-linux-x64-gnu": "14.0.3", - "@next/swc-linux-x64-musl": "14.0.3", - "@next/swc-win32-arm64-msvc": "14.0.3", - "@next/swc-win32-ia32-msvc": "14.0.3", - "@next/swc-win32-x64-msvc": "14.0.3", + "@next/env": "14.1.2", + "@next/swc-darwin-arm64": "14.1.2", + "@next/swc-darwin-x64": "14.1.2", + "@next/swc-linux-arm64-gnu": "14.1.2", + "@next/swc-linux-arm64-musl": "14.1.2", + "@next/swc-linux-x64-gnu": "14.1.2", + "@next/swc-linux-x64-musl": "14.1.2", + "@next/swc-win32-arm64-msvc": "14.1.2", + "@next/swc-win32-ia32-msvc": "14.1.2", + "@next/swc-win32-x64-msvc": "14.1.2", "@swc/helpers": "0.5.2", "busboy": "1.6.0", - "caniuse-lite": "^1.0.30001406", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", "postcss": "8.4.31", - "styled-jsx": "5.1.1", - "watchpack": "2.4.0" + "styled-jsx": "5.1.1" } }, "next-mdx-remote": { @@ -19845,115 +19666,6 @@ "unified": "^11.0.0" } }, - "remark-fenced-divs": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/remark-fenced-divs/-/remark-fenced-divs-2.0.1.tgz", - "integrity": "sha512-tfD1AZunfERi0XAyaRXArfAmyorb+wvZAZb+9XeT0dY88ZucvWG6paBvg4VJTaLK5NBJeAzjR43+2fhmELIdcw==", - "requires": { - "micromark": "~2.10.0", - "parse-entities": "^2.0.0", - "repeat-string": "^1.0.0", - "stringify-entities": "^3.1.0", - "unist-util-visit-parents": "^3.1.1" - }, - "dependencies": { - "@types/unist": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", - "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" - }, - "character-entities": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", - "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==" - }, - "character-entities-html4": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.4.tgz", - "integrity": "sha512-HRcDxZuZqMx3/a+qrzxdBKBPUpxWEq9xw2OPZ3a/174ihfrQKVsFhqtthBInFy1zZ9GgZyFXOatNujm8M+El3g==" - }, - "character-entities-legacy": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", - "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==" - }, - "character-reference-invalid": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", - "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==" - }, - "is-alphabetical": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", - "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==" - }, - "is-alphanumerical": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", - "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", - "requires": { - "is-alphabetical": "^1.0.0", - "is-decimal": "^1.0.0" - } - }, - "is-decimal": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", - "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==" - }, - "is-hexadecimal": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", - "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==" - }, - "micromark": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.10.1.tgz", - "integrity": "sha512-fUuVF8sC1X7wsCS29SYQ2ZfIZYbTymp0EYr6sab3idFjigFFjGa5UwoniPlV9tAgntjuapW1t9U+S0yDYeGKHQ==", - "requires": { - "debug": "^4.0.0", - "parse-entities": "^2.0.0" - } - }, - "parse-entities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", - "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", - "requires": { - "character-entities": "^1.0.0", - "character-entities-legacy": "^1.0.0", - "character-reference-invalid": "^1.0.0", - "is-alphanumerical": "^1.0.0", - "is-decimal": "^1.0.0", - "is-hexadecimal": "^1.0.0" - } - }, - "stringify-entities": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.1.0.tgz", - "integrity": "sha512-3FP+jGMmMV/ffZs86MoghGqAoqXAdxLrJP4GUdrDN1aIScYih5tuIO3eF4To5AJZ79KDZ8Fpdy7QJnK8SsL1Vg==", - "requires": { - "character-entities-html4": "^1.0.0", - "character-entities-legacy": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "unist-util-is": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", - "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==" - }, - "unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" - } - } - } - }, "remark-frontmatter": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/remark-frontmatter/-/remark-frontmatter-5.0.0.tgz", @@ -20062,11 +19774,6 @@ "unist-util-visit": "^5.0.0" } }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==" - }, "resolve": { "version": "1.22.6", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", @@ -20792,6 +20499,7 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "peer": true, "requires": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -20930,11 +20638,6 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", diff --git a/website/package.json b/website/package.json index 1224c82..00b26fa 100644 --- a/website/package.json +++ b/website/package.json @@ -26,7 +26,7 @@ "hast-util-to-string": "^3.0.0", "highlight.js": "^11.7.0", "minisearch": "^6.3.0", - "next": "^14.0.3", + "next": "^14.1.2", "next-mdx-remote": "^4.4.1", "next-sitemap": "^4.2.3", "notistack": "^3.0.0", @@ -45,6 +45,7 @@ "rehype-slug": "^6.0.0", "rehype-stringify": "^10.0.0", "remark-definition-list": "^2.0.0", + "remark-directive": "^3.0.0", "remark-frontmatter": "^5.0.0", "remark-gfm": "^4.0.0", "remark-heading-id": "^1.0.1", diff --git a/website/src/app/f/[...path]/page.tsx b/website/src/app/f/[...path]/page.tsx index aa93352..d1fbec6 100644 --- a/website/src/app/f/[...path]/page.tsx +++ b/website/src/app/f/[...path]/page.tsx @@ -3,9 +3,8 @@ import { ShareButton } from "@/components/ShareButton"; import { BackButton } from "@/components/BackButton"; import { Doc, data, manualLinks } from "@/models/data"; import { getPrimopDescription } from "@/models/primop"; -import { extractExcerpt, extractHeadings, mdxRenderOptions } from "@/utils"; +import { extractExcerpt, extractHeadings, parseMd } from "@/utils"; import { Box, Divider, Typography, Link, Chip } from "@mui/material"; -import { MDXRemote } from "next-mdx-remote/rsc"; import { findType, interpretType } from "@/models/nix"; import { FilterProvider } from "@/components/layout/filterContext"; import React, { Suspense } from "react"; @@ -90,57 +89,11 @@ const Toc = async (props: TocProps) => { ); }; -// TODO: figure out why this causes hydration errors -const MDX = ({ source }: { source: string }) => ( - ( - // @ts-ignore - - ), - // @ts-ignore - h1: (p) => ( - // @ts-ignore - - ), - // @ts-ignore - h2: (p) => , - // @ts-ignore - h3: (p) => , - // @ts-ignore - h4: (p) => , - // @ts-ignore - h5: (p) => ( - // @ts-ignore - - ), - // @ts-ignore - h6: (p) => ( - // @ts-ignore - - ), - }} - /> -); +const MDX = async ({ source }: { source: string }) => { + const html = await parseMd(source); + + return
; +}; async function getManualSrc(item: Doc): Promise { // Path must be at exactly [ "builtins" ":id" ] diff --git a/website/src/components/filter.tsx b/website/src/components/filter.tsx index bb0f66a..aeaab51 100644 --- a/website/src/components/filter.tsx +++ b/website/src/components/filter.tsx @@ -199,7 +199,7 @@ export const Filter = (props: FilterProps) => { setTo(values)} diff --git a/website/src/components/markdownPreview/MarkdownPreview.tsx b/website/src/components/markdownPreview/MarkdownPreview.tsx index d4534a0..305d6fd 100644 --- a/website/src/components/markdownPreview/MarkdownPreview.tsx +++ b/website/src/components/markdownPreview/MarkdownPreview.tsx @@ -11,6 +11,12 @@ import { remarkDefinitionList, defListHastHandlers, } from "remark-definition-list"; +import { + replaceComponents, + sanitizeDirectives, + styleDirectives, +} from "@/plugins"; +import remarkDirective from "remark-directive"; interface MarkdownPreviewProps { description: string; @@ -38,7 +44,7 @@ export const MarkdownPreview = (props: MarkdownPreviewProps) => { h3: "h5", h4: "h6", }} - remarkPlugins={[remarkDefinitionList]} + remarkPlugins={[remarkDefinitionList, remarkDirective, styleDirectives]} remarkRehypeOptions={{ handlers: { ...defListHastHandlers, @@ -52,9 +58,10 @@ export const MarkdownPreview = (props: MarkdownPreviewProps) => { languages: { nix, haskell, bash, default: nix }, }, ], + replaceComponents, ]} > - {description} + {sanitizeDirectives(description)} ); diff --git a/website/src/plugins.ts b/website/src/plugins.ts new file mode 100644 index 0000000..0d285a1 --- /dev/null +++ b/website/src/plugins.ts @@ -0,0 +1,63 @@ +import { h } from "hastscript"; +import { visit } from "unist-util-visit"; +import { Element } from "hast"; + +export function styleDirectives() { + /** + * @param {import('mdast').Root} tree + * Tree. + * @returns {undefined} + * Nothing. + */ + return (tree: any) => { + visit(tree, (node) => { + if ( + node.type === "containerDirective" || + node.type === "leafDirective" || + node.type === "textDirective" + ) { + if (node.name !== "note") return; + // console.log({ node }); + + const data = node.data || (node.data = {}); + const tagName = node.type === "textDirective" ? "span" : "div"; + + data.hName = tagName; + data.hProperties = h(tagName, node.attributes || {}).properties; + } + }); + }; +} + +export function replaceComponents() { + return (tree: any) => { + visit(tree, "element", (node: Element, index, parent: Element) => { + if (["h1", "h2", "h3", "h4", "h5"].includes(node.tagName) && index) { + const level = +node.tagName.charAt(1) + 1; + // Replace h1 node with your custom component represented as an HAST node + parent.children[index] = { + type: "element", + tagName: `h${level}`, + properties: {}, // Pass props here if needed + children: node.children, // Keep the original children + }; + } + if (["a"].includes(node.tagName) && index) { + // Replace h1 node with your custom component represented as an HAST node + parent.children[index] = { + type: "element", + tagName: `a`, + properties: { + "data-link-md": true, + }, // Pass props here if needed + children: node.children, + }; + } + }); + }; +} + +export function sanitizeDirectives(markdown: string) { + const res = markdown.replace(/:::\{/g, ":::note{"); + return res; +} diff --git a/website/src/styles/globals.css b/website/src/styles/globals.css index f4c61e9..2abff15 100644 --- a/website/src/styles/globals.css +++ b/website/src/styles/globals.css @@ -37,20 +37,141 @@ table th{ } +.caution, .important, .note, .tip, .warning, .example { + background-color: #f9f9f9; + padding: 10px 15px; /* Top and bottom padding of 10px, left and right padding of 15px */ + margin: 15px 0; /* Vertical margins to separate the note from surrounding content */ + font-style: italic; /* Italic font style to indicate note text */ + color: #333; /* Dark grey color for the text for readability */ + font-family: Arial, sans-serif; /* A clean, readable font */ + border-radius: 4px; /* Slightly rounded corners for a modern look */ + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */ + border-left: 5px solid; /* Solid left border for distinction */ +} +@media (prefers-color-scheme: dark) { + .caution, .important, .note, .tip, .warning, .example { + background-color: #2c2c2c; /* Darker background for dark mode */ + color: #ccc; /* Lighter text color for readability */ + box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1); /* Lighter shadow for depth */ + } +} + +.caution::before, .important::before, .note::before, .tip::before, .warning::before, .example::before { + font-weight: bold; /* Make the "Note: " prefix bold */ +} + + + +.note::before { + content: "Note"; + color: #007bff; +} +.note { + border-left-color: #007bff; +} +@media (prefers-color-scheme: dark) { + .note::before { + color: #4a9eff; + } + .note { + border-left-color: #4a9eff; + } +} + +.example::before{ + content: "Example"; + color: #17a2b8; +} +.example { + border-left-color: #17a2b8; +} +@media (prefers-color-scheme: dark) { + .example::before { + color: #9de1fe; + } + .example { + border-left-color: #9de1fe; + } +} + +.warning::before{ + content: "Warning"; + color: #ffc107; +} +.warning { + border-left-color: #ffc107; +} +@media (prefers-color-scheme: dark) { + .warning::before { + color: #ffeeba; + } + .warning { + border-left-color: #ffeeba; + } +} + +.caution::before{ + content: "Caution"; + color: #d39e00; +} +.caution { + border-left-color: #d39e00; +} +@media (prefers-color-scheme: dark) { + .caution::before { + color: #ffd966; + } + .caution { + border-left-color: #ffd966; + } +} + +.important::before{ + content: "Important"; + color: #dc3545; +} +.important { + border-left-color: #dc3545; +} +@media (prefers-color-scheme: dark) { + .important::before { + color: #f5c6cb; + } + .important { + border-left-color: #f5c6cb; + } +} + +.tip::before{ + content: "Tip"; + color: #28a745; +} +.tip { + border-left-color: #28a745; +} +@media (prefers-color-scheme: dark) { + .tip::before { + color: #73c476; + } + .tip { + border-left-color: #73c476; + } +} + + +a[data-autolinked] { + text-decoration: none; + color: inherit; +} +a[data-autolinked]::after { + content: " #"; + font-size: smaller; + font-weight: lighter; +} dt { - float: left; - clear: left; - width: 100px; - text-align: right; font-weight: bold; - /* color: ; */ } -dt::after { - margin: 0.4rem; - content: ""; -} - * { box-sizing: border-box; diff --git a/website/src/utils.ts b/website/src/utils.ts index 11852e1..fdbd025 100644 --- a/website/src/utils.ts +++ b/website/src/utils.ts @@ -20,10 +20,15 @@ import { defListHastHandlers, } from "remark-definition-list"; -// import remarkDirective from "remark-directive"; +import remarkDirective from "remark-directive"; import { unified } from "unified"; import { rehypeExtractExcerpt } from "./excerpt"; +import { + replaceComponents, + sanitizeDirectives, + styleDirectives, +} from "./plugins"; /** * Function to generate a set from a path in lodash style @@ -119,6 +124,34 @@ type Heading = { id: string; }; +export const parseMd = async (src: string) => { + const result = await unified() + .use(remarkParse) + .use(remarkHeadingId) + .use(remarkDefinitionList) + .use(remarkUnlink) + .use(remarkDirective) + .use(styleDirectives) + .use(remarkRehype, { + handlers: { ...(defListHastHandlers as {}) }, + }) + .use(rehypeHighlight, { + detect: true, + languages: { nix, haskell, bash, default: nix }, + }) + .use(rehypeSlug, {}) + .use(rehypeAutolinkHeadings, { + behavior: "wrap", + properties: { "data-autolinked": true }, + }) + .use(replaceComponents) + .use(rehypeStringify) + .process(sanitizeDirectives(src)); + + // console.log({ result }); + return result; +}; + export const extractExcerpt = async ( content: string, maxLength: number