{{ format(textAreaRef?.value ?? '') }}
+ ${input.value}`;
+ output.value = highlighter.codeToHtml(input.value, {
+ lang: lang.value,
+ theme: theme.value,
+ transformers: [
+ {
+ preprocess(code) {
+ // Workaround for https://github.com/shikijs/shiki/issues/608
+ // When last span is empty, it's height is 0px
+ // so add a newline to render it correctly
+ if (code.endsWith("\n")) return `${code}\n`;
+ },
+ pre(node) {
+ preStyle.value =
+ (node.properties?.style as string) || "";
+ },
+ },
+ ],
+ });
+ isLoading.value = false;
+ }
+ }
+ })();
+
+ return {
+ lang,
+ theme,
+ allLanguages,
+ allThemes,
+ bundledLangsFull,
+ bundledLangsWeb,
+ input,
+ output,
+ isLoading,
+ preStyle,
+ };
+});
+
+if (import.meta.hot)
+ import.meta.hot.accept(acceptHMRUpdate(usePlayground, import.meta.hot));
diff --git a/decondenser-website/.vitepress/theme/style.css b/decondenser-website/.vitepress/theme/style.css
new file mode 100644
index 0000000..80370fb
--- /dev/null
+++ b/decondenser-website/.vitepress/theme/style.css
@@ -0,0 +1,4 @@
+/* Opt-in nowrap via a class */
+.nobr {
+ white-space: nowrap;
+}
diff --git a/decondenser-website/.vitepress/theme/utils.ts b/decondenser-website/.vitepress/theme/utils.ts
new file mode 100644
index 0000000..3b941c1
--- /dev/null
+++ b/decondenser-website/.vitepress/theme/utils.ts
@@ -0,0 +1,21 @@
+import { ContentData } from "vitepress";
+
+export function formatDate(date: string) {
+ return new Date(date).toISOString().split("T")[0];
+}
+
+export function sortedContentData(posts: ContentData[]): ContentData[] {
+ return [...posts].sort((a, b) => {
+ const dateA = dateFromFrontmatter(a).getTime();
+ const dateB = dateFromFrontmatter(b).getTime();
+ return dateB - dateA;
+ });
+}
+
+function dateFromFrontmatter(post: ContentData): Date {
+ if (typeof post.frontmatter.date != "string") {
+ const value = JSON.stringify(post.frontmatter, null, 2);
+ throw new Error(`Invalid frontmatter 'date' format: ${value}`);
+ }
+ return new Date(post.frontmatter.date);
+}
diff --git a/decondenser-website/.vitepress/uno.config.ts b/decondenser-website/.vitepress/uno.config.ts
new file mode 100644
index 0000000..bebdcc1
--- /dev/null
+++ b/decondenser-website/.vitepress/uno.config.ts
@@ -0,0 +1,20 @@
+import {
+ defineConfig,
+ presetAttributify,
+ presetIcons,
+ presetUno,
+} from "unocss";
+
+export default defineConfig({
+ shortcuts: {
+ "button-action":
+ "flex flex-inline gap-2 items-center justify-center px-3 py-0.5 rounded hover:color-$vp-c-brand-2 hover:bg-$vp-c-default-soft",
+ "border-base": "border-color-$vp-c-divider",
+ "text-brand": "color-$vp-c-brand-1",
+ "text-brand-yellow": "color-$vp-c-yellow-1",
+ "text-brand-red": "color-$vp-c-red-1",
+ },
+ blocklist: ["container"],
+ presets: [presetUno(), presetAttributify(), presetIcons()],
+ safelist: ["font-mono", "mb0!", "no-underline!"],
+});
diff --git a/decondenser-website/.vitepress/vite.config.ts b/decondenser-website/.vitepress/vite.config.ts
new file mode 100644
index 0000000..92230d9
--- /dev/null
+++ b/decondenser-website/.vitepress/vite.config.ts
@@ -0,0 +1,9 @@
+import { fileURLToPath } from "node:url";
+import UnoCSS from "unocss/vite";
+import { defineConfig } from "vite";
+
+export default defineConfig({
+ plugins: [
+ UnoCSS(fileURLToPath(new URL("./uno.config.ts", import.meta.url))),
+ ],
+});
diff --git a/decondenser-website/README.md b/decondenser-website/README.md
new file mode 100644
index 0000000..2280c13
--- /dev/null
+++ b/decondenser-website/README.md
@@ -0,0 +1,40 @@
+# decondenser website
+
+This folder contains the source code and markdown files that comprise the [decondenser website](https://decondenser.dev).
+
+The website is built using [VitePress](https://vitepress.dev/). It's a simple and elegant framework for static websites that hides a lot of complexity from you. You don't need to be a TypeScript expert let alone a Vue expert to get around this directory.
+
+## Local server with hot reloading
+
+If you want to make changes to the website, you need to be able to preview the updated web pages locally.
+
+First, make sure you have [NodeJS installed](https://nodejs.org/en/download/package-manager).
+
+Then install the dependencies. This command must be run from the root of the repository.
+
+```bash
+npm install --workspace decondenser-website
+```
+
+Now you can run the local server with the following command:
+
+```bash
+npm run website:dev
+```
+
+Consult [VitePress](https://vitepress.dev/) docs for help if you need any.
+
+#### License
+
+
+Licensed under either of Apache License, Version
+2.0 or MIT license at your option.
+
+
+Loading...
+ +