diff --git a/astro.config.mjs b/astro.config.mjs index 0e65f6c..4245936 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -16,6 +16,7 @@ import rehypeComponents from "rehype-components"; /* Render the custom directive import svelte from "@astrojs/svelte" import swup from '@swup/astro'; import sitemap from '@astrojs/sitemap'; +import {parseDirectiveNode} from "./src/plugins/remark-directive-rehype.js"; const oklchToHex = (str) => { const DEFAULT_HUE = 250 @@ -59,15 +60,15 @@ export default defineConfig({ sitemap(), ], markdown: { - remarkPlugins: [remarkMath, remarkReadingTime, remarkDirective, remarkDirectiveRehype], + remarkPlugins: [remarkMath, remarkReadingTime, remarkDirective, parseDirectiveNode], rehypePlugins: [ rehypeKatex, rehypeSlug, [rehypeComponents, { components: { github: GithubCardComponent, - tip: (x, y) => AdmonitionComponent(x, y, "tip"), note: (x, y) => AdmonitionComponent(x, y, "note"), + tip: (x, y) => AdmonitionComponent(x, y, "tip"), important: (x, y) => AdmonitionComponent(x, y, "important"), caution: (x, y) => AdmonitionComponent(x, y, "caution"), warning: (x, y) => AdmonitionComponent(x, y, "warning"), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4a43ed8..d5d272f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,19 +10,19 @@ importers: dependencies: '@astrojs/check': specifier: ^0.5.9 - version: 0.5.9(prettier@2.8.8)(typescript@5.4.2) + version: 0.5.9(typescript@5.4.2) '@astrojs/rss': specifier: ^4.0.5 version: 4.0.5 '@astrojs/sitemap': specifier: ^3.1.2 - version: 3.1.4 + version: 3.1.2 '@astrojs/svelte': specifier: ^5.2.0 - version: 5.4.0(astro@4.4.15(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)(typescript@5.4.2))(svelte@4.2.12)(typescript@5.4.2)(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)) + version: 5.2.0(astro@4.4.15)(svelte@4.2.12)(typescript@5.4.2)(vite@5.1.6) '@astrojs/tailwind': specifier: ^5.1.0 - version: 5.1.0(astro@4.4.15(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)(typescript@5.4.2))(tailwindcss@3.4.1) + version: 5.1.0(astro@4.4.15)(tailwindcss@3.4.1) '@fontsource-variable/jetbrains-mono': specifier: ^5.0.20 version: 5.0.20 @@ -31,10 +31,10 @@ importers: version: 5.0.12 '@swup/astro': specifier: ^1.4.0 - version: 1.4.0(@types/babel__core@7.20.5) + version: 1.4.0 astro: specifier: ^4.4.15 - version: 4.4.15(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)(typescript@5.4.2) + version: 4.4.15(stylus@0.63.0)(typescript@5.4.2) astro-compress: specifier: ^2.2.15 version: 2.2.15 @@ -195,15 +195,15 @@ packages: '@astrojs/rss@4.0.5': resolution: {integrity: sha512-IyJVL6z09AQtxbgLaAwebT3T5YKe4oTHDesqydJv1KLHw+zEzzMCFuuNsEyxjiqu7df9+DDCpDXLj/WRiEUXvw==} - '@astrojs/sitemap@3.1.4': - resolution: {integrity: sha512-po8CqDCK14O6phU1mB5C8SyVLyQEa+7pJM8oXxs1mVh8DgvxxaA5E7lak1vzOmBcyyyHBW32jakGqNYc66sBRw==} + '@astrojs/sitemap@3.1.2': + resolution: {integrity: sha512-FxOJldIl5ltZ5CNjocQxHkAO9orwHBjqtaU28o4smobp9vowS0nbGp+I9CrPxkzWdl1crSDm9vjL9tnvG1DSug==} - '@astrojs/svelte@5.4.0': - resolution: {integrity: sha512-D9/CVJ+Fy3fu+FzJ7x+0GnRUhHsJKsU6tW/xQQ1QzrFMABuEoM5U4YKTYtxWkqB4B4jNb7gbA4p9ZtEhYZ3/+w==} - engines: {node: ^18.17.1 || ^20.3.0 || >=21.0.0} + '@astrojs/svelte@5.2.0': + resolution: {integrity: sha512-GmwbXks2WMkmAfl0rlPM/2gA1RtmZzjGV2mOceV3g7QNyjIsSYBPKrlEnSFnuR+YMvlAtWdbMFBsb3gtGxnTTg==} + engines: {node: '>=18.14.1'} peerDependencies: astro: ^4.0.0 - svelte: ^4.0.0 || ^5.0.0-next.90 + svelte: ^4.0.0 || ^5.0.0-next.56 typescript: ^5.3.3 '@astrojs/tailwind@5.1.0': @@ -1710,8 +1710,8 @@ packages: '@types/sax@1.2.7': resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} - '@types/tar@6.1.13': - resolution: {integrity: sha512-IznnlmU5f4WcGTh2ltRu/Ijpmk8wiWXfF0VA4s+HPjHZgvFggk1YaIkbo5krX/zUCzWF8N/l4+W/LNxnvAJ8nw==} + '@types/tar@6.1.11': + resolution: {integrity: sha512-ThA1WD8aDdVU4VLuyq5NEqriwXErF5gEIJeyT6gHBWU7JtSmW2a5qjNv3/vR82O20mW+1vhmeZJfBQPT3HCugg==} '@types/unist@2.0.10': resolution: {integrity: sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==} @@ -4330,9 +4330,6 @@ packages: resolution: {integrity: sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - stream-replace-string@2.0.0: - resolution: {integrity: sha512-TlnjJ1C0QrmxRNrON00JvaFFlNh5TTG00APw23j74ET7gkQpTASi6/L2fuiav8pzK715HXtUeClpBTw2NPSn6w==} - streamx@2.16.1: resolution: {integrity: sha512-m9QYj6WygWyWa3H1YY69amr4nVgy61xfjys7xO7kviL5rfIEc2naf+ewFiOA+aEJD7y0JO3h2GoiUv4TDwEGzQ==} @@ -4925,9 +4922,9 @@ snapshots: '@antfu/utils@0.7.7': {} - '@astrojs/check@0.5.9(prettier@2.8.8)(typescript@5.4.2)': + '@astrojs/check@0.5.9(typescript@5.4.2)': dependencies: - '@astrojs/language-server': 2.8.2(prettier@2.8.8)(typescript@5.4.2) + '@astrojs/language-server': 2.8.2(typescript@5.4.2) chokidar: 3.6.0 fast-glob: 3.3.2 kleur: 4.1.5 @@ -4941,7 +4938,7 @@ snapshots: '@astrojs/internal-helpers@0.2.1': {} - '@astrojs/language-server@2.8.2(prettier@2.8.8)(typescript@5.4.2)': + '@astrojs/language-server@2.8.2(typescript@5.4.2)': dependencies: '@astrojs/compiler': 2.7.0 '@jridgewell/sourcemap-codec': 1.4.15 @@ -4954,13 +4951,11 @@ snapshots: volar-service-css: 0.0.33(@volar/language-service@2.1.2) volar-service-emmet: 0.0.33(@volar/language-service@2.1.2) volar-service-html: 0.0.33(@volar/language-service@2.1.2) - volar-service-prettier: 0.0.33(@volar/language-service@2.1.2)(prettier@2.8.8) + volar-service-prettier: 0.0.33(@volar/language-service@2.1.2) volar-service-typescript: 0.0.33(@volar/language-service@2.1.2) volar-service-typescript-twoslash-queries: 0.0.33(@volar/language-service@2.1.2) vscode-html-languageservice: 5.1.2 vscode-uri: 3.0.8 - optionalDependencies: - prettier: 2.8.8 transitivePeerDependencies: - typescript @@ -4992,16 +4987,15 @@ snapshots: fast-xml-parser: 4.3.6 kleur: 4.1.5 - '@astrojs/sitemap@3.1.4': + '@astrojs/sitemap@3.1.2': dependencies: sitemap: 7.1.1 - stream-replace-string: 2.0.0 zod: 3.22.4 - '@astrojs/svelte@5.4.0(astro@4.4.15(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)(typescript@5.4.2))(svelte@4.2.12)(typescript@5.4.2)(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2))': + '@astrojs/svelte@5.2.0(astro@4.4.15)(svelte@4.2.12)(typescript@5.4.2)(vite@5.1.6)': dependencies: - '@sveltejs/vite-plugin-svelte': 3.0.2(svelte@4.2.12)(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)) - astro: 4.4.15(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)(typescript@5.4.2) + '@sveltejs/vite-plugin-svelte': 3.0.2(svelte@4.2.12)(vite@5.1.6) + astro: 4.4.15(stylus@0.63.0)(typescript@5.4.2) svelte: 4.2.12 svelte2tsx: 0.6.27(svelte@4.2.12)(typescript@5.4.2) typescript: 5.4.2 @@ -5009,9 +5003,9 @@ snapshots: - supports-color - vite - '@astrojs/tailwind@5.1.0(astro@4.4.15(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)(typescript@5.4.2))(tailwindcss@3.4.1)': + '@astrojs/tailwind@5.1.0(astro@4.4.15)(tailwindcss@3.4.1)': dependencies: - astro: 4.4.15(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)(typescript@5.4.2) + astro: 4.4.15(stylus@0.63.0)(typescript@5.4.2) autoprefixer: 10.4.18(postcss@8.4.35) postcss: 8.4.35 postcss-load-config: 4.0.2(postcss@8.4.35) @@ -5971,7 +5965,7 @@ snapshots: '@iconify/types': 2.0.0 '@iconify/utils': 2.1.22 '@types/cheerio': 0.22.35 - '@types/tar': 6.1.13 + '@types/tar': 6.1.11 cheerio: 1.0.0-rc.12 extract-zip: 2.0.1 local-pkg: 0.4.3 @@ -6213,14 +6207,12 @@ snapshots: rollup: 2.79.1 slash: 3.0.0 - '@rollup/plugin-babel@5.3.1(@babel/core@7.24.0)(@types/babel__core@7.20.5)(rollup@2.79.1)': + '@rollup/plugin-babel@5.3.1(@babel/core@7.24.0)(rollup@2.79.1)': dependencies: '@babel/core': 7.24.0 '@babel/helper-module-imports': 7.22.15 '@rollup/pluginutils': 3.1.0(rollup@2.79.1) rollup: 2.79.1 - optionalDependencies: - '@types/babel__core': 7.20.5 '@rollup/plugin-commonjs@17.1.0(rollup@2.79.1)': dependencies: @@ -6252,9 +6244,8 @@ snapshots: dependencies: '@rollup/pluginutils': 5.1.0(rollup@2.79.1) js-yaml: 4.1.0 - tosource: 2.0.0-alpha.3 - optionalDependencies: rollup: 2.79.1 + tosource: 2.0.0-alpha.3 '@rollup/pluginutils@3.1.0(rollup@2.79.1)': dependencies: @@ -6273,7 +6264,6 @@ snapshots: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 - optionalDependencies: rollup: 2.79.1 '@rollup/rollup-android-arm-eabi@4.13.0': @@ -6322,26 +6312,26 @@ snapshots: magic-string: 0.25.9 string.prototype.matchall: 4.0.10 - '@sveltejs/vite-plugin-svelte-inspector@2.0.0(@sveltejs/vite-plugin-svelte@3.0.2(svelte@4.2.12)(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)))(svelte@4.2.12)(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2))': + '@sveltejs/vite-plugin-svelte-inspector@2.0.0(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6)': dependencies: - '@sveltejs/vite-plugin-svelte': 3.0.2(svelte@4.2.12)(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)) + '@sveltejs/vite-plugin-svelte': 3.0.2(svelte@4.2.12)(vite@5.1.6) debug: 4.3.4 svelte: 4.2.12 - vite: 5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2) + vite: 5.1.6(stylus@0.63.0) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.0.2(svelte@4.2.12)(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2))': + '@sveltejs/vite-plugin-svelte@3.0.2(svelte@4.2.12)(vite@5.1.6)': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.0.0(@sveltejs/vite-plugin-svelte@3.0.2(svelte@4.2.12)(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)))(svelte@4.2.12)(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)) + '@sveltejs/vite-plugin-svelte-inspector': 2.0.0(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.12)(vite@5.1.6) debug: 4.3.4 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.8 svelte: 4.2.12 svelte-hmr: 0.15.3(svelte@4.2.12) - vite: 5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2) - vitefu: 0.2.5(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)) + vite: 5.1.6(stylus@0.63.0) + vitefu: 0.2.5(vite@5.1.6) transitivePeerDependencies: - supports-color @@ -6352,22 +6342,22 @@ snapshots: on-demand-live-region: 0.1.3 swup: 4.6.0 - '@swup/astro@1.4.0(@types/babel__core@7.20.5)': + '@swup/astro@1.4.0': dependencies: '@swup/a11y-plugin': 4.5.0(swup@4.6.0) '@swup/body-class-plugin': 3.2.0(swup@4.6.0) '@swup/debug-plugin': 4.0.4(swup@4.6.0) - '@swup/fade-theme': 2.0.0(@types/babel__core@7.20.5)(swup@4.6.0) + '@swup/fade-theme': 2.0.0(swup@4.6.0) '@swup/forms-plugin': 3.4.2(swup@4.6.0) '@swup/head-plugin': 2.2.0(swup@4.6.0) - '@swup/overlay-theme': 2.0.0(@types/babel__core@7.20.5)(swup@4.6.0) - '@swup/parallel-plugin': 0.3.1(@types/babel__core@7.20.5)(swup@4.6.0) + '@swup/overlay-theme': 2.0.0(swup@4.6.0) + '@swup/parallel-plugin': 0.3.1(swup@4.6.0) '@swup/preload-plugin': 3.2.10(swup@4.6.0) '@swup/progress-plugin': 3.1.2(swup@4.6.0) - '@swup/route-name-plugin': 4.1.0(@types/babel__core@7.20.5)(swup@4.6.0) + '@swup/route-name-plugin': 4.1.0(swup@4.6.0) '@swup/scripts-plugin': 2.1.0(swup@4.6.0) '@swup/scroll-plugin': 3.3.2(swup@4.6.0) - '@swup/slide-theme': 2.0.0(@types/babel__core@7.20.5)(swup@4.6.0) + '@swup/slide-theme': 2.0.0(swup@4.6.0) swup: 4.6.0 swup-morph-plugin: 1.3.0(swup@4.6.0) transitivePeerDependencies: @@ -6387,9 +6377,9 @@ snapshots: '@swup/plugin': 4.0.0 swup: 4.6.0 - '@swup/fade-theme@2.0.0(@types/babel__core@7.20.5)(swup@4.6.0)': + '@swup/fade-theme@2.0.0(swup@4.6.0)': dependencies: - '@swup/plugin': 3.0.1(@types/babel__core@7.20.5) + '@swup/plugin': 3.0.1 '@swup/theme': 2.1.0(swup@4.6.0) swup: 4.6.0 transitivePeerDependencies: @@ -6407,9 +6397,9 @@ snapshots: '@swup/plugin': 4.0.0 swup: 4.6.0 - '@swup/overlay-theme@2.0.0(@types/babel__core@7.20.5)(swup@4.6.0)': + '@swup/overlay-theme@2.0.0(swup@4.6.0)': dependencies: - '@swup/plugin': 3.0.1(@types/babel__core@7.20.5) + '@swup/plugin': 3.0.1 '@swup/theme': 2.1.0(swup@4.6.0) swup: 4.6.0 transitivePeerDependencies: @@ -6417,21 +6407,21 @@ snapshots: - supports-color - ts-node - '@swup/parallel-plugin@0.3.1(@types/babel__core@7.20.5)(swup@4.6.0)': + '@swup/parallel-plugin@0.3.1(swup@4.6.0)': dependencies: - '@swup/plugin': 3.0.1(@types/babel__core@7.20.5) + '@swup/plugin': 3.0.1 swup: 4.6.0 transitivePeerDependencies: - '@types/babel__core' - supports-color - ts-node - '@swup/plugin@3.0.1(@types/babel__core@7.20.5)': + '@swup/plugin@3.0.1': dependencies: '@swup/browserslist-config': 1.0.1 '@swup/prettier-config': 1.1.0 chalk: 5.3.0 - microbundle: 0.15.1(@types/babel__core@7.20.5) + microbundle: 0.15.1 prettier: 2.8.8 shelljs: 0.8.5 shelljs-live: 0.0.5(shelljs@0.8.5) @@ -6457,9 +6447,9 @@ snapshots: '@swup/plugin': 4.0.0 swup: 4.6.0 - '@swup/route-name-plugin@4.1.0(@types/babel__core@7.20.5)(swup@4.6.0)': + '@swup/route-name-plugin@4.1.0(swup@4.6.0)': dependencies: - '@swup/plugin': 3.0.1(@types/babel__core@7.20.5) + '@swup/plugin': 3.0.1 swup: 4.6.0 transitivePeerDependencies: - '@types/babel__core' @@ -6477,9 +6467,9 @@ snapshots: scrl: 2.0.0 swup: 4.6.0 - '@swup/slide-theme@2.0.0(@types/babel__core@7.20.5)(swup@4.6.0)': + '@swup/slide-theme@2.0.0(swup@4.6.0)': dependencies: - '@swup/plugin': 3.0.1(@types/babel__core@7.20.5) + '@swup/plugin': 3.0.1 '@swup/theme': 2.1.0(swup@4.6.0) swup: 4.6.0 transitivePeerDependencies: @@ -6592,7 +6582,7 @@ snapshots: dependencies: '@types/node': 20.11.28 - '@types/tar@6.1.13': + '@types/tar@6.1.11': dependencies: '@types/node': 20.11.28 minipass: 4.2.8 @@ -6750,7 +6740,7 @@ snapshots: transitivePeerDependencies: - supports-color - astro@4.4.15(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)(typescript@5.4.2): + astro@4.4.15(stylus@0.63.0)(typescript@5.4.2): dependencies: '@astrojs/compiler': 2.7.0 '@astrojs/internal-helpers': 0.2.1 @@ -6811,8 +6801,8 @@ snapshots: tsconfck: 3.0.3(typescript@5.4.2) unist-util-visit: 5.0.0 vfile: 6.0.1 - vite: 5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2) - vitefu: 0.2.5(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)) + vite: 5.1.6(stylus@0.63.0) + vitefu: 0.2.5(vite@5.1.6) which-pm: 2.1.1 yargs-parser: 21.1.1 zod: 3.22.4 @@ -8502,7 +8492,7 @@ snapshots: merge2@1.4.1: {} - microbundle@0.15.1(@types/babel__core@7.20.5): + microbundle@0.15.1: dependencies: '@babel/core': 7.24.0 '@babel/plugin-proposal-class-properties': 7.12.1(@babel/core@7.24.0) @@ -8515,7 +8505,7 @@ snapshots: '@babel/preset-flow': 7.24.0(@babel/core@7.24.0) '@babel/preset-react': 7.23.3(@babel/core@7.24.0) '@rollup/plugin-alias': 3.1.9(rollup@2.79.1) - '@rollup/plugin-babel': 5.3.1(@babel/core@7.24.0)(@types/babel__core@7.20.5)(rollup@2.79.1) + '@rollup/plugin-babel': 5.3.1(@babel/core@7.24.0)(rollup@2.79.1) '@rollup/plugin-commonjs': 17.1.0(rollup@2.79.1) '@rollup/plugin-json': 4.1.0(rollup@2.79.1) '@rollup/plugin-node-resolve': 11.2.1(rollup@2.79.1) @@ -9130,16 +9120,14 @@ snapshots: postcss-load-config@3.1.4(postcss@8.4.35): dependencies: lilconfig: 2.1.0 - yaml: 1.10.2 - optionalDependencies: postcss: 8.4.35 + yaml: 1.10.2 postcss-load-config@4.0.2(postcss@8.4.35): dependencies: lilconfig: 3.1.1 - yaml: 2.4.1 - optionalDependencies: postcss: 8.4.35 + yaml: 2.4.1 postcss-merge-longhand@5.1.7(postcss@8.4.35): dependencies: @@ -9311,7 +9299,7 @@ snapshots: prebuild-install@7.1.2: dependencies: - detect-libc: 2.0.3 + detect-libc: 2.0.2 expand-template: 2.0.3 github-from-package: 0.0.0 minimist: 1.2.8 @@ -9643,10 +9631,9 @@ snapshots: dependencies: open: 8.4.2 picomatch: 2.3.1 + rollup: 2.79.1 source-map: 0.7.4 yargs: 17.7.2 - optionalDependencies: - rollup: 2.79.1 rollup-pluginutils@2.8.2: dependencies: @@ -9747,7 +9734,7 @@ snapshots: sharp@0.32.6: dependencies: color: 4.2.3 - detect-libc: 2.0.3 + detect-libc: 2.0.2 node-addon-api: 6.1.0 prebuild-install: 7.1.2 semver: 7.6.0 @@ -9890,8 +9877,6 @@ snapshots: dependencies: bl: 5.1.0 - stream-replace-string@2.0.0: {} - streamx@2.16.1: dependencies: fast-fifo: 1.3.2 @@ -10203,7 +10188,7 @@ snapshots: ts-interface-checker@0.1.13: {} tsconfck@3.0.3(typescript@5.4.2): - optionalDependencies: + dependencies: typescript: 5.4.2 tslib@2.6.2: {} @@ -10408,65 +10393,56 @@ snapshots: unist-util-stringify-position: 4.0.0 vfile-message: 4.0.2 - vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2): + vite@5.1.6(stylus@0.63.0): dependencies: esbuild: 0.19.12 postcss: 8.4.35 rollup: 4.13.0 - optionalDependencies: - '@types/node': 20.11.28 - fsevents: 2.3.3 - lightningcss: 1.24.1 stylus: 0.63.0 - terser: 5.29.2 - - vitefu@0.2.5(vite@5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2)): optionalDependencies: - vite: 5.1.6(@types/node@20.11.28)(lightningcss@1.24.1)(stylus@0.63.0)(terser@5.29.2) + fsevents: 2.3.3 + + vitefu@0.2.5(vite@5.1.6): + dependencies: + vite: 5.1.6(stylus@0.63.0) volar-service-css@0.0.33(@volar/language-service@2.1.2): dependencies: + '@volar/language-service': 2.1.2 vscode-css-languageservice: 6.2.12 vscode-languageserver-textdocument: 1.0.11 vscode-uri: 3.0.8 - optionalDependencies: - '@volar/language-service': 2.1.2 volar-service-emmet@0.0.33(@volar/language-service@2.1.2): dependencies: + '@volar/language-service': 2.1.2 '@vscode/emmet-helper': 2.9.2 vscode-html-languageservice: 5.1.2 - optionalDependencies: - '@volar/language-service': 2.1.2 volar-service-html@0.0.33(@volar/language-service@2.1.2): dependencies: + '@volar/language-service': 2.1.2 vscode-html-languageservice: 5.1.2 vscode-languageserver-textdocument: 1.0.11 vscode-uri: 3.0.8 - optionalDependencies: - '@volar/language-service': 2.1.2 - volar-service-prettier@0.0.33(@volar/language-service@2.1.2)(prettier@2.8.8): + volar-service-prettier@0.0.33(@volar/language-service@2.1.2): dependencies: - vscode-uri: 3.0.8 - optionalDependencies: '@volar/language-service': 2.1.2 - prettier: 2.8.8 + vscode-uri: 3.0.8 volar-service-typescript-twoslash-queries@0.0.33(@volar/language-service@2.1.2): - optionalDependencies: + dependencies: '@volar/language-service': 2.1.2 volar-service-typescript@0.0.33(@volar/language-service@2.1.2): dependencies: + '@volar/language-service': 2.1.2 path-browserify: 1.0.1 semver: 7.6.0 typescript-auto-import-cache: 0.3.2 vscode-languageserver-textdocument: 1.0.11 vscode-nls: 5.2.0 - optionalDependencies: - '@volar/language-service': 2.1.2 vscode-css-languageservice@6.2.12: dependencies: diff --git a/src/components/GlobalStyles.astro b/src/components/GlobalStyles.astro index 5e60013..2322680 100644 --- a/src/components/GlobalStyles.astro +++ b/src/components/GlobalStyles.astro @@ -115,11 +115,11 @@ color_set({ --display-light-icon: 1 0 --display-dark-icon: 0 1 - --admonitions-color-tip: mix(#90d73e, hsl(0 1 20), 92%) #90d73e - --admonitions-color-note: mix(#13c6dd, hsl(0 1 20), 92%) #13c6dd - --admonitions-color-important: mix(#bf4ef0, hsl(0 1 20), 92%) #bf4ef0 - --admonitions-color-warning: mix(#e3ab29, hsl(0 1 20), 92%) #e3ab29 - --admonitions-color-caution: mix(#df3b38, hsl(0 1 20), 92%) #df3b38 + --admonitions-color-tip: oklch(0.7 0.14 180) oklch(0.75 0.14 180) + --admonitions-color-note: oklch(0.7 0.14 250) oklch(0.75 0.14 250) + --admonitions-color-important: oklch(0.7 0.14 310) oklch(0.75 0.14 310) + --admonitions-color-warning: oklch(0.7 0.14 60) oklch(0.75 0.14 60) + --admonitions-color-caution: oklch(0.6 0.2 25) oklch(0.65 0.2 25) }) diff --git a/src/components/misc/Markdown.astro b/src/components/misc/Markdown.astro index 401d96b..2e35a56 100644 --- a/src/components/misc/Markdown.astro +++ b/src/components/misc/Markdown.astro @@ -10,26 +10,29 @@ const className = Astro.props.class;
- +
\ No newline at end of file diff --git a/src/plugins/rehype-component-admonition.mjs b/src/plugins/rehype-component-admonition.mjs index 918be52..895d735 100644 --- a/src/plugins/rehype-component-admonition.mjs +++ b/src/plugins/rehype-component-admonition.mjs @@ -17,10 +17,15 @@ export function AdmonitionComponent(properties, children, type) { 'Invalid admonition directive. (Admonition directives must be of block type ":::note{name="name"} :::")' ); - const title = properties?.title; + let label = null + if (properties && properties['has-directive-label']) { + label = children[0]; // The first child is the label + children = children.slice(1); + label.tagName = "div"; // Change the tag

to

+ } return h(`blockquote`, { class: `admonition bdm-${type}` }, - [ h("span", { class: `bdm-title` }, title ? title : type.toUpperCase()), ...children] + [ h("span", { class: `bdm-title` }, label ? label : type.toUpperCase()), ...children] ); } \ No newline at end of file diff --git a/src/plugins/rehype-component-github-card.mjs b/src/plugins/rehype-component-github-card.mjs index 2aa9870..70737c5 100644 --- a/src/plugins/rehype-component-github-card.mjs +++ b/src/plugins/rehype-component-github-card.mjs @@ -26,7 +26,7 @@ export function GithubCardComponent(properties, children) { const cardUuid = `GC${Math.random().toString(36).slice(-6)}` // Collisions are not important const nAvatar = h( - `span#${cardUuid}-avatar`, + `div#${cardUuid}-avatar`, { class: "gc-avatar"}, ) const nLanguage = h( @@ -39,12 +39,15 @@ export function GithubCardComponent(properties, children) { `div`, { class: "gc-titlebar" }, [ - h("span", { class: "gc-owner" }, [ - nAvatar, - h("span", { class: "gc-user" }, repo.split("/")[0] ), + h("div", { class: "gc-titlebar-left"}, [ + h("div", { class: "gc-owner" }, [ + nAvatar, + h("div", { class: "gc-user" }, repo.split("/")[0] ), + ]), + h("div", { class: "gc-divider" }, "/" ), + h("div", { class: "gc-repo" }, repo.split("/")[1] ) ]), - h("span", { class: "gc-divider" }, "/" ), - h("span", { class: "gc-repo" }, repo.split("/")[1] ) + h("div", { class: "github-logo"}) ] ) @@ -55,17 +58,17 @@ export function GithubCardComponent(properties, children) { ) const nStars = h( - `span#${cardUuid}-stars`, + `div#${cardUuid}-stars`, { class: "gc-stars" }, "00K" ) const nForks = h( - `span#${cardUuid}-forks`, + `div#${cardUuid}-forks`, { class: "gc-forks" }, "0K" ) const nLicense = h( - `span#${cardUuid}-license`, + `div#${cardUuid}-license`, { class: "gc-license" }, "0K" ) @@ -101,6 +104,7 @@ export function GithubCardComponent(properties, children) { return h(`a#${cardUuid}-card`, { class: "card-github fetch-waiting no-styling", href: `https://github.com/${repo}`, + target: '_blank', repo }, [ nTitle, diff --git a/src/plugins/remark-directive-rehype.js b/src/plugins/remark-directive-rehype.js new file mode 100644 index 0000000..0552a11 --- /dev/null +++ b/src/plugins/remark-directive-rehype.js @@ -0,0 +1,27 @@ +// biome-ignore lint/suspicious/noShadowRestrictedNames: +import { h } from 'hastscript'; +import {visit} from 'unist-util-visit' + +export function parseDirectiveNode() { + return (tree, { data }) => { + visit(tree, function (node) { + if ( + node.type === 'containerDirective' || + node.type === 'leafDirective' || + node.type === 'textDirective' + ) { + const data = node.data || (node.data = {}) + node.attributes = node.attributes || {} + if (node.children.length > 0 && node.children[0].data && node.children[0].data.directiveLabel) { + // Add a flag to the node to indicate that it has a directive label + node.attributes['has-directive-label'] = true + } + const hast = h(node.name, node.attributes) + + data.hName = hast.tagName + data.hProperties = hast.properties + } + }) + } +} +