4 ms·
Wow, now we can write pages like { "content": [ ["html", {}, [["head", {}, []], ["body", {}, [["h1", { id: "ma
by minikomi 6y ago
Wow, now we can write pages like
{
"content": [
["html", {},
[["head", {}, []],
["body", {},
[["h1", { id: "main-header" }, [
"Welcome to my",
["span", { class: "red-text" },
["PAGE"]]]],
["h2", { id: "sub-header" }, [
"It's so cool.",
["br", {}, nil],
"Don't you think?"]]]]]]]};
- gpnt 6y agoThis is actually the exact opposite of why I have created WDR. The JSON is supposed to be only pure data. All the markup should be inside the render.
- minikomi 6y agoDon't worry mate, just mucking about. https://en.wikipedia.org/wiki/SXML https://en.wikipedia.org/wiki/SXML
- escherize 6y agoWe do basically this. [0][1] [0] escherize.com/w/hiccup.space [1] escherize.com/w/cljsfiddle
- bhl 6y agoThis is pretty close to how ProseMirror, a rich-text editor, manages its content state. Example of a schema: https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.js https://github.com/ProseMirror/prosemirror-schema-basic/blob... Example of a document converted to JSON: https://tiptap.dev/export https://tiptap.dev/export