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 6be5bd81..3776f706 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ How do we solve this ? Developers love having framework overview by examples. It
Svelte
-
+
- [x] Reactivity
- [x] Declare state
@@ -52,7 +52,7 @@ How do we solve this ? Developers love having framework overview by examples. It
React
-
+
- [x] Reactivity
- [x] Declare state
@@ -89,7 +89,7 @@ How do we solve this ? Developers love having framework overview by examples. It
Vue 3
-
+
- [x] Reactivity
- [x] Declare state
@@ -110,7 +110,7 @@ How do we solve this ? Developers love having framework overview by examples. It
- [x] Emit to parent
- [x] Slot
- [x] Slot fallback
- - [ ] Context
+ - [x] Context
- [x] Form input
- [x] Input text
- [x] Checkbox
@@ -126,7 +126,7 @@ How do we solve this ? Developers love having framework overview by examples. It
SolidJS
-
+
- [x] Reactivity
- [x] Declare state
@@ -153,8 +153,8 @@ How do we solve this ? Developers love having framework overview by examples. It
- [x] Checkbox
- [x] Radio
- [x] Select
-- [ ] Webapp features
- - [ ] Render app
+- [x] Webapp features
+ - [x] Render app
- [x] Fetch data
- [x] Router link
- [x] Routing
@@ -163,7 +163,7 @@ How do we solve this ? Developers love having framework overview by examples. It
Qwik
-
+
- [x] Reactivity
- [x] Declare state
@@ -179,12 +179,12 @@ How do we solve this ? Developers love having framework overview by examples. It
- [x] Lifecycle
- [x] On mount
- [x] On unmount
-- [ ] Component composition
+- [x] Component composition
- [x] Props
- [x] Emit to parent
- [x] Slot
- [x] Slot fallback
- - [ ] Context
+ - [x] Context
- [x] Form input
- [x] Input text
- [x] Checkbox
@@ -200,7 +200,7 @@ How do we solve this ? Developers love having framework overview by examples. It
Angular
-
+
- [x] Reactivity
- [x] Declare state
@@ -237,7 +237,7 @@ How do we solve this ? Developers love having framework overview by examples. It
Lit
-
+
- [x] Reactivity
- [x] Declare state
@@ -274,7 +274,7 @@ How do we solve this ? Developers love having framework overview by examples. It
Vue 2
-
+
- [x] Reactivity
- [x] Declare state
@@ -290,12 +290,12 @@ How do we solve this ? Developers love having framework overview by examples. It
- [x] Lifecycle
- [x] On mount
- [x] On unmount
-- [ ] Component composition
+- [x] Component composition
- [x] Props
- [x] Emit to parent
- [x] Slot
- [x] Slot fallback
- - [ ] Context
+ - [x] Context
- [x] Form input
- [x] Input text
- [x] Checkbox
@@ -311,7 +311,7 @@ How do we solve this ? Developers love having framework overview by examples. It
Ember
-
+
- [x] Reactivity
- [x] Declare state
@@ -348,7 +348,7 @@ How do we solve this ? Developers love having framework overview by examples. It
Alpine
-
+
- [x] Reactivity
- [x] Declare state
@@ -385,7 +385,7 @@ How do we solve this ? Developers love having framework overview by examples. It
Aurelia 1
-
+
- [x] Reactivity
- [x] Declare state
@@ -418,6 +418,43 @@ How do we solve this ? Developers love having framework overview by examples. It
- [x] Router link
- [x] Routing
+
+
+
+ Marko
+
+
+- [x] Reactivity
+ - [x] Declare state
+ - [x] Update state
+ - [x] Computed state
+- [x] Templating
+ - [x] Minimal template
+ - [x] Styling
+ - [x] Loop
+ - [x] Event click
+ - [x] Dom ref
+ - [x] Conditional
+- [x] Lifecycle
+ - [x] On mount
+ - [x] On unmount
+- [x] Component composition
+ - [x] Props
+ - [x] Emit to parent
+ - [x] Slot
+ - [x] Slot fallback
+ - [x] Context
+- [x] Form input
+ - [x] Input text
+ - [x] Checkbox
+ - [x] Radio
+ - [x] Select
+- [x] Webapp features
+ - [x] Render app
+ - [x] Fetch data
+ - [x] Router link
+ - [x] Routing
+
## 🤝 Contributing
@@ -439,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/1-reactivity/1-declare-state/marko/Name.marko b/content/1-reactivity/1-declare-state/marko/Name.marko
new file mode 100644
index 00000000..81e05194
--- /dev/null
+++ b/content/1-reactivity/1-declare-state/marko/Name.marko
@@ -0,0 +1,2 @@
+
+
+ );
+});
+
+export default UserProfile;
diff --git a/content/4-component-composition/5-context/react/App.jsx b/content/4-component-composition/5-context/react/App.jsx
index 9469aa8f..dee7d03a 100644
--- a/content/4-component-composition/5-context/react/App.jsx
+++ b/content/4-component-composition/5-context/react/App.jsx
@@ -1,7 +1,7 @@
import { useState, createContext } from "react";
import UserProfile from "./UserProfile";
-const UserContext = createContext();
+export const UserContext = createContext();
export default function App() {
// In a real app, you would fetch the user data from an API
diff --git a/content/4-component-composition/5-context/vue2/App.vue b/content/4-component-composition/5-context/vue2/App.vue
new file mode 100644
index 00000000..384d721e
--- /dev/null
+++ b/content/4-component-composition/5-context/vue2/App.vue
@@ -0,0 +1,35 @@
+
+
+
+