Skip to content

Instantly share code, notes, and snippets.

@metaory
Created March 17, 2025 12:01
Show Gist options
  • Save metaory/8f2095c26698f613e15ee1171c5eb556 to your computer and use it in GitHub Desktop.
Save metaory/8f2095c26698f613e15ee1171c5eb556 to your computer and use it in GitHub Desktop.
custom element markup.json demo

run with npx:

npx markup.json custom.json > output.html

or as stdin

echo '["heyy there",["h3","custom element"],["foo","whatever",{"x11":"xorg","style":{"color":"indigo","text-align":"center"}}],["bar",{"dos":"three","style":{"background":"crimson"},"ohhh":["bbbas",{"one":"uno","pi":"three.sth.sth"}],"void":{"nada":"silent"}},"some content","more and more",["hmm","heyyy",{"why":"nope"}]],["a","lets gooo",{"class":"primary","href":["https://acme.com/search?",{"user":"foo","age":99}]},["b","byyeezz"]]]' | npx markup.json
[
"heyy there",
[
"h3",
"custom element"
],
[
"foo",
"whatever",
{
"x11": "xorg",
"style": {
"color": "indigo",
"text-align": "center"
}
}
],
[
"bar",
{
"dos": "three",
"style": {
"background": "crimson"
},
"ohhh": [
"bbbas",
{
"one": "uno",
"pi": "three.sth.sth"
}
],
"void": {
"nada": "silent"
}
},
"some content",
"more and more",
[
"hmm",
"heyyy",
{
"why": "nope"
}
]
],
[
"a",
"lets gooo",
{
"class": "primary",
"href": [
"https://acme.com/search?",
{
"user": "foo",
"age": 99
}
]
},
[
"b",
"byyeezz"
]
]
]
heyy there
<h3>
custom element
</h3>
<foo
x11="xorg"
style="color:indigo; text-align:center;"
>
whatever
</foo>
<bar
dos="three"
style="background:crimson;"
ohhh="bbbasone=uno&pi=three.sth.sth&"
void="nada:silent;"
>
some content
more and more
<hmm
why="nope"
>
heyyy
</hmm>
</bar>
<a
class="primary"
href="https://acme.com/search?user=foo&age=99&"
>
lets gooo
<b>
byyeezz
</b>
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment