diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7ed5c263..a610be21 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,6 +1,6 @@
# 🧑‍💻 Contributing
-This site is built with [Astro](https://docs.astro.build). Site content is written in Markdown format located in `content`. For simple edits, you can directly edit the file on GitHub and generate a Pull Request.
+This site is built with [Vite](https://vitejs.dev) and [Svelte](https://svelte.dev). Site content is written in Markdown format located in `content`. For simple edits, you can directly edit the file on GitHub and generate a Pull Request.
## Add a framework
@@ -8,6 +8,11 @@ This site is built with [Astro](https://docs.astro.build). Site content is writt
2. Add the new framework SVG logo in `public/framework`
3. Install the ESLint plugin associated to the framework
4. In `frameworks.mjs`, add a new entry with SVG link and ESLint configuration
+5. If the framework needs a language syntax highlight, add it to the call to `getHighlighter`’s `langs` argument in `build/lib/generateContent.js`
+6. To make a playground link:
+ 1. Add a `create${FRAMEWORK}Playground.js` file in `build/lib/playground`.
+ 2. That file should export a function that returns an object with a `fromContentByFilename` method that accepts an object of filepath keys and file content values, then returns an absolute URL to a framework’s online REPL with those files loaded.
+ 3. Register its export in `build/lib/playground/index.js`
## Improve website
diff --git a/README.md b/README.md
index 096756a5..54c99e34 100644
--- a/README.md
+++ b/README.md
@@ -476,6 +476,11 @@ This project requires Node.js to be `v16.0.0` or higher.
2. Add the new framework SVG logo in `public/framework`
3. Install the ESLint plugin associated to the framework
4. In `frameworks.mjs`, add a new entry with SVG link and ESLint configuration
+5. If the framework needs a language syntax highlight, add it to the call to `getHighlighter`’s `langs` argument in `build/lib/generateContent.js`
+6. To make a playground link:
+ 1. Add a `create${FRAMEWORK}Playground.js` file in `build/lib/playground`.
+ 2. That file should export a function that returns an object with a `fromContentByFilename` method that accepts an object of filepath keys and file content values, then returns an absolute URL to a framework’s online REPL with those files loaded.
+ 3. Register its export in `build/lib/playground/index.js`
## 🧑‍💻 Contributors
diff --git a/build/lib/generateContent.js b/build/lib/generateContent.js
index 6b4ea322..bf8bce2a 100644
--- a/build/lib/generateContent.js
+++ b/build/lib/generateContent.js
@@ -25,7 +25,16 @@ async function pathExists(path) {
export default async function generateContent() {
const highlighter = await getHighlighter({
theme: componentPartyShikiTheme,
- langs: ["javascript", "svelte", "html", "hbs", "tsx", "jsx", "vue"],
+ langs: [
+ "javascript",
+ "svelte",
+ "html",
+ "hbs",
+ "tsx",
+ "jsx",
+ "vue",
+ "marko",
+ ],
});
const rootDir = await packageDirectory();
diff --git a/build/lib/playground/createMarkoPlayground.js b/build/lib/playground/createMarkoPlayground.js
new file mode 100644
index 00000000..154ac1a9
--- /dev/null
+++ b/build/lib/playground/createMarkoPlayground.js
@@ -0,0 +1,18 @@
+import nodePath from "node:path";
+import { compressToURL } from "@matschik/lz-string";
+
+const BASE = "https://markojs.com/playground/#";
+
+export default function createMarkoPlayground() {
+ return {
+ fromContentByFilename(contentByFilename) {
+ const data = Object.entries(contentByFilename).map(([path, content]) => ({
+ name: nodePath.parse(path).base,
+ path: `/components/${path}`,
+ content,
+ }));
+
+ return BASE + compressToURL(JSON.stringify(data));
+ },
+ };
+}
diff --git a/build/lib/playground/index.js b/build/lib/playground/index.js
index 900e8dc6..1e05a653 100644
--- a/build/lib/playground/index.js
+++ b/build/lib/playground/index.js
@@ -2,10 +2,12 @@ import createAlpinePlayground from "./createAlpinePlayground.js";
import createSveltePlayground from "./createSveltePlayground.js";
import createVue3Playground from "./createVue3Playground.js";
import createSolidPlayground from "./createSolidPlayground.js";
+import createMarkoPlayground from "./createMarkoPlayground.js";
export default {
vue3: createVue3Playground(),
svelte: createSveltePlayground(),
alpine: createAlpinePlayground(),
solid: createSolidPlayground(),
+ marko: createMarkoPlayground(),
};
diff --git a/content/2-templating/2-styling/marko/CssStyle.marko b/content/2-templating/2-styling/marko/CssStyle.marko
index 708991c3..529b9dbd 100644
--- a/content/2-templating/2-styling/marko/CssStyle.marko
+++ b/content/2-templating/2-styling/marko/CssStyle.marko
@@ -1,7 +1,7 @@