justbe
Hiya! I'm Justin, I'm a Brooklyn, NY based engineer working here at Val.town! I co-host devtools.fm and am interested in the future of personal computing, malleable software, and anything we can build to make folks' lives easier.
Public vals
13
justbe
highlight
HTTP
Highlight This val exposes and endpoint that you can post code to and get back syntax highlighted
html via Shiki . Shiki does server side highlighting, so it's
perfect for val.town. You can switch themes by providing ?theme=<theme> and specify
the language via ?lang=<language> Example You can play with a working example here . const res = await fetch(`https://just_be-highlight.web.val.run?lang=${lang}&theme=${theme}`, {
method: "POST",
body: code,
});
console.log(await res.text()) Why? I want to add syntax highlighting to my blog soon and I'm
experimenting with what it mean to offload parts of my rendering
to val.town (behind a content-addressible cache, of course).
0